3. UART (Universal Asynchronous Receiver-Transmitter)
3.1 General Introduction
UART stands short for Universal Asynchronous Receiver Transmitter and it is a physical circuit in a micro controller or a
stand-alone IC. A UART’s main purpose is to transmit and receive serial data over two wires. In UART communication,
two#UARTs communicate directly with each other.
UARTs transmit data asynchronously, which# means there is no clock signal to synchronize the output of bits from the
transmitting UART to the sampling# of bits by the receiving UART. Instead of a clock signal, the transmitting UART adds
start and stop bits to the data packet being transferred. These bits define the beginning and end of the data packet so the
receiving UART knows when to start reading the bits.
Data transmitted via UART is organized into packets. Each#packet contains#1 start bit, 5 to 9 data bits (depending on the
UART hardware interface), an optional parity bit, and#1 or 2 stop bits:
Picture 2. UART Packet Frame
The data rate for UART range from 230.4kbps to 16Mbps.
Configurable parameters for UART are:
• Baud rate: The Baud rate is a measure of the speed of data transfer at which data can be transferred and incoming data
is read. It is expressed in bits per second (bps).
• Start Bit: The first bit of an ongoing UART data packet transmission. It indicates that the data line is leaving its idle state,
typically from logic high to logic low. It simplifies communication between transmitter and receiver, but does not deliver
meaningful data.
• Stop Bit: The last bit of an ongoing UART data packet transmission represents the end of the data transmission. It
raises the logic level back into the idle state, typically to logic high.$
• Parity bit: Parity describes the evenness or oddness of a number. The parity bit is a way for#the receiving UART to tell if
any data has#changed during transmission. After the receiving UART reads the data frame, it counts the number of bits
with a value of 1 and checks if the total#is an even or odd number.#If the parity bit is a 0 (even parity), the bits in the data
frame should total to an even number. If the parity bit is a 1 (odd parity), the 1 bits in the data frame should total to an
odd number. When# the parity bit matches the data, the UART knows that the transmission was free of error. But if the
parity bit is a 0, and the total is odd or the parity bit is a 1, and the total is even, the UART knows that bits in the data
frame have changed.
Please note that for a working UART communication it is necessary that both UART endpoints operate at the same baud
rate. Furthermore, the same configuration about the start, stop and parity bits need to be applied to both endpoints.