CHAPTER 11 SERIAL INTERFACE UART0 (
µ
PD78F0102H AND 78F0103H ONLY)
Preliminary User’s Manual U16846EJ1V0UD
219
(2) Generation of serial clock
A serial clock can be generated by using baud rate generator control register 0 (BRGC0).
Select the clock to be input to the 5-bit counter by using bits 7 and 6 (TPS01 and TPS00) of BRGC0.
Bits 4 to 0 (MDL04 to MDL00) of BRGC0 can be used to select the division value of the 5-bit counter.
(a) Baud
rate
The baud rate can be calculated by the following expression.
•
Baud rate = [bps]
f
XCLK0
:
Frequency of base clock selected by the TPS01 and TPS00 bits of the BRGC0 register
k:
Value set by the MDL04 to MDL00 bits of the BRGC0 register (k = 8, 9, 10, ..., 31)
(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 = 2.5 MHz = 2,500,000 Hz
Set value of MDL04 to MDL00 bits of BRGC0 register = 10000B (k = 16)
Target baud rate = 76,800 bps
Baud rate = 2.5 M/(2
×
16)
=
2,500,000/(2
×
16) = 78125 [bps]
Error = (78,125/76,800
−
1)
×
100
= 1.725 [%]
f
XCLK0
2
×
k
Actual baud rate (baud rate with error)
Desired baud rate (correct baud rate)