536
Chapter 16
Asynchronous Serial Interface (UARTA)
Preliminary User’s Manual U17566EE1V2UM00
16.6.3
Baud rate calculation
The baud rate is obtained by the following equation.
f
UCLK
= Frequency of base clock selected by the UAnCTL1.UAnCKS[2:0]
k =
Value set using the UAnCTL2.UAnBRS[7:0] bits
(k = 4, 5, 6, …, 255)
16.6.4
Baud rate error
The baud rate error is obtained by the following equation.
Caution
1.
The baud rate error during transmission must be within the error tolerance
on the receiving side.
2.
The baud rate error during reception must satisfy the range indicated in (7)
Allowable baud rate range during reception.
Example
Base clock frequency = 8MHz
Setting value of
- UAnDTL1.UAnCKS[2:0] = 001B (PCLK2 = 4MHz)
- UAnCTL2.UAnBRS[7:0] = 0000 1101B (k = 13)
Target baud rate = 153,600 bps
Baud rate = 4MHz/ (2
×
13) = 153,846 [bps]
Error
= (153,846/153,600
–
1)
×
100
= 0.160 [%]
Baud rate
f
UCLK
2
k
×
--------------- [bps]
=
Error (%)
Actual baud rate (baud rate with error)
Target baud rate (correct baud rate)
----------------------------------------------------------------------------
1
–
(
)
100 [%]
×
=
electronic components distributor