How To Use The Baud Rate Timer - Panasonic MN101C00 User Manual

Panaxseries mn101c00 series 8-bit single-chip microcomputers
Table of Contents

Advertisement

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)
compare register set value = timer clock frequency/(baud rate 2 8) – 1
Table 5-3-1 UART Transfer Rate
Transfer Speed
300
(bps)
fosc
Set
(MHz)
Value
fosc
4.0
fs/4
104
fs/16
fosc
4.19
fs/4
109
fs/16
fosc
8.0
fs/4
208
fs/16
fosc
8.38
fs/4
218
fs/16
fosc
12.0
fs/4
fs/16
78
fosc
16.0
fs/4
fs/16
104
fosc
16.76
fs/4
fs/16
109
fosc
20.0
fs/4
fs/16
130
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 10
SC0MD1(SC0CKM)
1200
2400
Calculated
Set
Calculated
Set
Calculated
Value
Value
Value
Value
Value
208
1202
104
2403
300
218
1201
109
2402
300
208
2404
300
52
1201
218
2403
300
55
1190
78
1202
39
2403
300
104
1202
52
2404
300
109
1201
55
2381
300
130
1202
65
2404
300
6
/2/4)/(300 2 8) – 1
=207
= X'CF'
4800
9600
Set
Calculated
Set
Calculated
Value
Value
Value
Value
52
4807
26
9615
55
4761
27
9699
104
4807
52
9615
109
4805
55
9523
156
4808
78
9615
208
4808
104
9615
218
4805
109
9610
130
9615
33
4735
Chapter 5 Serial Functions
Set the values from this table
19200
(minus 1) in the compare
Set
Calculated
register.
Value
Value
13
19230
26
19230
27
19398
39
19230
52
19230
55
19045
65
19231
Half-duplex UART Serial Interface
105

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn101c115Mn101c117Mn101cp117

Table of Contents