Download Print this page

ST STM32F301 6 Series Reference Manual page 728

Advanced arm-based 32-bit mcus

Advertisement

Universal synchronous/asynchronous receiver transmitter (USART/UART)
26.5.4
USART baud rate generation
The baud rate for the receiver and transmitter (Rx and Tx) are both set to the same value as
programmed in the USART_BRR register.
Equation 1: Baud rate for standard USART (SPI mode included) (OVER8 = 0 or 1)
In case of oversampling by 16, the equation is:
In case of oversampling by 8, the equation is:
Equation 2: Baud rate in smartcard, LIN and IrDA modes (OVER8 = 0)
In smartcard, LIN and IrDA modes, only oversampling by 16 is supported:
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 or 8, USARTDIV must be greater than or equal to 16d.
How to derive USARTDIV from USART_BRR register values
Example 1
To obtain 9600 baud with f
In case of oversampling by 16:
USARTDIV = 8 000 000/9600
BRR = USARTDIV = 0d833 = 0x341
In case of oversampling by 8:
USARTDIV = 2 * 8 000 000/9600
USARTDIV = 1666,66 (0d1667 = 0x683)
BRR[3:0] = 0x3 >> 1 = 0x1
BRR = 0x681
728/874
BRR[2:0] = USARTDIV[3:0] shifted 1 bit to the right.
BRR[3] must be kept cleared.
BRR[15:4] = USARTDIV[15:4]
= 8 MHz.
CK
f
CK
Tx/Rx baud
=
--------------------------------
USARTDIV
×
2
f
CK
Tx/Rx baud
=
--------------------------------
USARTDIV
f
CK
Tx/Rx baud
=
--------------------------------
USARTDIV
RM0366 Rev 5
RM0366

Advertisement

loading
Need help?

Need help?

Do you have a question about the STM32F301 6 Series and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Stm32f301 8 seriesStm32f318 8 series