MICROPROCESSORS
100504Module 5: External Communication Interface
Q1b. What is the bit transmitting or receiving capability of mode 1 in serial communication? (i) 8 bits (ii) 10 bits (iii) 11 bits (iv) 12 bits20212m
Module 5: External Communication Interface
View this question on its own page →What is the bit transmitting or receiving capability of mode 1 in serial communication?
(i) 8 bits
(ii) 10 bits
(iii) 11 bits
(iv) 12 bitsWorked SolutionAnswer: (ii) 10 bits
Explanation: 8051 Serial Mode 1 is the 8-bit UART mode (variable baud rate using Timer 1). Frame format = 1 start bit + 8 data bits + 1 stop bit = 10 bits per character. This contrasts with Mode 0 (8 bits shift register), Mode 2 (11 bits: 1 start + 8 data + 1 programmable 9th +1 stop), Mode 3 (11 bits similar to Mode 2 but variable baud). Thus Mode 1 transmits/receives 10-bit frames.
Q1c. Which serial modes possess the potential to support the multi-processor type of communication? (i) Modes 0 & 1 (ii) Modes 1 & 2 (iii) Modes 2 & 3 (iv) All of the above20202m
Module 5: External Communication Interface
View this question on its own page →Which serial modes possess the potential to support the multi-processor type of communication?
(i) Modes 0 & 1
(ii) Modes 1 & 2
(iii) Modes 2 & 3
(iv) All of the aboveWorked SolutionAnswer: (iii) Modes 2 & 3
Explanation: 8051 serial modes 2 and 3 are 9-bit UART modes (1 start + 8 data + 1 programmable 9th bit + 1 stop = 11 bits) that support ** multiprocessor communication** using the 9th bit and SM2 feature to distinguish address vs data bytes. Mode 0 is shift register (synchronous) and Mode 1 is 8-bit UART (10 bits) - both lack the 9th bit mechanism for multiprocessor addressing. Hence only Modes 2 & 3 support multiprocessor communication.
Q1c. Which byte has the capability to interrupt the slave when SM2 bit is assigned to be '1' after the initialization process in the multiprocessor mode of communication? (i) Address byte (ii) Data byte (iii) Both (i) and (ii) (iv) None of the above20212m
Module 5: External Communication Interface
View this question on its own page →Which byte has the capability to interrupt the slave when SM2 bit is assigned to be '1' after the initialization process in the multiprocessor mode of communication?
(i) Address byte
(ii) Data byte
(iii) Both (i) and (ii)
(iv) None of the aboveWorked SolutionAnswer: (i) Address byte
Explanation: In 8051 multiprocessor mode (SM2=1), SCON bit SM2 enables filtering. When SM2=1 after initialization, the slave's RI is activated only if the received 9th bit (RB8) =1, which indicates an address byte (9th bit =1 marks address, 0 marks data). Data bytes (9th bit 0) do not interrupt slaves whose SM2=1 unless their address was previously matched (then SM2 is cleared by software). Thus only address byte interrupts all slaves when SM2=1.
Q1g. What is the required baud rate for an efficient operation of serial port devices in 8051 microcontroller? (i) 1200 (ii) 2400 (iii) 4800 (iv) 960020202m
Module 5: External Communication Interface
View this question on its own page →What is the required baud rate for an efficient operation of serial port devices in 8051 microcontroller?
(i) 1200
(ii) 2400
(iii) 4800
(iv) 9600Worked SolutionAnswer: (iv) 9600 (standard; others also usable but exam expects 9600)
Explanation: For 8051 serial communication with 11.0592 MHz crystal, the common efficient baud rates generated by Timer 1 are 1200/2400/4800/9600/19200. 9600 baud (with TH1 = 0FDH, SMOD=0, Timer1 mode 2) is the most widely used reliable default for serial port devices (PC, GSM, Bluetooth modules). Higher rates like 9600 balance speed and error (<0% error at 11.0592 MHz). Hence (iv) is considered required/efficient.
Q1h. I2C uses how many lines? (i) 1 (ii) (iii) 2 (iv) 820252m
Module 5: External Communication Interface
View this question on its own page →I2C uses how many lines?
(i) 1
(ii)
(iii) 2
(iv) 8Worked SolutionAnswer: (iii) 2
Explanation: I2C (Inter-Integrated Circuit) uses 2 lines: SDA (Serial Data) and SCL (Serial Clock). It is a half-duplex, synchronous, multi-master/multi-slave bus. The question lists (ii) blank and (iii) 2, so 2 is correct. (SPI uses 3-4 lines, UART uses 2 lines but not I2C).**
Q1h. Which pin of RS232 connector is used for Transmit Data (TXD)? (i) Pin 2 (ii) Pin 1 (iii) Pin 4 (iv) Pin 320242m
Module 5: External Communication Interface
View this question on its own page →Which pin of RS232 connector is used for Transmit Data (TXD)?
(i) Pin 2
(ii) Pin 1
(iii) Pin 4
(iv) Pin 3Worked SolutionAnswer: (iv) Pin 3
Explanation: On 9-pin DB9 RS232, Pin 3 = TXD (Transmit Data), Pin 2 = RXD (Receive Data), Pin 5 = GND. On 25-pin DB25, Pin 2 = TXD. For this question's DB9-focused syllabus, TXD is Pin 3 (as per option list: 2 vs 3). The more common textbook answer for 9-pin connector: Pin 3 is TXD.
Q1i. Which lines are utilized during the enable state of hardware flow control in DTE and DCE devices of RS232? (i) CD and IR (ii) DSR and DTR (iii) RTS and CTS (iv) None of the above20212m
Module 5: External Communication Interface
View this question on its own page →Which lines are utilized during the enable state of hardware flow control in DTE and DCE devices of RS232?
(i) CD and IR
(ii) DSR and DTR
(iii) RTS and CTS
(iv) None of the aboveWorked SolutionAnswer: (iii) RTS and CTS
Explanation: In RS232 hardware flow control, RTS (Request To Send) and CTS (Clear To Send) are cross-coupled: DTE's RTS → DCE's CTS and vice-versa. When both enabled, data is transmitted only when RTS/CTS handshake is asserted (active low). DSR/DTR are modem readiness, CD is carrier detect.
Q1i. How many lines are used in the basic SPI communication? (i) 5 (ii) 2 (iii) 4 (iv) 320242m
Module 5: External Communication Interface
View this question on its own page →How many lines are used in the basic SPI communication?
(i) 5
(ii) 2
(iii) 4
(iv) 3Worked SolutionAnswer: (iv) 3 (basic; 4 with SS)
Explanation: Basic SPI uses 3 lines: MOSI, MISO, SCK. Full operation with slave select adds SS/CS as 4th line. Question lists options 5,2,4,3 - the "basic" textbook answer is 4 lines including SS, but many syllabi count 3 without SS. Among given, (iv) 3 corresponds to basic 3-wire, (iii) 4 with SS is also considered correct in many books. If counting SS, answer is 4. Here we note: MOSI+MISO+SCK+SS =4 lines; without SS =3. For this MCQ the expected answer is 4 (including SS) but the option order shows (iv) 3 as closest to three-wire. Choose 4 if strictly counting SS, otherwise 3.**
For marking: Accept 3 or 4; standard SPI = 4 lines (MOSI, MISO, SCLK, SS).
Q1j. Which protocol standard of serial communication specifies the bi-directional and half-duplex form of data transmission by allowing various numbers of drivers and receivers in bus configuration? (i) RS232 (ii) RS2485 (iii) RS422 (iv) RS42320212m
Module 5: External Communication Interface
View this question on its own page →Which protocol standard of serial communication specifies the bi-directional and half-duplex form of data transmission by allowing various numbers of drivers and receivers in bus configuration?
(i) RS232
(ii) RS2485
(iii) RS422
(iv) RS423Worked SolutionAnswer: (ii) RS485 (option typed as RS2485)
Explanation: RS485 is the bi-directional half-duplex differential bus standard allowing up to 32 drivers/32 receivers on same bus, ideal for multi-drop networks. RS232 is single-ended point-to-point, RS422 is differential but unidirectional multi-drop (one driver, multiple receivers), RS423 similar. The typo RS2485 means RS485.
Q1j. Which of the following statement is false regarding the RTS and CTS signals? (i) RTS is on the receiver side (ii) CTS is on the transmitter side (iii) RTS is made low at first (iv) CTS is made low at first20232m
Module 5: External Communication Interface
View this question on its own page →Which of the following statement is false regarding the RTS and CTS signals?
(i) RTS is on the receiver side
(ii) CTS is on the transmitter side
(iii) RTS is made low at first
(iv) CTS is made low at firstWorked SolutionAnswer: (iv) CTS is made low at first (false statement)
Explanation: In RTS/CTS handshake, RTS (Request To Send) is asserted low first by the transmitter/receiver requesting to send, then the other side asserts CTS (Clear To Send) low to grant permission. Saying "CTS is made low at first" reverses the sequence, so it is the false statement. RTS originates at DTE, CTS is response.
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q1j. Which protocol supports multi-master configuration? (i) UART (ii) I2C (iii) RS232 (iv) SPI20242m
Module 5: External Communication Interface
View this question on its own page →Which protocol supports multi-master configuration?
(i) UART
(ii) I2C
(iii) RS232
(iv) SPIWorked SolutionAnswer: (ii) I2C
Explanation: I2C supports multi-master arbitration and multi-slave. Any master can initiate transfer, bus arbitration handles collisions. UART/RS232 are point-to-point, SPI is single-master (in basic form, multi-master complex). Thus I2C is correct.
Q1j. Which protocol is commonly used for sensor interfacing? (i) I2C (ii) FTP (iii) HTTP (iv) SMTP20252m
Module 5: External Communication Interface
View this question on its own page →Which protocol is commonly used for sensor interfacing?
(i) I2C
(ii) FTP
(iii) HTTP
(iv) SMTPWorked SolutionAnswer: (i) I2C
Explanation: For sensor interfacing, I2C and SPI are common. I2C uses 2 wires (SDA, SCL) and allows multiple sensors on same bus with addressing, low pin count, ideal for embedded sensor networks. FTP/HTTP/SMTP are internet application protocols, not sensor buses.
Q2a. Write a program for 8051 to transmit "WELCOME TO INDIA" at the display connected to port 1 at 9600 baud for external crystal frequency of 11.0592 MHz.20217m
Module 5: External Communication Interface
View this question on its own page →Write a program for 8051 to transmit "WELCOME TO INDIA" at the display connected to port 1 at 9600 baud for external crystal frequency of 11.0592 MHz.
Worked SolutionProgram to transmit "WELCOME TO INDIA" at 9600 baud, 11.0592 MHz, display on port 1 (serial transmission example)
Baud 9600 with 11.0592 MHz → Timer 1 mode 2, TH1 = 0FDH, SMOD=0 → 9600. Mode 1 (8-bit UART). Assume display is serial via TXD or port 1 is shown after reception - here we transmit via SBUF repeatedly.
; 8051 Assembly - Transmit string via serial Mode 1 at 9600 baud ORG 0000H LJMP MAIN ORG 0030H MAIN: MOV TMOD,#20H ; Timer1 mode2 auto-reload MOV TH1,#0FDH ; 9600 baud @11.0592MHz MOV TL1,#0FDH MOV SCON,#50H ; mode1, 8-bit, REN=1 MOV PCON,#00H ; SMOD=0 SETB TR1 ; start timer1 MOV DPTR,#MSG NEXT: CLR A MOVC A,@A+DPTR ; fetch char JZ STOP ; 0 terminator end ACALL TRANSMIT MOV P1,A ; also display on port1 as per question INC DPTR SJMP NEXT STOP: SJMP STOP TRANSMIT: MOV SBUF,A WAIT: JNB TI,WAIT CLR TI RET MSG: DB "WELCOME TO INDIA",0 ENDC (Keil) alternative:
#include <reg51.h> void uart_init(){ TMOD=0x20; TH1=0xFD; SCON=0x50; PCON=0x00; TR1=1; } void tx(char c){ SBUF=c; while(!TI); TI=0; P1=c; } void main(){ uart_init(); char *s="WELCOME TO INDIA"; while(*s) tx(*s++); while(1);}Calculation: Baud = (2^SMOD/32)(Fosc/12/(256-TH1)). With TH1=FDH (253), Fosc=11.0592M → (1/32)(11059200/12/3)=9600. Error 0%.
Q3a. Determine if an 8051 in mode 1 can communicate with an 8051 in mode 3.20207m
Module 5: External Communication Interface
View this question on its own page →Determine if an 8051 in mode 1 can communicate with an 8051 in mode 3.
Worked SolutionCan 8051 Mode 1 communicate with Mode 3?
No, not directly without adaptation.
- Mode 1: 10-bit frame: 1 start + 8 data + 1 stop, variable baud via Timer1.
- Mode 3: 11-bit frame: 1 start + 8 data + 1 programmable 9th bit (TB8/RB8) + 1 stop, variable baud.
Receiver in Mode 3 expects 9th bit; transmitter in Mode 1 does not send it (or sends stop as 9th). Baud rates may match but frame mismatch causes framing errors and RB8 misinterpretation. Multiprocessor bit SM2 handling also differs.
If forced: Mode 3 receiver can be configured to ignore 9th bit (SM2=0, and software ignores RB8), and Mode 1 transmitter's stop bit will be sampled as 9th bit. With SM2=0, communication can succeed with 8 data bits but 9th bit is garbage. For robust communication, both sides must be same mode (both Mode 1 or both Mode 3). Mixed mode is unreliable and not recommended.
Q3b. Assume you are determined to use mode 0 as a communication mode from one 8051 to another. Outline a system of hardware and software that would allow this.20217m
Module 5: External Communication Interface
View this question on its own page →Assume you are determined to use mode 0 as a communication mode from one 8051 to another. Outline a system of hardware and software that would allow this.
Worked SolutionSystem to Use Mode 0 Between Two 8051s (Synchronous Shift Register)
Mode 0 is 8-bit synchronous shift register via RxD (data) and TxD (shift clock). To interconnect two 8051s:
Hardware: Cross-connect: Master’s RxD (P3.0) ↔ Slave’s RxD? Actually Mode 0: TX and RX share same pin RxD for data, TxD outputs clock. Connect:
- Master TxD (clock) → Slave TxD (clock) (both open-drain, need common clock source – mode 0 is half-duplex, so only one side generates clock).
- Master RxD → Slave RxD (data line) bidirectional via buffer.
Better: Use extra handshaking lines (P3.2/3.3) for direction control because clock is only generated during transmission by the sender.
Software: Master config: SCON=0x00 (mode0), sender loads SBUF, hardware clocks 8 bits; slave also SCON=0x00 with REN=1 to receive. Poll TI/RI or interrupt. Add protocol: Master asserts handshake line → slave prepares, then Master writes SBUF, waits TI, Slave reads SBUF after RI, acknowledge. Bit rate = Fosc/12. Direction reversal requires swapping master/slave role.
Limitations: Not full-duplex; need external direction control and synchronization; suitable for short distance board-to-board; for robust, prefer modes 1-3.
Q3b. Character transmission can be done by using a time delay greater than the character time before moving a new byte to SBUF. Explain why character reception must use an interrupt flag if all characters are to be received.20207m
Module 5: External Communication Interface
View this question on its own page →Character transmission can be done by using a time delay greater than the character time before moving a new byte to SBUF. Explain why character reception must use an interrupt flag if all characters are to be received.
Worked SolutionWhy Reception Must Use Interrupt Flag
Transmission can use time delay because transmitter controls timing; SBUF loaded after >character time ensures previous byte finished.
Reception is asynchronous – sender timing unpredictable, start bit arrives anytime. Polling by delay may miss bytes because:
- If polling period > character time, bytes are overwritten (overrun). 8051 double-buffering means second byte overwrites before RI flags.
- Flag RI is set at middle of stop bit, accurate timing; polling delay not synchronized to start bit, so sampling may miss.
- Continuous back-to-back characters require detection of each stop→start transition; interrupt on RI ensures every byte captured and software can read SBUF before next. Hence reception must check RI flag (poll or interrupt) not blind delay.
Q4a. Explain the interfacing of Bluetooth and Zigbee with the 8051 microcontroller.20207m
Module 5: External Communication Interface
View this question on its own page →Explain the interfacing of Bluetooth and Zigbee with the 8051 microcontroller.
Worked SolutionInterfacing Bluetooth and Zigbee with 8051
Both use UART (RS232 level via MAX232 or 3.3V logic via voltage divider) on P3.0/P3.1.
Bluetooth (e.g., HC-05):
- VCC 5V/3.3V, GND, TX→8051 RxD (P3.0), RX→8051 TxD (P3.1) via divider, EN/KEY for AT mode.
- Config 9600 baud (TH1=0FDH). Send AT commands via serial:
AT+NAME,AT+PIN. - Data: Write SBUF, poll TI; receive interrupt RI. Add 3.3V regulation if needed.
Zigbee (e.g., XBee S2):
- Pins: VCC 3.3V, GND, DIN→TxD, DOUT→RxD, plus CTS/RTS optional.
- Uses 802.15.4, mesh. Config via X-CTU: PAN ID, Channel, MY/DH/DL addresses.
- UART frames same as above; API vs AT mode. Baud 9600/115200.
- For 5V 8051, level shift 5V→3.3V on DIN.
Software common: Initialize serial mode 1, Timer1 baud, then
MOV SBUF,Atransmit to module; module handles wireless to peer. Receive bytes via ISR and process.Q7b. Discuss the RS232 communication interface with neat diagrams.20257m
Module 5: External Communication Interface
View this question on its own page →Discuss the RS232 communication interface with neat diagrams.
Worked SolutionRS232 Communication Interface
Standard: EIA RS232C, single-ended, ±3-15V (MAX232 level shifter), 25-pin DB25 or 9-pin DB9, up to 20kbps (115k with modern), 15m distance. Asynchronous start-stop bits, full-duplex via TXD/RXD.
Signals DB9: 2 RXD, 3 TXD (as Q114), 5 GND, 7 RTS,8 CTS (flow), 4 DTR,6 DSR,1 CD,9 RI. TTL from MCU via MAX232 charge-pump converts 5V↔±10V.
Frame: 1 start (0), 5-8 data, parity optional, 1-2 stop (1). Baud via Timer1 as before.
Diagram description: 8051 TxD→MAX232 T1IN→T1OUT→ DB9 Pin2/3, RxD opposite via R1IN→R1OUT. Capacitors 1µF×4 for MAX232.
Programming: SCON mode1, REN, TI/RI handling. Use interrupts for reception. Example transmission as Q37.
Advantages: Simple point-to-point PC link; disadvantages: short distance, single driver.
Q8a. Explain the interfacing of wireless communication protocols in embedded systems.20257m
Module 5: External Communication Interface
View this question on its own page →Explain the interfacing of wireless communication protocols in embedded systems.
Worked SolutionWireless Communication Protocols in Embedded Systems
- Bluetooth (IEEE 802.15.1): 2.4GHz, 10m/100m, 1-3Mbps, piconet, for HID/audio. Interfaced via HC-05 UART as Q15.
- Zigbee (802.15.4): 2.4GHz, mesh, low power, 250kbps, 75m, for sensor networks/Home automation. XBee UART.
- WiFi (802.11): High bandwidth, ESP8266/ESP32 via UART/SPI.
- RF (nRF24L01): SPI, 2.4GHz proprietary.
- LoRa: Long range, sub-GHz, for IoT.
- IR: Short range.
8051 interfaces via UART/SPI: module handles RF stack; MCU sends AT/data via serial. Choice depends on range, power, data rate, mesh.
Q8b. Explain serial ports of 8051 microcontroller. Also discuss about registers used in serial communications.20227m
Module 5: External Communication Interface
View this question on its own page →Explain serial ports of 8051 microcontroller. Also discuss about registers used in serial communications.
Worked SolutionSerial Ports of 8051 & Registers
8051 has one full-duplex UART.
Modes: Mode0 shift, Mode1 8-bit var baud, Mode2 9-bit fixed, Mode3 9-bit var.
Registers:
- SCON (98H): SM0,SM1 (mode), SM2 (mp), REN (enable), TB8,RB8, TI,RI.
- SBUF (99H): Separate shift registers for TX/RX but same address; write starts TX, read gets RX.
- PCON (87H.7 SMOD): Double baud bit.
- TMOD/TH1/TL1/TCON: Timer1 sets baud in modes 1&3.
- IE/IP: ES, PS for interrupt control.
Baud: Mode0 Fosc/12, Mode2 Fosc/64 or /32, Modes1/3 via Timer1 overflow. Frame start/data/stop handles via flags TI/RI.
- Install PocketlyBudget App•POCKETLY
Pocketly on Android
Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.
Q9d. Discuss Zigbee protocol and its advantages.20253.5m
Module 5: External Communication Interface
View this question on its own page →Discuss Zigbee protocol and its advantages.
Worked SolutionZigbee Protocol & Advantages
- Standard: IEEE 802.15.4, 2.4GHz (global) + 868/915MHz, 250kbps, mesh/star, 10-100m (up to 1.6km with PRO), 16 channels, AES-128 encryption, self-healing mesh.
- Stack: PHY/MAC + NWK + APL (Zigbee PRO).
- Advantages: Very low power (battery years), low cost, supports 65000 nodes, mesh reliability, auto-routing, low duty cycle, suitable for sensor networks, home automation, industrial IoT. Compared to Bluetooth/WiFi lower data rate but better power/mesh.
- 8051 Interface: Via XBee UART as earlier.