![](http://datasheet.mmic.net.cn/120000/R5F21388SDFP_datasheet_3573603/R5F21388SDFP_456.png)
R8C/38T-A Group
20. Serial Interface (UART2)
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0241EJ0010 Rev.0.10
Page 425 of 730
Aug 05, 2011
20.3.2.1
Bit Rate
In UART mode, the bit rate is the frequency divided by the U2BRG register divided by 16.
Figure 20.9 shows
Figure 20.9
Formula for Calculating U2BRG Register Setting Value
20.3.2.2
Measure for Dealing with Communication Errors
If communication is aborted or a communication error occurs while transmitting or receiving in UART mode,
follow the procedures below:
(1) Set the TE bit in the U2C1 register to 0 (transmission disabled) and the RE bit to 0 (reception disabled).
(2) Set bits SMD2 to SMD0 in the U2MR register to 000b (serial interface disabled).
(3) Set bits SMD2 to SMD0 in the U2MR register to 100b (UART mode, transfer data 7 bits long), 101b
(UART mode, transfer data 8 bits long), or 110b (UART mode, transfer data 9 bits long).
(4) Set the TE bit in the U2C1 register to 1 (transmission enabled) and the RE bit to 1 (reception enabled).
Table 20.8
Bit Rate Setting Examples in UART Mode (Internal Clock Selected)
Bit Rate
(bps)
U2BRG
Count
Source
System Clock = 20 MHz
System Clock = 18.432 MHz
System Clock = 8 MHz
U2BRG
Set Value
Actual
Time
(bps)
Setting
Error
(%)
U2BRG
Set Value
Actual
Time
(bps)
Setting
Error
(%)
U2BRG
Set Value
Actual
Time
(bps)
Setting
Error
(%)
1200
f8
129 (81h)
1201.92
0.16
119 (77h)
1200.00
0.00
51 (33h)
1201.92
0.16
2400
f8
64 (40h)
2403.85
0.16
59 (3Bh)
2400.00
0.00
25 (19h)
2403.85
0.16
4800
f8
32 (20h)
4734.85
-1.36
29 (1Dh)
4800.00
0.00
12 (0Ch)
4807.69
0.16
9600
f1
129 (81h)
9615.38
0.16
119 (77h)
9600.00
0.00
51 (33h)
9615.38
0.16
14400
f1
86 (56h)
14367.82
-0.22
79 (4Fh)
14400.00
0.00
34 (22h)
14285.71
-0.79
19200
f1
64 (40h)
19230.77
0.16
59 (3Bh)
19200.00
0.00
25 (19h)
19230.77
0.16
28800
f1
42 (2Ah)
29069.77
0.94
39 (27h)
28800.00
0.00
16 (10h)
29411.76
2.12
38400
f1
32 (20h)
37878.79
-1.36
29 (1Dh)
38400.00
0.00
12 (0Ch)
38461.54
0.16
57600
f1
21 (15h)
56818.18
-1.36
19 (13h)
57600.00
0.00
8 (08h)
55555.56
-3.55
115200
f1
10 (0Ah)
113636.36
-1.36
9 (09h)
115200.00
0.00
—
When an internal clock is selected
Value set in U2BRG register =
fj
Bit Rate ×16
- 1
fj: Count source frequency of U2BRG register (f1, f8, f32, or fC1)
When an external clock is selected
Value set in U2BRG register =
fEXT
Bit Rate ×16
- 1
fEXT: Count source frequency of U2BRG register (external clock)