AT32F425
Series Reference Manual
2022.03.30
Page 151
Ver 2.01
3.
Configure the source of DMA transfer: Configure the USART_DT register address as the source of
DMA transfer in the DMA control register. Data will be loaded from the USART_DT register to the
programmed destination after reception request is received by DMA.
4.
Configure the total number of bytes to be transferred in the DMA control register.
5.
Configure the channel priority of DMA transfer in the DMA control register.
6.
Configure DMA interrupt generation after half or full transfer in the DMA control register.
7.
Enable a DMA transfer channel in the DMA control register.
12.6
Baud rate generation
12.6.1 Introduction
USART baud rate generator uses an internal counter based on PCLK. The DIV (USART_BAUDR [15:0]
register) represents the overflow value of the counter. Each time the counter is full, it denotes one-bit
data. Thus each data bit width refers to PCLK cycles x DIV.
The receiver and transmitter of USART share the same baud rate generator, and the receiver splits each
data bit into 16 equal parts to achieve oversampling, so the data bit width should not be less than 16
PCLK periods, that is, the DIV value must be greater than 16.
12.6.2 Configuration
User can program the desired baud rate by setting different system clocks and writing different values
into the USART_BAUDR register. The calculation format is as follows:
TX
RX
𝑏𝑎𝑢𝑑 𝑟𝑎𝑡𝑒 =
𝑓
𝐶𝐾
DIV
Where,
𝑓
𝐶𝐾
refers to the system clock of USART (i.e. PCLK1/PCLK2 )
Note: 1.
Write access to the USART_BAUDR register before UEN. The baud rate register value should
not be altered when UEN=1.
2. When USART receiver or transmitter is disabled, the internal counter will be reset, and baud rate
interrupt will occur.
Table 12-1 Error calculation for programmed baud rate
Baud
fPCLK=36MHz
fPCLK=72MHz
No.
Kbps
Actual
Value programmed in the
baud register
Error%
Actual
Value programmed in the
baud register
Error%
1
2.4
2.4
937.5
0%
2.4
1875
0%
2
9.6
9.6
234.375
0%
9.6
468.75
0%
3
19.2
19.2
117.1875
0%
19.2
234.375
0%
4
57.6
57.6
39.0625
0%
57.6
78.125
0%
5
115.2
115.384
19.5
0.15%
115.2
39.0625
0%
6
230.4
230.769
9.75
0.16%
230.769
19.5
0.16%
7
460.8
461.538
4.875
0.16%
461.538
9.75
0.16%
8
921.6
923.076
2.4375
0.16%
923.076
4.875
0.16%
9
2250
2250
1
0%
2250
2
0%
10
4500
NA
NA
NA
4500
1
0%
11
6250
NA
NA
NA
NA
NA
NA
12
7500
NA
NA
NA
NA
NA
NA
Baud
fPCLK=100MHz
fPCLK=120MHz
No.
Kbps
Actual
Value programmed in the
baud register
Error % Actual
Value programmed in the
baud register
Error %
1
2.4
2.40004
2604.125
0%
2.4
3125
0%
2
9.6
9.60061
651
0%
9.6
781.25
0%
3
19.2
19.2012
325.5
0%
19.2
390.625
0%
4
57.6
57.6037
108.5
0%
57.61
130.1875
0%
5
115.2
115.207
54.25
0%
115.16
65.125
0%
6
230.4
230.415
27.125
0.01%
230.33
32.5625
0%
7
460.8
460.829
13.5625
0.01%
461.54
16.25
0.16%
8
921.6
925.926
6.75
0.47%
923.08
8.125
0.16%
9
2250
2272.73
2.75
1%
2264.15
3.3125
0.63%
10
4500
4545.45
1.375
1%
4444.44
1.6875
1.23%
11
6250
6250
1
0%
6315.79
1.1875
1.05%
12
7500
NA
NA
NA
7500
1
0%