214
CHAPTER 9 8-BIT TIMER/EVENT COUNTER
(3) Operation as square wave output
The 8-bit timer/event counters operate as square wave output of any frequency at time intervals specified by
the values set to the corresponding 8-bit compare registers (CR10 and CR20) in advance.
When bit 0 or 4 (TOE1 or TOE2) of the 8-bit timer output control register (TOC1) is set to 1, the output status
of the TO1/P31 or TO2/P32 pin is inverted at time intervals specified by the values set to CR10 or CR20 in
advance. In this way, square waves of any frequency can be output.
Table 9-8. Square Wave Output Range of 8-Bit Timer/Event Counters
TCL13
TCL12
TCL11
TCL10
Minimum Pulse Width
Maximum Pulse Width
Resolution
0
1
1
0
2
2
×
1/f
X
(400 ns)
2
10
×
1/f
X
(102.4
μ
s)
2
2
×
1/f
X
(400 ns)
0
1
1
1
2
3
×
1/f
X
(800 ns)
2
11
×
1/f
X
(204.8
μ
s)
2
3
×
1/f
X
(800 ns)
1
0
0
0
2
4
×
1/f
X
(1.6
μ
s)
2
12
×
1/f
X
(409.6
μ
s)
2
4
×
1/f
X
(1.6
μ
s)
1
0
0
1
2
5
×
1/f
X
(3.2
μ
s)
2
13
×
1/f
X
(819.2
μ
s)
2
5
×
1/f
X
(3.2
μ
s)
1
0
1
0
2
6
×
1/f
X
(6.4
μ
s)
2
14
×
1/f
X
(1.64 ms)
2
6
×
1/f
X
(6.4
μ
s)
1
0
1
1
2
7
×
1/f
X
(12.8
μ
s)
2
15
×
1/f
X
(3.28 ms)
2
7
×
1/f
X
(12.8
μ
s)
1
1
0
0
2
8
×
1/f
X
(25.6
μ
s)
2
16
×
1/f
X
(6.55 ms)
2
8
×
1/f
X
(25.6
μ
s)
1
1
0
1
2
9
×
1/f
X
(51.2
μ
s)
2
17
×
1/f
X
(13.1 ms)
2
9
×
1/f
X
(51.2
μ
s)
1
1
1
0
2
10
×
1/f
X
(102.4
μ
s)
2
18
×
1/f
X
(26.2 ms)
2
10
×
1/f
X
(102.4
μ
s)
1
1
1
1
2
12
×
1/f
X
(409.6
μ
s)
2
20
×
1/f
X
(104.9 ms)
2
12
×
1/f
X
(409.6
μ
s)
Remarks
1.
f
X
2.
TCL10-TCL13: Bits 0 through 3 of timer clock select register 1 (TCL1)
3.
( )
: At f
X
= 10.0 MHz operation
: Main system clock oscillation frequency
Figure 9-10. Square Wave Output Timing
Note
The initial value of TO1 output can be set by bits 2 and 3 (LVS1, LVR1) of the 8-bit timer output control
register (TOC1).
Count starts
Count clock
TM1 count value
CR10
TO1
Note
00
01
02
N–1
N
00
01
02
N–1
N
00
N
N