Universal synchronous asynchronous receiver transmitter (USART)
Example 2
To obtain 921.6 Kbaud with f
●
In case of oversampling by 16:
USARTDIV = 48 000 000/921 600
BRR = USARTDIV = 52d = 0x34
●
In case of oversampling by 8:
USARTDIV = 2 * 48 000 000/921 600
USARTDIV = 104 (104d = 0x68)
BRR[3:0] = USARTDIV[3:0] >> 1 = 0x8 >>1 = 0x4
BRR = 0x64
Table 85.
Error calculation for programmed baud rates at f
for oversampling by 16 and by 8
Baudrate
S.No
Desired
Actual
2
2.4
3
9.6
4
19.2
5
38.4
6
57.6
57.62
7
115.2
115.11
8
230.4
230.76
9
460.8
461.54
10
921.6
923.07
11
2000
12
3000
13
4000
14
5000
15
6000
586/742
CK
Oversampling by 16 (OVER8 = 0)
USART_
BRR value
baudrate)/Desired
2.4
0x4E20
9.6
0x1388
19.2
0x9C4
38.4
0x4E2
0x341
0x1A1
0xD0
0x68
0x34
2000
0x18
3000
0x10
N.A
N.A
N.A
N.A
N.A
N.A
Doc ID 018940 Rev 1
= 48 MHz.
CK
% Error =
(calculated -
Desired
Actual
baudrate
0
2.4
0
9.6
0
19.2
0
38.4
0.03
57.59
0.08
115.25
0.16
230.21
0.16
461.54
0.16
923.07
0
2000
0
3000
N.A
4000
N.A
5052.63
N.A
6000
= 48 MHz
Oversampling by 8 (OVER8 = 1)
(calculated -
USART_
BRR value
baudrate)/Desired
0x9C40
0x2710
0x1384
0x9C2
0x681
0x340
0x1A0
0xD0
0x64
0x30
0x20
0x14
0x11
0x10
RM0091
% Error =
Desired
baudrate
0
0
0
0
0.02
0.04
0.08
0.16
0.16
0
0
0
1.05
0
Need help?
Do you have a question about the STM32F05 series and is the answer not in the manual?
Questions and answers