You are currently not logged in and your progress will not be saved. Register or Log in

UART Protocol

UART is a peer-to-peer (P2P) hardware communication protocol where one end can be an MCU (microcontroller) and the other end can be another MCU, a sensor or a PC (through a USB-to-UART converter).

Note

All Nordic devices have a USB-to-UART converter onboard to allow serial communication to a PC.

Data transfer is done serially. It starts with a starting bit, usually by driving logic low for one clock cycle. In the next n clock cycles, n bits are sent sequentially from the transmitter (n is usually 8). Optionally, 1 parity bit can be added to improve transfer reliability. In the end, the data wire is usually pulled up high to indicate the end of transfer.

Definition

Parity bit: A parity bit describes the evenness or oddness of the data and is a way for the receiver to tell if the data has changed during transmission.

UART timing diagram
Source: Wikipedia

UART has one connection pin for transmitted data, usually called TX, and another for received data, called RX. These connections are cross-coupled between a transmitter and a receiver. So the TX on one device is connected to the RX on the remote device and vice versa. GND stands for ground.

UART connection

The RX pin senses when a start bit has been initiated and automatically clocks in to store the new word. The data rate that the receiver and transmitter will operate at must be selected in advance; this is known as the baud rate. Common baud rate values for UART are 115200 or 9600 bits/s, or bauds.

It is also possible to use hardware flow control with UART using two extra lines called RTS (ready to send) and CTS (clear to send).

UART connection with hardware flow control

These wires are cross-coupled between the two devices. If hardware flow control is enabled, each end will use its RTS to output if it is ready to accept new data and read CTS to see if it is allowed to send data to the other end.