Skip to main content

Subsection 3.1.3 The Frame

The receiver also has to know exactly when a new byte begins. The wire idles HIGH whenever nothing is being transmitted, so to announce the start of a byte the STM32C031C6 pulls it LOW for exactly one bit period. This is the start bit. After the start bit come the 8 data bits, sent least-significant bit first, D0 before D7. A final stop bit, always HIGH, closes the transmission and guarantees the line returns to idle before the next byte arrives.
The complete frame for transmitting ‘E’ at 9600 baud is shown in Figure 3.1.2. The idle state is HIGH, so the start bit is a falling edge, a sharp, unambiguous signal even after a long silence. Notice also that D3, D4 and D5 are all zero, so from the outside those three bit periods look identical to one long LOW pulse; only a receiver that samples at the agreed baud rate counts them as three separate bits, which is why a mismatched baud rate produces garbled output rather than silence. To decode the frame yourself, read D7 down to D0 as 01000101 and convert: \(64 + 4 + 1 = 69\text{,}\) which is ASCII 69, the letter ‘E’.
Figure 3.1.2. UART frame for the character ‘E’ (ASCII 69 = 0b01000101) at 9600 baud. Each bit lasts 104 µs. The start bit is a falling edge from the idle-high line. Data bits are sent LSB first, D0 through D7. The stop bit returns the line HIGH, ready for the next start bit.
Figure 3.1.3. General UART frame structure: the line idles HIGH, a start bit pulls it LOW, eight data bits follow (LSB first), an optional parity bit may be included, and one or more stop bits return the line to idle. We use 8N1: 8 data bits, no parity, 1 stop bit.