8251 Serial Interface:
Most of the microprocessors are designed for parallel communication. In parallel communication number of lines required to transfer data depend on the number of bits to be transferred. For example, to transfer a byte of data, 8 lines are required and all 8 bits are transferred simultaneously. Thus for transmitting data over a long distance, using parallel communication is impractical due to the increase in cost of cabling. Parallel communication is also not practical for devices such as cassette tapes or a CRT terminal. In such situations, serial communication is used. In 8251 Serial Interface communication one bit is transferred at a time over a single line.
Serial data transmission can be classified on the basis of how transmission occurs.
In simplex, the hardware exists such that data transfer takes place only in one direction. There is no possibility of data transfer in the other direction. A typical example is transmission from a computer to the printer.
2. Half Duplex
The half duplex transmission allows the data transfer in both directions, but not simultaneously. A typical example is a walkie-talkie.
3. Full Duplex
The full duplex transmission allows the data transfer in both direction simultaneously. The typical example is transmission through telephone lines.
The data in the 8251 Serial Interface communication may be sent in two formats :
Fig. 14.33 shows the transmission format for asynchronous transmission. Asynchronous formats are character oriented. In this, the bits of a character or data word are sent at a constant rate, but characters can come at any rate (asynchronously) as long as they do not overlap. When no characters are being sent, a line stays high at logic 1 called mark, logic 0 is called space. The beginning of a character is indicated by a start bit which is always low. This is used to synchronize the transmitter and receiver. After the start bit, the data bits are sent with least significant bit first, followed by one or more stop bits (active high). The stop bits indicate the end of character. Different systems use 1, 1 1/2 or 2 stop bits. The combination of start bit, character and stop bits is known as frame. The start and stop bits carry no information, but are required because of the asynchronous nature of data. Fig. 14.34 illustrates how the data byte CAH would look when transmitted in the asynchronous 8251 Serial Interface format.
The data rate can be expressed as bits/sec. or characters/sec. The term bits/sec is also called the baud rate. The asynchronous format is generally used in low-speed transmission (less than 20 Kbits/sec).
The start and stop bits in each frame of asynchronous format represents wasted overhead bytes that reduce the overall character rate. These start and stop bits can be eliminated by synchronizing receiver and transmitter. Receiver and transmitter can be synchronized by having a common clock signal as shown in Fig. 14.35.
To implement serial communication in microprocessor system we need basically two devices :
Parallel to serial converter
Serial to parallel converter.
To transmit byte data it is necessary to convert byte into eight serial bits. This can be done by using the parallel to serial converter. Similarly at the reception these serial bits must be converted into parallel 8 bit data. The serial to parallel converter is used to convert 8251 Serial Interface data bits into the parallel data.
The devices are designed for this purpose are called universal asynchronous receiver-transmitter (UART). The devices which provides synchronous as well as asynchronous transmission and reception are called universal synchronous asynchronous receiver-transmitter. A good example of UART is 8250 and USART is 8251. These devices are software programmable for number of data bits, parity and number of stop bits.