UART (Universal Asynchronous Receiver/Transmitter)
UART is one of the oldest and most widely used serial communication interfaces. It transmits data asynchronously โ without a shared clock โ using only TX (transmit) and RX (receive) lines. Both sides must agree on the baud rate, data bits, parity, and stop bits beforehand.
๐ UART Key Features
- Asynchronous: No clock line โ timing recovered from start bit edge
- Full-Duplex: Separate TX and RX lines allow simultaneous send/receive
- Point-to-Point: Typically connects two devices directly
- Configurable Format: Data bits (5โ8), parity (none/even/odd), stop bits (1/2)
- Common Baud Rates: 9600, 19200, 38400, 57600, 115200, 921600 bps
- LSB First: Data is transmitted Least Significant Bit first
- Physical Layers: TTL (3.3 V / 5 V), RS-232 (ยฑ12 V), RS-485 (differential)
๐ UART Timing Waveform
๐ง JSON Editor
๐ UART Frame Transmission Sequence
1
Idle State: TX line is held high (logic 1) โ this is called the "mark"
state
2
Start Bit: TX pulls low (logic 0) for one bit period โ the receiver detects
this falling edge to synchronise
3
Data Bits: 5โ8 data bits transmitted LSB first (D0, D1, โฆ D7)
4
Parity Bit (optional): Even or odd parity for basic error detection
5
Stop Bit(s): One or two high bits (logic 1) mark the end of the frame
โ๏ธ Common UART Configurations
| Configuration | Data Bits | Parity | Stop Bits | Common Use |
|---|---|---|---|---|
| 8N1 | 8 | None | 1 | Most common โ Arduino, ESP32, debug consoles |
| 8E1 | 8 | Even | 1 | Modbus RTU, industrial devices |
| 8O1 | 8 | Odd | 1 | Some legacy systems |
| 7E1 | 7 | Even | 1 | ASCII terminals, Modbus ASCII |
| 8N2 | 8 | None | 2 | Slow receivers needing extra stop time |
Note:
- Baud rate must be identical on both transmitter and receiver (typical tolerance โค 3 %)
- Notation format: [data bits][parity][stop bits], e.g. 8N1 = 8 data, No parity, 1 stop
- Total frame length = 1 start + data bits + parity (0 or 1) + stop bits
๐ก Standard Baud Rates
| Baud Rate | Bit Period | Byte Rate (8N1) | Typical Use |
|---|---|---|---|
| 9 600 | 104.2 ยตs | ~960 B/s | GPS, low-speed sensors |
| 115 200 | 8.68 ยตs | ~11.5 KB/s | Debug console, Bluetooth modules |
| 460 800 | 2.17 ยตs | ~46 KB/s | High-speed logging |
| 921 600 | 1.09 ยตs | ~92 KB/s | Firmware download, fast data |
โก UART vs Other Serial Interfaces
Speed
UART: ~1 Mbps typical
SPI: Tens of MHz
I2C: Up to 3.4 MHz
Wires
UART: 2 (TX + RX)
SPI: 4+ wires
I2C: 2 (SDA + SCL)
Clock
UART: Asynchronous
SPI: Synchronous
I2C: Synchronous
Topology
UART: Point-to-point
SPI: 1 master, N slaves
I2C: Multi-master bus