CHAPTER 7 8-BIT TIMER/EVENT COUNTER
165
User’s Manual U11302EJ4V0UM
(3) Square-wave output operation
Square-wave signals can be generated at the user-specified frequency. The frequency or pulse interval
is determined by the value preset in the 8-bit compare registers (CR10 and CR20). To set a count value,
set the value of the higher 8 bits to CR20, and the value of the lower 8 bits to CR10.
The TO2/P32 pin output status is reversed at intervals of the count value preset to CR10 and CR20 by
setting bit 4 (TOE2) of the 8-bit timer output control register (TOC1) to 1. This enables a square wave with
any selected frequency to be output.
Table 7-10. Square-Wave Output Ranges When 2-Channel 8-Bit Timer/Event Counters
(TM1 and TM2) Are Used as 16-Bit Timer/Event Counter
TCL13
TCL12
TCL11
TCL10
Minimum Pulse Width
Maximum Pulse Width
Resolution
0
1
0
1
2 x 1/f
X
(400 ns)
2
17
x 1/f
X
(26.2 ms)
2 x 1/f
X
(400 ns)
0
1
1
0
2
2
x 1/f
X
(800 ns)
2
18
x 1/f
X
(52.4 ms)
2
2
x 1/f
X
(800 ns)
0
1
1
1
2
3
x 1/f
X
(1.6
µ
s)
2
19
x 1/f
X
(104.9 ms)
2
3
x 1/f
X
(1.6
µ
s)
1
0
0
0
2
4
x 1/f
X
(3.2
µ
s)
2
20
x 1/f
X
(209.7 ms)
2
4
x 1/f
X
(3.2
µ
s)
1
0
0
1
2
5
x 1/f
X
(6.4
µ
s)
2
21
x 1/f
X
(419.4 ms)
2
5
x 1/f
X
(6.4
µ
s)
1
0
1
0
2
6
x 1/f
X
(12.8
µ
s)
2
22
x 1/f
X
(838.9 ms)
2
6
x 1/f
X
(12.8
µ
s)
1
0
1
1
2
7
x 1/f
X
(25.6
µ
s)
2
23
x 1/f
X
(1.7 s)
2
7
x 1/f
X
(25.6
µ
s)
1
1
0
0
2
8
x 1/f
X
(51.2
µ
s)
2
24
x 1/f
X
(3.4 s)
2
8
x 1/f
X
(51.2
µ
s)
1
1
0
1
2
9
x 1/f
X
(102.4
µ
s)
2
25
x 1/f
X
(6.7 s)
2
9
x 1/f
X
(102.4
µ
s)
1
1
1
0
2
10
x 1/f
X
(204.8
µ
s)
2
26
x 1/f
X
(13.4 s)
2
10
x 1/f
X
(204.8
µ
s)
1
1
1
1
2
12
x 1/f
X
(819.2
µ
s)
2
28
x 1/f
X
(53.7 s)
2
12
x 1/f
X
(819.2
µ
s)
Remarks 1.
f
X
: Main system clock oscillation frequency
2.
TCL10 to TCL13: Bits 0 to 3 of timer clock select register 1 (TCL1)
3.
Figures in parentheses apply to operation with f
X
= 5.0 MHz.
Figure 7-13. Square-Wave Output Operation Timing
00H
Count clock
Count start
Level reverse
Counter clear
Interval time
TM1
TM2
CR10
CR20
TO2
00H
01H
FFH 00H
01H
N
M
N + 1
N
FFH 00H
02H
FFH 00H
M – 1 M
01H
N 00H
00H
01H
Содержание mPD780208 Subseries
Страница 2: ...2 User s Manual U11302EJ4V0UM MEMO...