Skip to content
Advanced Microprocessor

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 (88, 1616, or 3232 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 55 to 88 data bits (LSB first), an optional Parity bit, and 1,1.5,1, 1.5, or 22 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:
    Baud Rate=fclockBaud Rate Factor (1×,16×,64×)\text{Baud Rate} = \frac{f_{\text{clock}}}{\text{Baud Rate Factor } (1\times, 16\times, 64\times)}

Internal Architecture of the 8251

The 8251 is housed in a 28-pin DIP package and contains five functional blocks:

  1. 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; TxEMPTY asserts when both buffer and shift registers are completely clear.
  2. Receiver Section: Receives a serial bit stream on the RxD pin, 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: RxRDY asserts when a valid character is ready to be read by the CPU.
  3. Modem Control Unit: Provides four standard RS-232 handshaking lines: DSR‾\overline{DSR} (Data Set Ready input), DTR‾\overline{DTR} (Data Terminal Ready output), RTS‾\overline{RTS} (Request To Send output), and CTS‾\overline{CTS} (Clear To Send input).
  4. Read/Write Control Logic and Data Bus Buffer: Communicates with the microprocessor bus using lines D7−D0,RD‾,WR‾,CS‾,D_7-D_0, \overline{RD}, \overline{WR}, \overline{CS}, and C/D‾C/\overline{D} (Control/Data‾\overline{\text{Data}}).

Programming the 8251: Mode, Command, and Status Formats

Following a hardware or software reset, the 8251 expects two consecutive control bytes written with C/D‾=1C/\overline{D} = 1:

1. Mode Instruction Format (Asynchronous Mode)

D7D_7D6D_6D5D_5D4D_4D3D_3D2D_2D1D_1D0D_0
Stop Bits (S2)\text{Stop Bits } (S_2)Stop Bits (S1)\text{Stop Bits } (S_1)Parity EvenParity EnableLength (L2)\text{Length } (L_2)Length (L1)\text{Length } (L_1)Baud (B2)\text{Baud } (B_2)Baud (B1)\text{Baud } (B_1)
  • Baud Rate Factor (B2,B1B_2, B_1): 00=Sync Mode;01=1×;10=16×;11=64×00 = \text{Sync Mode}; 01 = 1\times; 10 = 16\times; 11 = 64\times.
  • Character Length (L2,L1L_2, L_1): 00=5 bits;01=6 bits;10=7 bits;11=8 bits00 = 5\text{ bits}; 01 = 6\text{ bits}; 10 = 7\text{ bits}; 11 = 8\text{ bits}.
  • Parity Enable & Even (D4,D5D_4, D_5): D4=1⟹Parity enabled;D5=1⟹Even parity,D5=0⟹Odd parityD_4=1 ⟹ \text{Parity enabled}; D_5=1 ⟹ \text{Even parity}, D_5=0 ⟹ \text{Odd parity}.
  • Stop Bits (S2,S1S_2, S_1): 01=1 stop bit;10=1.5 stop bits;11=2 stop bits01 = 1\text{ stop bit}; 10 = 1.5\text{ stop bits}; 11 = 2\text{ stop bits}.

2. Command Instruction Format

After the Mode Instruction is latched, subsequent writes with C/D‾=1C/\overline{D} = 1 are interpreted as Command Words:

  • TxEN (Bit 0): Transmit Enable (1=enable TxD pin1 = \text{enable TxD pin}).
  • DTR (Bit 1): Data Terminal Ready (1=assert DTR‾ low1 = \text{assert } \overline{DTR} \text{ low}).
  • RxEN (Bit 2): Receive Enable (1=enable receiver1 = \text{enable receiver}).
  • SBRK (Bit 3): Send Break Character (1=force TxD low continuously1 = \text{force TxD low continuously}).
  • ER (Bit 4): Error Reset (1=reset all error flags in Status Register1 = \text{reset all error flags in Status Register}).
  • RTS (Bit 5): Request to Send (1=assert RTS‾ low1 = \text{assert } \overline{RTS} \text{ low}).
  • IR (Bit 6): Internal Reset (1=return 8251 to Mode Instruction state1 = \text{return 8251 to Mode Instruction state}).
  • EH (Bit 7): Enter Hunt Mode (Used in Synchronous mode to search for SYNC characters).

3. Status Read Register

Reading from the 8251 with C/D‾=1C/\overline{D} = 1 returns the internal status byte:

  • PE (Bit 3): Parity Error flag (1=parity mismatch detected1 = \text{parity mismatch detected}).
  • OE (Bit 4): Overrun Error flag (1=new character received before previous character read by CPU1 = \text{new character received before previous character read by CPU}).
  • FE (Bit 5): Framing Error flag (1=valid Stop bit not detected at expected time1 = \text{valid Stop bit not detected at expected time}).
  • 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.
Try it
8251 Framing Error Cause: What causes a Framing Error (FE) flag to be set in the 8251 Status Register?

Sources

  1. 1.Intel 8251 USART Documentation · reference · Intel (opens in a new tab)

Was this chapter useful?

Editors read every answer.

Star this chapter

Each star goes once to every reader who improved this chapter.

Finished reading?

Mark it to keep your place in the course.