OTD ACADEMY
Sign in / Sign up
Library

LIBRARYUART, asynchronous serial.

UART is the simplest serial link: two wires, no shared clock, an agreed baud rate and framing. How TX/RX crossover works and what both sides must match.

UART is the simplest way two chips talk over a serial line: two wires, no shared clock, and one agreed speed. One wire carries data out (TX), the other carries it in (RX), and as long as both ends are set to the same baud rate and framing, bytes cross reliably. It is how a board talks to a terminal, a GPS, or a plug-in module.

TX, RX, and the crossover

Each device has a transmit pin (TX) and a receive pin (RX). You wire one device's TX to the other's RX, and back again, a crossover, so each side's output lands on the other's input. Both share a common ground. It is full-duplex: both directions can carry data at the same time.

Baud rate and framing

Because there is no clock line, both ends have to be preset to the same bit rate, the baud rate, with 9600 and 115200 being common. Each byte is wrapped in a frame: the idle-high line drops for one start bit, then the data bits (usually 8), an optional parity bit, then one or two stop bits. Miss the baud or the framing and the same bits arrive as garbage.

tbit=1baudtframe=10baudt_{bit} = \frac{1}{baud} \qquad t_{frame} = \frac{10}{baud}

The math is simple. At 115200 baud each bit lasts about 8.7 us, so a plain 8N1 byte, ten bits counting its start and stop, takes about 87 us. That figure is the real ceiling on how fast a single UART link moves data.

Deep dive· How far the two clocks can drift

Since each side runs its own clock, they only have to stay in step for the length of one frame, about ten bits, and the receiver resyncs on every start bit. That is why a small speed error is tolerable: the usual budget is a few percent before the last data bit samples at the wrong moment. A wildly wrong baud, double or half the target, fails completely, while a close-but-imperfect crystal usually still works. When a UART prints garbled characters, a wrong baud rate is the first thing to check.

A UART frame on a timeline: the idle-high line drops for a start bit, then eight data bits, then a stop bit.
One UART frame: idle high, a start bit, the data bits, then a stop bit.

On a One Thousand Drones board the USB link presents itself to your computer as a serial port, and this same start-and-stop framing carries the boot log and your print output while you bring the board up.

Checkpoint

Quick check

What must two UART devices agree on before they can talk?
How is one UART device's TX wired to the other device?
UART has no clock line, so what marks the start of each byte?
0 / 3 correct

One Thousand Drones engineering team · verified 2026-07