UART (Universal Asynchronous Receiver/Transmitter)

A Universal Asynchronous Receiver/Transmitter (UART) is a hardware component that can transmit and receive binary data (digital data) serially. A UART transmits bytes of data over a single wire one bit at a time to be received by another UART at the other end. The receiving UART reconstitutes the bits back into bytes. A UART communicates using a pair of wires, one for transmitting data (TX wire) and one for receiving it (RX wire). The TX wire of one UART gets connected to the RX wire of the other as shown in Figure 1.

Figure 1: The TX wire of one UART connects to the RX wire of the other and vice versa.

In most computers, a UART is responsible for handling communications over the serial ports, commonly via an RS-232 serial port. Most microcontrollers include a UART serial communication interface, including the Arduino Uno's ATmega328.

Why it's called Universal and Asynchronous

UART devices can operate at different clock speeds and still communicate. This is what makes them asynchronous [1]. They do this by first sending a start bit, instructing the receiving UART that a byte is on its way. The receiving UART then listens in on the bit stream and reconstitutes the byte. To do this, the UARTs must agree on a bit rate at which to communicate. This bitrate configurability makes it universal [2]. The transmitting UART will change the transmitting wire's voltage level at the agreed upon bit rate one bit at a time. Receiving UARTs generally sample the voltage level of the wire at a frequency 8 times larger than the bitrate [2] as shown in Figure 2.

Figure 2: A receiving UART sampling the voltage levels to determine the bits 8x faster than the bit rate.

How it works (UART byte framing)

When idling, or not transmitting any data, the wire voltage is held high. When the transmitting UART is ready to transmit a byte, it must first transmit a start bit as shown in Figure 3. The start bit is always 0. This tells the receiver that a byte is incoming, the next bit will be the first bit of the byte being transmitted. Bits are transmitted starting with the least significant digit finishing with the most significant. After the 8th bit, a stop bit is transmitted which always has a value of 1. At least one stop bit is required. If no more bytes are pending transmission, the transmitter will go idle with a high voltage level same as the stop bit.

Figure 3: A UART transmitting a byte of information.

Common bitrates

Some common bit rates (or baud rates), in bit/s, are:

Some other common bit rates that have fallen out of fashion are:

[1] Wikipedia: Asynchronous Serial Communication, retrieved March 30th, 2014.
[2] Wikipedia: UART, retrieved March 30th, 2014.

Documentation License: