To gain initial synchronization to the sender, the receiver uses oversampling, that is, the RXD line is sampled s times per bit. Furthermore, clock oscillators tend to have a non-zero drift, that is, they deviate from their nominal frequency, so even if the receiver synchronizes to the sender clock at the start of the message, it might drift away during transmission. With the selection of the baud rate, the receiver knows what bit rate to expect, but it does not know when a bit starts and hence needs to synchronize to the falling edge of the start bit. Since the communication is asynchronous, sender and receiver clocks are completely independent of each other. The frame is concluded with one or two stop bits. After the data bits, there may follow one parity bit. The number of data bits is configurable and must be set to the same value on both sender and receiver. After the start bit, the data bits are transmitted, beginning with the least significant bit. This leading edge signals to the receiver that a new transmission has begun. A frame begins with a start bit, which causes the line to got low. Note that there is no need to specify the number of start bits, since it is always one. For example, a data format with 8 data bits, even parity, and one stop bit is identified as 8E1. The nomenclature used for describing the data format is DS, where D is the number of data bits and S is the number of stop bits. However, since the feasible baud rates depend on the frequency of the system clock, different clock speeds imply different sets of available baud rates. Possible baud rates generally include the range within 9600 baud. Stop Bits: The user generally can select whether there should be one stop bit or two.īaud Rate: The UART module contains a register which allows the user to select a certain baud rate (i.e., the transmission speed, given in bits per second (bps)) from a set of possible ones. If the parity is set to even, the parity bit is 0 if the number of 1’s among the data bits is even. Parity Bit: The user can select whether there should be a parity bit or not, and if yes, whether the parity should be odd or even. Other UARTs may have a broader or smaller range. The ATmega series, for example, allows between 5 and 9 data bits. Number of Data Bits: Depending on the UART, the number of data bits can be chosen within a more or less wide range. Hence, the UART module within a microcontroller allows the application to control much of its behaviour. The UART is no communication protocol per se, but a module that can be used for asynchronous serial communication. Figure 3.1: Basic structure of a UART module.