RM0351
Example 2
To obtain 921.6 Kbaud with f
•
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
Table 193. Error calculation for programmed baud rates at f
Baud rate
S.No
Desired
1
2.4 KBps
2
9.6 KBps
3
19.2 KBps
4
38.4 KBps
5
57.6 KBps
6
115.2 KBps
7
230.4 KBps
8
460.8 KBps
9
921.6 KBps
10
2 MBps
11
3 MBps
12
4MBps
13
5MBps
14
6MBps
15
7MBps
16
9MBps
1. The lower the CPU clock the lower the accuracy for a particular baud rate. The upper limit of the achievable baud rate can
be fixed with these data.
Universal synchronous asynchronous receiver transmitter (USART)
CK
oversampling by 16 or by 8
Oversampling by 16 (OVER8 = 0)
Actual
BRR
2.4 KBps
0x7530
9.6 KBps
0x1D4C
19.2 KBps
0xEA6
38.4 KBps
0x753
57.6 KBps
0x4E2
115.2 KBps
0x271
230.03KBps
0x139
461.54KBps
0x9C
923.08KBps
0x4E
2 MBps
0x24
3 MBps
0x18
4MBps
0x12
N.A
N.A
N.A
N.A
N.A
N.A
N.A
N.A
= 48 MHz.
% Error =
(Calculated -
Desired)B.Rate /
Desired B.Rate
0
0
0
0
0
0
0.16
0.16
0.16
0
0
0
N.A
N.A
N.A
N.A
DocID024597 Rev 3
= 72MHz in both cases of
CK
(1)
Oversampling by 8 (OVER8 = 1)
Actual
BRR
2.4 KBps
0xEA60
9.6 KBps
0x3A94
19.2 KBps
0x1D46
38.4 KBps
0xEA3
57.6 KBps
0x9C2
115.2 KBps
0x4E1
230.4 KBps
0x270
460.06KBps
0x134
923.07KBps
0x96
2 MBps
0x44
3 MBps
0x30
4MBps
0x22
4965.51KBps
0x16
6MBps
0x14
6857.14KBps
0x12
9MBps
0x10
% Error
0
0
0
0
0
0
0
0.16
0.16
0
0
0
0.69
0
2
0
1195/1693
1282
Need help?
Do you have a question about the STM32L4x6 and is the answer not in the manual?
Questions and answers