Skip to main content
Logo image

Section 18.2 UART protocol

In the UART protocol, an 8-bit byte (typically an ASCII
 1 
www.asciitable.com
-encoded character) is transmitted as shown in Figure 18.2.1, below. When nothing is being sent (the line is quiescent), the signal is at a logical ’1’ level. The beginning of a byte is signalled by the line going from from ’1’ to ’0’ for one bit time. This first bit is called the start bit. It is followed by the eight data bits, least-significant bit first, and then a stop bit, which is always a ’1’. The line then idles at ’1’ until the next byte. A so-called parity bit may optionally be inserted between the most significant data bit and the stop bit, and there may be an additional stop bit. But this packet format, “8 bits, no parity, 1 stop bit” (sometimes abbreviated 8N1, 8-N-1, or 8-None-1), is the most common and the one that we shall use here.
described in detail following the image
Figure 18.2.1. Structure of a typical UART data packet. The line is ’1’ when idle. The beginning of a packet is signalled by the line going from ’1’ to ’0’ (start bit). The eight data bits follow, LSB-first. The end of the packet is marked by the line going to ’1’ (stop bit) and then back to idling. The baud rate is the reciprocal of the bit time, \(T\text{.}\)
In a UART, the reciprocal of the temporal width of a single bit is called the baud rate. Common baud rates include 9600, 19,200, and 115,200. The UART receiver and transmitter operate at an agreed-upon baud rate so that the transmitter’s clock does not have to be sent alongside the data. (Old dialup modems, which are based the UART protocol, would negotiate a baud rate by sending and receiving test signals before actually commencing data transmission.) With a known baud rate, all that is required for synchronization is for the receiver to know when a new byte is beginning, and that is conveniently taken care of by the start bit.

Checkpoint 18.2.2. Baud rate.

The average keyboard user can type at a rate of 52 words per minute (a standard word is five letters and a space character). A trained typist can go as high as 90 words per minute. Assuming 90 words per minute, and 8 bits per character (ASCII code), what is a reasonable baud rate (110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200) for communicating typed text?
Answer.
Remarkably, 110 baud is sufficient even for a fast typist!

Checkpoint 18.2.3. Baud rate.

A 4 megapixel color image (24 bits/pixel) can be JPEG-compressed to about 8 bits/pixel. How long would it take to download this image over a serial link using a UART protocol at 57,600 baud (the fastest dialup modem, back in the day)?
Answer.
Approximately 700 seconds, or 12 minutes. Be grateful for WiFi and the cell phone network!