CHAPTER 11 SERIAL INTERFACE UART6
User’s Manual U16898EJ3V0UD
209
(2) Generation of serial clock
A serial clock can be generated by using clock selection register 6 (CKSR6) and baud rate generator control
register 6 (BRGC6).
Select the clock to be input to the 8-bit counter by using bits 3 to 0 (TPS63 to TPS60) of CKSR6.
Bits 7 to 0 (MDL67 to MDL60) of BRGC6 can be used to select the division value of the 8-bit counter.
(a) Baud rate
The baud rate can be calculated by the following expression.
•
Baud rate = [bps]
f
XCLK6
: Frequency of base clock selected by TPS63 to TPS60 bits of CKSR6 register
k:
Value set by MDL67 to MDL60 bits of BRGC6 register (k = 8, 9, 10, ..., 255)
(b) Error of baud rate
The baud rate error can be calculated by the following expression.
•
Error (%) =
−
1
×
100 [%]
Cautions 1. Keep the baud rate error during transmission to within the permissible error range at
the reception destination.
2. Make sure that the baud rate error during reception satisfies the range shown in (4)
Permissible baud rate range during reception.
Example:
Frequency of base clock = 10 MHz = 10,000,000 Hz
Set value of MDL67 to MDL60 bits of BRGC6 register = 00100001B (k = 33)
Target baud rate = 153600 bps
Baud rate = 10 M/(2
×
33)
=
10000000/(2
×
33) = 151,515 [bps]
Error = (151515/153600
−
1)
×
100
=
−
1.357 [%]
Actual baud rate (baud rate with error)
Desired baud rate (correct baud rate)
f
XCLK6
2
×
k