How it works
Transmission starts when software writes to the USART_DR register; the USART hardware loads the data into the shift register and pulls TX low for one bit period (start bit), then clocks out data LSB first. Baud rate is set by USART_BRR = f_clk / (16 × baud_rate) in standard mode. The receiver samples the RX line at 16× oversampling and uses a majority-vote on the middle three samples to reject noise. RXNE flag goes high when a full byte is received; TXE goes high when the transmit data register is empty and ready for the next byte.
Key points to remember
UART uses no clock line — both devices must be configured to the same baud rate (commonly 9600, 115200, or 921600 bps). A standard UART frame at 9600 baud with 8N1 format takes about 1.04 ms per byte. Parity can be odd, even, or none; 8N1 means 8 data bits, no parity, 1 stop bit. RS-232 uses ±12 V signalling while TTL UART uses 0/3.3 V or 0/5 V logic — never connect RS-232 directly to a microcontroller GPIO. Hardware flow control using RTS/CTS is added when the transmitter can outpace the receiver.
Exam tip
The examiner always asks you to calculate baud rate register value for a given clock frequency, so remember USART_BRR = f_PCLK / (16 × baud) and also know what happens when baud rates mismatch between two devices.