RTUEE / EC / EEEYr 2020 · Sem 82020

Q4Microcontroller and Embedded Systems

Question

16 marks

Q.4. (a) Compare serial I/O interface and parallel I/O interface with suitable example. [10]

(b) Draw the circuit of LED interface with 8051 micro-controller. [6]

Answer

Parallel I/O interfacing transmits multiple bits of data simultaneously, with each bit carried on its own dedicated physical wire or pin, so that an entire byte (or word) of data can be transferred in a single clock or instruction cycle; a typical example is the 8051's own Port 1, Port 2, or Port 3, where connecting all eight pins of a port directly to eight LEDs (or to an eight-bit external device such as a parallel ADC or a printer's parallel data lines) allows an entire byte of data to be written to or read from the external device in a single MOV instruction, giving parallel interfacing a substantial speed advantage over serial interfacing for short-distance, high-throughput data transfer, but at the cost of requiring a separate physical wire for every data bit (plus any needed control and handshaking lines), making parallel interfacing impractical for long-distance communication due to the cost, bulk, and signal integrity challenges (crosstalk and timing skew between the individual parallel data lines) associated with running many long parallel conductors together. Serial I/O interfacing, by contrast, transmits data one bit at a time over a single physical data wire (or a single pair of wires for full-duplex operation), using a mutually agreed protocol (such as the 8051's built-in UART operating in one of its standard asynchronous serial modes) to reconstruct the original multi-bit data value at the receiving end from the sequentially received individual bits; a typical example is the 8051's TXD and RXD pins used to serially interface with a PC's serial port or with another microcontroller, exchanging data one bit at a time at a fixed, mutually agreed baud rate. Serial interfacing requires far fewer physical wires than parallel interfacing (a critical advantage for long-distance communication, where running many parallel wires would be prohibitively costly and prone to noise and signal degradation), but achieves a correspondingly lower raw data transfer rate for a given clock or bit rate, since transferring the same byte of data serially requires eight (or more, including start, stop, and possibly parity bits) individual bit transmission periods, compared to the single, simultaneous transfer of all eight bits achieved by parallel interfacing.

AspectParallel I/OSerial I/O
Wires requiredOne per data bit (plus control lines), e.g., 8 wires for a byte.One or two wires total, regardless of data width.
Speed for a given clock rateHigher, since all bits transfer simultaneously.Lower, since bits transfer sequentially, one at a time.
Suitable transmission distanceShort distance only, due to crosstalk and wiring bulk.Long distance practical, since fewer, better-isolated wires are needed.
Typical 8051 exampleDirect connection of Port 1 to 8 LEDs or an external parallel device.TXD/RXD connection to a PC serial port or another microcontroller via UART.

LED Interface Circuit with 8051

A standard LED interface circuit connects an LED, in series with a current-limiting resistor (typically in the range of 220 to 330 ohms for a 5V supply and a standard visible LED), between a microcontroller port pin and either the supply rail or ground, depending on whether the LED is to be driven in an active-high or active-low configuration. In an active-low configuration (generally preferred for the 8051's ports, since the 8051's ports can typically sink considerably more current when pulled low than they can source when driven high, particularly for Port 0 which has no internal pull-up and for the other ports whose internal pull-ups are relatively weak), the LED's anode is connected through the current-limiting resistor to Vcc (+5V), and the LED's cathode is connected directly to the microcontroller port pin; the LED is turned on by driving the port pin low (sinking current through the LED and resistor to ground through the port pin's output transistor) and turned off by driving the port pin high, which stops current flow since both the LED's cathode and the pin are then at approximately the same high potential.

8051P1.0+5V (Vcc)330 ohmLED

This configuration is directly controlled by simple bit-level instructions such as CLR P1.0 (to turn the LED on, by pulling the pin low) and SETB P1.0 (to turn the LED off, by driving the pin high), or by a MOV instruction writing a full byte pattern to the entire port when multiple LEDs connected to different pins of the same port need to be controlled simultaneously with a single instruction, illustrating a direct, practical application of the parallel I/O interfacing principles discussed above.

It is further worth noting that many real embedded systems use both parallel and serial interfacing simultaneously, in different parts of the same design, precisely because the two interfacing styles are well suited to complementary purposes: parallel interfacing (as illustrated by the LED example above) is well matched to short-distance, simple on/off status indication or control signals internal to a single circuit board, whereas serial interfacing is reserved for the small number of connections requiring communication over a longer distance, or connections to external systems (such as a host PC or a separate remote module) where running a full parallel bus would be impractical, illustrating that the choice between serial and parallel interfacing in a given design is driven by the specific communication distance and data-rate requirements of each particular connection rather than representing a single, system-wide architectural decision.

It is further worth noting that the specific pull-down (active-low) LED drive configuration discussed for another question in this examination is a direct, practical illustration of parallel I/O interfacing as compared in this question, since each LED occupies its own dedicated port pin and is switched fully independently of any other LED on the same port, in contrast to a serial-interfaced display device (such as a serial seven-segment LED driver chip), which would instead require only a single data wire (plus a clock wire, if using a synchronous serial protocol as discussed below) regardless of how many display digits or LED segments are ultimately being controlled, at the cost of requiring additional shift-register or driver-chip logic and a corresponding software protocol to serially clock the desired display pattern into the external device one bit at a time.

Back to Paper