Prefer to click through the interactive model?
UART — study guide
The same fragments the interactive model serves, read in order. One source, two views.
The two-wire conversation
UART is the simplest way two chips talk to each other, and its simplicity is the whole reason it endures. The name stands for Universal Asynchronous Receiver/Transmitter, and every word after the first is a design decision: it is a serial link that sends bits one after another, it is asynchronous so it carries no clock wire, and it connects a transmitter on one side to a receiver on the other. Two devices, a couple of wires, an agreed speed, and a fixed shape for each byte — that is the entire arrangement.
What makes UART worth its own concept is how little it asks. There is no shared clock line to route and no address to assign, because the link joins exactly two devices wired only to each other. Each side just needs to be told one number in advance — how fast the bits go — and from then on it can both send and receive on its own pair of lines. That minimalism is why UART shows up as the first link almost every embedded build reaches for: a debug console, a GPS module, a sensor that trickles out readings.
The asynchronous, point-to-point style is what sets UART apart from its neighbors: unlike the clocked SPI bus or the addressed I2C bus, UART shares no clock and joins no more than two devices — each of those is its own concept. This concept stays on UART itself, taking apart the one idea that makes a clockless link work at all: two devices that never share a heartbeat still manage to agree, bit by bit, on what was sent.
TX to RX, and a shared ground
A UART link needs two signal wires and a shared reference. Each device has a transmit pin, TX, that it drives, and a receive pin, RX, that it listens on. The wiring is a crossover: one device's TX goes to the other device's RX, and the other device's TX comes back to the first device's RX. Miss that cross — wire TX to TX — and both sides sit there driving lines nobody is reading, which is the single most common way a first UART connection fails to work.
The third connection is the one beginners forget: a common ground between the two devices. A logic one and a logic zero are just voltages, and a voltage only means anything relative to a shared zero point. Without a tied ground the two sides have no agreement on where zero is, and the receiver cannot reliably tell a high from a low. Two data wires carry the conversation; the ground wire is what makes the voltages on them legible at all.
Because TX and RX are separate lines, each driven by its own side, both devices can talk at the same time without collision — a property called full-duplex. One direction never has to wait for the other to finish. And because the link is wired between exactly two devices, there is no addressing and no arbitration: a byte leaving one TX has precisely one place to arrive. UART is a private line between two parties, not a party line shared by many.
No clock, just an agreed speed
The defining choice in UART is the wire that is not there. A synchronous link runs a clock line alongside the data, and each tick tells the receiver exactly when to read the next bit. UART spends no wire on that. Instead both ends are set, ahead of time, to the same speed — the baud rate, measured in bits per second — and each side keeps that timing on its own. It works like two musicians who agree on a tempo before they start and then each keep it on their own, with no conductor's beat passing between them.
Once the rate is fixed, timing becomes pure arithmetic. A baud rate of 9600 means each bit occupies one nine-thousand-six-hundredth of a second on the line; 115200, a much shorter slice. The transmitter holds each bit for exactly that long, and the receiver, knowing the same number, measures out the same slices to decide where one bit ends and the next begins. Nothing on the wire announces the boundaries — the two sides simply agree on how wide a bit is and count.
That agreement is the price of dropping the clock wire. It buys real simplicity: fewer pins, no clock to route cleanly, two chips talking over almost nothing. But it means the baud rate is not negotiated on the fly — it is configuration both sides must carry before the first bit moves. Set the two ends to different speeds and neither one is wrong, exactly; they just disagree about how wide a bit is, and that disagreement is enough to turn the message to noise.
Anatomy of a frame
With no clock to mark the beat, a UART line needs a fixed shape so the receiver can find a byte inside a stream of voltage. That shape is the frame, and it works like a fixed knock before a message and a pause after it, so a listener on an otherwise quiet line can tell where the message starts and where it ends. Between bytes the line sits idle, held HIGH. Everything that follows is measured against that resting state.
A frame opens with a start bit: the line drops LOW for exactly one bit period. That falling edge is the only announcement the receiver gets — it says a byte is coming and, more importantly, marks precisely when timing begins. Then come the data bits, sent least-significant bit first, usually eight of them though anywhere from five to nine is allowed. Sending the low bit first is just a convention both sides share, but it is a convention they must share exactly, or every byte arrives bit-reversed.
After the data comes an optional parity bit — a single extra bit for error checking, present only if both sides are configured for it. Finally the frame closes with a stop bit: the line returns HIGH and stays there for at least one bit period, configurable as one, one and a half, or two. The stop bit guarantees the line is back at idle before the next start bit can pull it low, so the next falling edge is unambiguous. The most common setup packs all of this into the shorthand 8-N-1: eight data bits, no parity, one stop bit — one start bit, eight data bits, one stop bit, ten bit periods to move one byte.
Finding the middle of each bit
Knowing a bit is one nine-thousand-six-hundredth of a second wide is not quite enough; the receiver also has to know where each of those slices sits on the line. It gets that anchor from the start bit. The moment the idle-high line falls low, the receiver starts its own timer, and from that single edge it lays out every bit boundary that follows by counting bit periods at the agreed rate.
The trick is where inside each slice to actually read. The edges of a bit are the worst place to look — that is where the voltage is changing and a slightly early or late read could catch the wrong value. So the receiver aims for the center of each bit period, as far from both edges as it can get. In practice it waits about one and a half bit periods after the start edge to read the first data bit at its middle, then reads once per bit period after that, each read landing near a bit's center.
To hit that center reliably, a real UART does not read once and trust it. It samples the line many times per bit — sixteen times is typical — and uses the readings from the middle of the bit to decide the value. That oversampling gives it a cushion: as long as its timing stays close enough to the transmitter's, its middle samples keep landing inside the right bit, and every bit decodes cleanly. The cushion is real, but it is not infinite — how much timing disagreement it can absorb before a read slips into the wrong bit is the limit that governs how far two ends can drift apart.
When the speeds disagree
Everything about UART rests on one shared number, so the failure mode is exactly what you would guess: set the two ends to different baud rates and the link breaks. The reason is worth seeing in slow motion, because it is not a sudden break — it is a drift like two watches set to the same time that tick at very slightly different rates: they agree at first, then drift further apart the longer they run. The receiver anchors its timing on the start edge and then measures out bit periods at its own rate. If that rate is a little too fast or too slow, its idea of where each bit sits creeps away from where the bits actually are.
The creep is the killer, because it accumulates. A small error on the first data bit still lands the sample inside the right bit — no harm. But the receiver keeps adding that same small error to every bit boundary, so the offset grows: a little off on bit one, more on bit two, more still on bit three. By the far end of the frame the sample point can have slid nearly a whole bit period, so the receiver reads one bit's value where the next bit lives and decodes a byte that was never sent.
This is why the tolerance is tighter than it looks. Because the error compounds across the whole frame, the two ends have to agree to within roughly a couple of percent overall — in practice each side is kept under about one percent — for the last bit to still be sampled in the right place. Anything looser and short frames might survive by luck while long ones corrupt, which is worse than a clean failure. When a UART link spews garbage characters, mismatched baud is the first thing to suspect, and usually the answer.
Parity, stop bits, and catching trouble
A UART frame has no checksum and no acknowledgement, so it offers two small, cheap ways to notice that something went wrong. The first is the optional parity bit. When both sides enable it, the transmitter counts the ones in the data bits and sets the parity bit so the total comes out even — or odd, depending on which mode was agreed — and the receiver checks the same count. If a single bit flipped somewhere on the wire, the count no longer matches and the receiver knows the byte is bad.
Parity is honest about its limits. It can tell you that an odd number of bits flipped, but it cannot tell you which one, so it can flag an error without fixing it. And if two bits flip together the count comes out right again, so parity misses it entirely. It is a smoke detector, not a repair — one bit of confidence that the byte is probably intact, bought for the cost of one extra bit per frame. Many links skip it, which is what the N in 8-N-1 means: no parity at all.
The second check comes free with the frame's shape. The receiver expects the line to be HIGH at the stop-bit position, because that is what a stop bit is. If it samples that spot and finds the line still LOW, something has gone wrong — most often a baud mismatch that has dragged the sampling out of alignment — and it raises a framing error. Neither check makes UART reliable the way an acknowledged protocol is; together they are just enough to turn silent corruption into a noticed one, which is often all a simple link needs.
The link you meet first
On a small self-driving car, UART is usually the first real conversation the build has. The GPS module that reports position almost certainly streams its fixes out over a UART line, one sentence of text after another at a fixed baud. When the controller is misbehaving and you need to see what it is thinking, the debug console you read on a laptop is a UART link too — the oldest and most dependable window into an embedded board. And two boards that need to trade a little data often reach for UART before anything fancier, precisely because it costs so few wires.
That reach is also why its one requirement bites so often. Because both ends must carry the same baud rate as configuration, a UART link that is wired perfectly will still produce nothing but garbage if one side is set to 9600 and the other to 115200. There is no negotiation to catch it and no error message that spells it out — just scrambled characters until someone checks the numbers. Getting the baud right, the crossover right, and the ground tied is the whole ritual, and it is the first ritual of bringing up almost any peripheral.
UART earns its place as the entry point to hardware communication because it isolates the one idea every serial link is built on: framing bits in time against an agreed rate. The buses that come after it add clocks, addresses, arbitration, and speed, but they are all answering questions UART poses in its simplest form. Learn to see a byte as a start bit, some data, and a stop bit measured against a shared tempo, and every protocol after it becomes a variation on a shape you already know.