
CHAPTER 7 8-BIT TIMER/EVENT COUNTER
142
(3) Square-wave output operation
The 8-bit timer/event counter operates as square wave output at intervals of the value preset to 8-bit compare
registers (CR10 and CR20).
The TO1/P31 or TO2/P32 pin output status is reversed at intervals of the count value preset to CR10 or CR20
by setting bit 0 (TOE1) or 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-8. 8-Bit Timer/Event Counter Square-Wave Output Ranges
TCL13
TCL12
TCL11
TCL10
Minimum Pulse Time
Maximum Pulse Time
Resolution
0
1
0
1
2
×
1/f
X
(400 ns)
2
9
×
1/f
X
(102.4
μ
s)
2
×
1/f
X
(400 ns)
0
1
1
0
2
2
×
1/f
X
(800 ns)
2
10
×
1/f
X
(204.8
μ
s)
2
2
×
1/f
X
(800 ns)
0
1
1
1
2
3
×
1/f
X
(1.6
μ
s)
2
11
×
1/f
X
(409.6
μ
s)
2
3
×
1/f
X
(1.6
μ
s)
1
0
0
0
2
4
×
1/f
X
(3.2
μ
s)
2
12
×
1/f
X
(819.2
μ
s)
2
4
×
1/f
X
(3.2
μ
s)
1
0
0
1
2
5
×
1/f
X
(6.4
μ
s)
2
13
×
1/f
X
(1.64 ms)
2
5
×
1/f
X
(6.4
μ
s)
1
0
1
0
2
6
×
1/f
X
(12.8
μ
s)
2
14
×
1/f
X
(3.28 ms)
2
6
×
1/f
X
(12.8
μ
s)
1
0
1
1
2
7
×
1/f
X
(25.6
μ
s)
2
15
×
1/f
X
(6.55 ms)
2
7
×
1/f
X
(25.6
μ
s)
1
1
0
0
2
8
×
1/f
X
(51.2
μ
s)
2
16
×
1/f
X
(13.1 ms)
2
8
×
1/f
X
(51.2
μ
s)
1
1
0
1
2
9
×
1/f
X
(102.4
μ
s)
2
17
×
1/f
X
(26.2 ms)
2
9
×
1/f
X
(102.4
μ
s)
1
1
1
0
2
10
×
1/f
X
(204.8
μ
s)
2
18
×
1/f
X
(52.4 ms)
2
10
×
1/f
X
(204.8
μ
s)
1
1
1
1
2
12
×
1/f
X
(819.2
μ
s)
2
20
×
1/f
X
(209.7 ms)
2
12
×
1/f
X
(819.2
μ
s)
Remarks 1.
f
X
: Main system clock frequency
2.
TCL10 to TCL13: Bits 0 to 3 of the timer clock select register 1 (TCL1)
3.
Values in parentheses when operated at f
X
= 5.0 MHz.
Figure 7-10. Square-Wave Output Operation Timings
00
TM1 count value
Count clock
01
N – 1
N
N – 1
N
00
TO1
Note
02
00
01
02
CR10
Count start
N
N
Note
Initial value of TO1 output can be set with bits 2 and 3 (LVR1 and LVS1) of the 8-bit timer output control
register (TOC1)