8251 USART: Serial Communication, Mode & Status Words
Asynchronous and synchronous frames, transmitter/receiver buffers, baud rate factors, parity, framing errors, and RS-232 signals.
Knova editors11 min readQuick checkSources
The 8251 Universal Synchronous/Asynchronous Receiver Transmitter (USART)
Microprocessors operate on parallel data buses (, , or bits wide). However, transferring parallel data over long physical distances requires expensive multi-conductor cabling, suffers from signal skew, and induces crosstalk.
Serial communication solves this by transmitting data bit-by-bit sequentially over a single pair of conductors. The Intel 8251A USART acts as the peripheral bridge between the parallel data bus of the microprocessor and external serial communication links.
Serial Transmission Fundamentals
- Asynchronous Transmission: Characters are framed by a Start bit (Logic 0 / Space), followed by to data bits (LSB first), an optional Parity bit, and or Stop bits (Logic 1 / Mark). No shared clock line is required between transmitter and receiver; timing is synchronized on the falling edge of the Start bit.
- Synchronous Transmission: Data blocks are transmitted as a continuous bit stream without start or stop bits. Synchronization is achieved using one or two preceding SYNC characters. A common clock synchronizes transmitter and receiver.
- Baud Rate: The number of signal state transitions per second:
Internal Architecture of the 8251
The 8251 is housed in a 28-pin DIP package and contains five functional blocks:
- Transmitter Section: Converts parallel data bytes received from the CPU into a serial bit stream on the
TxD(Transmit Data) pin. It employs double buffering:- Transmitter Buffer Register: Holds the parallel byte written by the CPU.
- Transmitter Shift Register: Serializes the byte, automatically prepending start bits and appending parity and stop bits.
- Status Signals:
TxRDY(Transmitter Ready) asserts when the buffer is empty and ready for the next byte;TxEMPTYasserts when both buffer and shift registers are completely clear.
- Receiver Section: Receives a serial bit stream on the
RxDpin, strips start/stop bits, checks parity, and converts bits into a parallel byte for the CPU:- Receiver Shift Register: Assembles incoming serial bits.
- Receiver Buffer Register: Holds the completed parallel byte.
- Status Signal:
RxRDYasserts when a valid character is ready to be read by the CPU.
- Modem Control Unit: Provides four standard RS-232 handshaking lines: (Data Set Ready input), (Data Terminal Ready output), (Request To Send output), and (Clear To Send input).
- Read/Write Control Logic and Data Bus Buffer: Communicates with the microprocessor bus using lines and (Control/).
Programming the 8251: Mode, Command, and Status Formats
Following a hardware or software reset, the 8251 expects two consecutive control bytes written with :
1. Mode Instruction Format (Asynchronous Mode)
| Parity Even | Parity Enable |
- Baud Rate Factor (): .
- Character Length (): .
- Parity Enable & Even (): .
- Stop Bits (): .
2. Command Instruction Format
After the Mode Instruction is latched, subsequent writes with are interpreted as Command Words:
- TxEN (Bit 0): Transmit Enable ().
- DTR (Bit 1): Data Terminal Ready ().
- RxEN (Bit 2): Receive Enable ().
- SBRK (Bit 3): Send Break Character ().
- ER (Bit 4): Error Reset ().
- RTS (Bit 5): Request to Send ().
- IR (Bit 6): Internal Reset ().
- EH (Bit 7): Enter Hunt Mode (Used in Synchronous mode to search for SYNC characters).
3. Status Read Register
Reading from the 8251 with returns the internal status byte:
- PE (Bit 3): Parity Error flag ().
- OE (Bit 4): Overrun Error flag ().
- FE (Bit 5): Framing Error flag ().
- TxEMPTY (Bit 2): Both Transmitter Buffer and Shift Register are empty.
- RxRDY (Bit 1): Received character ready in buffer.
- TxRDY (Bit 0): Transmitter buffer ready to accept next byte.