Fundamentals/UART/One byte on one wire
Chapter · UART

One byte on one wire

Which wire goes where, how an idle line wakes the receiver with a start bit, how a byte becomes highs and lows, how a frame ends, and what baud means.

  1. 01Two wires, no clock4 minA UART link is three wires, TX to RX, RX to TX and ground to ground, and no clock wire at all. Both devices agreed the speed beforehand, so a link that fails is usually one of those three wires on the wrong pin, or that agreement broken.
  2. 02Idle high, then a start bit4 minA UART line rests high, and a byte begins when it falls for one beat, the start bit. That fall is the only warning the receiver gets, and it starts the receiver's own timer.
  3. 03The data bits, low bit first4 minA byte is a number from 0 to 255, and a UART puts it on the wire one bit at a time, lowest bit first. The pattern you read on the line is the number written backwards, and the UART neither knows nor cares what the number means.
  4. 04Stop bit, parity and 8N15 minA byte goes down a UART line inside a frame - a start bit, the data bits, an optional parity bit and one or more stop bits. 8N1 is the setting nearly everything uses, and parity is a weak check that catches some errors and misses others.
  5. 05Baud: the speed you agree on4 minBaud is the number of beats a second on the line, and the two ends agree it beforehand because nothing on the wire carries it. On a plain UART it equals bits per second, but an 8N1 byte spends ten beats on eight data bits, so the data moves at 80 % of it.

Start at 01 and read down — the order is the order things get easier in. Or take the one with your part in it; every article stands on its own, and links back to whatever it needs.