RM0016 Universal asynchronous receiver transmitter (UART)
Doc ID 14587 Rev 8 321/449
22.3.4 High precision baud rate generator
The receiver and transmitter (Rx and Tx) are both set to the same baud rate programmed by
a 16-bit divider UART_DIV according to the following formula:
The UART_DIV baud rate divider is an unsigned integer, coded in the BRR1 and BRR2
registers as shown in Figure 118.
Refer to Table 54. for typical baud rate programming examples.
Figure 118. How to code UART_DIV in the BRR registers
Note: The Baud Counters will be updated with the new value of the Baud Registers after a write to
BRR1. Hence the Baud Register value should not be changed during a transaction. The
BRR2 should be programmed before BRR1.
Note: UART_DIV must be greater than or equal to 16d.
Tx/ Rx baud rate =
f
MASTER
UART_DIV
7
0
7
0
UART_BRR1
UART_BRR2
4 3
Example: To obtain 9600 baud with f
MASTER
= 10 MHz.
UART_DIV[15:12]UART_DIV[11:4] UART_DIV[3:0]
UART_DIV = 1042d = 0x0412
See Table 54.
register = 0x02
UART_DIV = 10 000 000/9600
register = 0x41
0x41
0x2
0x0