Universal synchronous/asynchronous receiver transmitter (USART/UART)
USARTDIV is an unsigned fixed point number that is coded on the USART_BRR register.
•
When OVER8 = 0, BRR = USARTDIV.
•
When OVER8 = 1
–
–
–
Note:
The baud counters are updated to the new value in the baud registers after a write operation
to USART_BRR. Hence the baud rate register value should not be changed during
communication.
In case of oversampling by 16 and 8, USARTDIV must be greater than or equal to 16.
How to derive USARTDIV from USART_BRR register values
Example 1
To obtain 9600 baud with usart_ker_ck_pres= 8 MHz:
•
In case of oversampling by 16:
USARTDIV = 8 000 000/9600
BRR = USARTDIV = 833d = 0341h
•
In case of oversampling by 8:
USARTDIV = 2 * 8 000 000/9600
USARTDIV = 1666,66 (1667d = 683h)
BRR[3:0] = 3h >>1 = 1h
BRR = 0x681
Example 2
To obtain 921.6 Kbaud with usart_ker_ck_pres = 48 MHz:
•
In case of oversampling by 16:
USARTDIV = 48 000 000/921 600
BRR = USARTDIV = 52d = 34h
•
In case of oversampling by 8:
USARTDIV = 2 * 48 000 000/921 600
USARTDIV = 104 (104d = 68h)
BRR[3:0] = USARTDIV[3:0] >> 1 = 8h >> 1 = 4h
BRR = 0x64
37.5.8
Tolerance of the USART receiver to clock deviation
The USART asynchronous receiver operates correctly only if the total clock system
deviation is less than the tolerance of the USART receiver.
1612/2126
BRR[2:0] = USARTDIV[3:0] shifted 1 bit to the right.
BRR[3] must be kept cleared.
BRR[15:4] = USARTDIV[15:4]
RM0440 Rev 4
RM0440
Need help?
Do you have a question about the STM32G4 Series and is the answer not in the manual?