Go back to Communication Protocol overview

UART

Overview

UART stands for a “Universal Asynchronous Receiver/Transmitter” and was developed by Gordon Bell at Digital Equipment Corporation in the 1960's. The “Universal” portion is with regards to fact that the format of the data and the speed of the transmission are configurable. UARTs are able to communicate in several different modes: full duplex, half duplex (the two devices communicate with each other one at a time) or simplex (the data communication is one way only). Because UARTs are configurable in their communication style, both the transmitting and receiving UART need to be configured in the exact same way to ensure that successful communication occurs.

Design

UARTs are designed to communicate with other UARTs, although they generally do not directly generate the communication themselves; only transmit and receive the signals. The transmitting UART will receive a byte from the host board and then using it's internal shift register first send a “start” bit to communicate to the receiving UART that information is about to be transferred. The byte of information is then sent one bit at a time followed by a “stop” bit after the expected number of bits has been recieved, letting the communication line go high. The receiving UART takes the stream of bits and uses its SIPO shift register to make the data available to it's host controller.

For the Pmod line, there are two different variations of UART that are used. The reason for this is primarily historical; at the time that UART pin interfaces were designed, microcontroller chips had completely separate SPI and UART interfaces that had no relation to each other. However, as newer microcontroller chips were developed, such as some of the newer PIC32s, they had serial interfaces that could work with both SPI and UART. To accommodate for this change, some UART interfaces on Pmods were also adjusted from the old standard so that they could easily share the same pins as the SPI pinouts.

All of the Pmods that use a UART communication style, namely the PmodRS232 and the formerly made PmodRS232X, have their DB9 connector set up in a DCE (Data Circuit-Terminating Equipment or Data Communications Equipment) format as Pmods themselves cannot perform their intended purpose by themselves. They must be connected to a host system in order to successfully operate.

Actually Communicating via UART

In principle, UART only requires two signal lines to successfully communicate: a TXD (transmit data) and RXD (receive data) line as well as a common ground line (used as a reference point). When communicating with another UART device, the TXD line will be attached to a corresponding RXD line, and vice-versa. No clock line is used with the UART protocol. Rather, users instead specify a particular baud rate for the two devices to operate at.

A baud rate indicates how many bits, including data, start, stop, and parity bits, are transferred over the data lines in a one second time frame. A common UART communication configuration uses a start bit, 8 data bits, no parity, and a single stop bit.

insert picture of described configuration

In terms of communicating with a host board, there are two required signal lines with up to four total signal lines that are available. The two required lines are the TXD (transmit data) and RXD (receive data). The remaining two signal lines available are the RTS (ready to send) and CTS (clear to send). These two signals, if used, are commonly asserted independently by the two devices that are communicating. One device will lower (bring to a low voltage state) its RTS line and “listen” on the CTS line. The second device, once ready, will lower its RTS line, which will be detected on the first device's CTS line, and listen for the lowered RTS signal from the first device on its own CTS line. Once both devices have indicated that they are ready, data transmission can occur.

However, the RTS and CTS lines are not required to be connected. When flow control is disabled, these pins will be ignored altogether. Since a “start bit” is always sent first, this incoming transition can easily be detected by the system board, triggering an interrupt signal to indicate that there is incoming data.

more notes