
UART (Universal Asynchronous Receiver/Transmitter) is one of the most fundamental and widely used communication protocols in embedded systems. Despite being decades old, it remains the go-to choice for simple serial communication between microcontrollers and peripheral devices. Understanding UART is essential for any embedded developer.
UART is a hardware communication protocol that enables asynchronous serial communication between two devices. Unlike synchronous protocols (SPI, I2C), UART does not require a shared clock signal. Instead, both devices agree on a predetermined baud rate (bits per second) before communication begins.
The key characteristics of UART include:
Each UART transmission consists of a data frame with the following components:
The most common configuration is 8N1 (8 data bits, no parity, 1 stop bit).
When transmitting the byte 0x55 (binary 01010101), the UART line transitions as follows:
The receiving UART samples the line at the agreed baud rate, synchronizing on the falling edge of the start bit.
UART requires only two wires between devices:
Many microcontrollers include additional signals like RTS (Request to Send) and CTS (Clear to Send) for hardware flow control, but these are optional.
UART voltage levels depend on the devices involved:
When connecting devices with different voltage levels, always use a level shifter or voltage divider to prevent damage.
UART is used extensively in embedded development:
Here’s how to initialize UART on an STM32 microcontroller (pseudocode):
// Configure UART at 115200 baud, 8N1UART_Config config;config.baudrate = 115200;config.wordLength = 8;config.parity = NONE;config.stopBits = 1;UART_Init(UART1, &config);// Transmit a stringconst char *message = "Hello, World!\r\n";UART_Transmit(UART1, message, strlen(message), 1000);// Receive a byteuint8_t received;UART_Receive(UART1, &received, 1, 1000);
UART remains a cornerstone of embedded communication due to its simplicity and versatility. While newer protocols offer higher speeds or more features, UART’s ease of use ensures it will continue to be a fundamental tool in embedded systems development for years to come.
Master UART, and you’ll have a reliable skill for debugging, communicating with peripherals, and building more complex embedded systems.
Quick Links
Legal Stuff



