English
Language : 

MN101C115 Datasheet, PDF (119/170 Pages) Panasonic Semiconductor – Request for your special attention and precautions in using the technical information and semiconductors described in this book
Chapter 5 Serial Functions
5-3-3 How to Use the Baud Rate Timer
Refer to the following when using the baud rate timer to set the UART transfer
speed.
(1) Specifying the timer clock source
The clock source is specified by the TM3CKS3 to 1 flags of the timer 3
mode register (TM3MD).
(2) Setting the compare register
The compare register value is set in the timer 3 compare register (TM3OC).
This set value is computed according to the following formula:
overflow period = (compare register set value + 1) × timer clock period
baud rate = 1/(overflow period × 2 × 8)
↑ SC0MD1(SC0CKM)
compare register set value = timer clock frequency/(baud rate × 2 × 8) – 1
Table 5-3-1 UART Transfer Rate
Transfer Speed
fosc (bps)
(MHz)
fosc
4.0
fs/4
fs/16
fosc
4.19 fs/4
fs/16
fosc
8.0
fs/4
fs/16
fosc
8.38 fs/4
fs/16
fosc
12.0
fs/4
fs/16
fosc
16.0
fs/4
fs/16
fosc
16.76 fs/4
fs/16
fosc
20.0
fs/4
fs/16
300
1200
2400
4800
9600
Set Calculated Set Calculated Set Calculated Set Calculated Set Calculated
Value Value Value Value Value Value Value Value Value Value
— — 208 1202 104 2403 52 4807 26 9615
104 300 — — — — — — — —
——————————
— — 218 1201 109 2402 55 4761 27 9699
109 300 — — — — — — — —
——————————
— — — — 208 2404 104 4807 52 9615
208 300 52 1201 — — — — — —
——————————
— — — — 218 2403 109 4805 55 9523
218 300 55 1190 — — — — — —
——————————
— — — — — — 156 4808 78 9615
— — 78 1202 39 2403 — — — —
78 300 — — — — — — — —
— — — — — — 208 4808 104 9615
— — 104 1202 52 2404 — — — —
104 300 — — — — — — — —
— — — — — — 218 4805 109 9610
— — 109 1201 55 2381 — — — —
109 300 — — — — — — — —
— — — — — — — — 130 9615
— — 130 1202 65 2404 33 4735 — —
130 300 — — — — — — — —
19200
Set Calculated
Value Value
13 19230
——
——
——
——
——
26 19230
——
——
27 19398
——
——
39 19230
——
——
52 19230
——
——
55 19045
——
——
65 19231
——
——
Set the values from this table
(minus 1) in the compare
register.
Example:
The timer 3 clock source is fs/4 (fosc = 8MHz) and a baud rate of 300 bps is
desired.
Since fs=fosc/2,
compare register set value = (8 × 106/2/4)/(300 × 2 × 8) – 1
=207
= X'CF'
Half-duplex UART Serial Interface 105