CHAPTER 6 16-BIT TIMER/EVENT COUNTER
142
User’s Manual U11302EJ4V0UM
6.5.5 Square-wave output operation
The 16-bit timer/event counter outputs a square-wave of any frequency with the value preset to the 16-bit compare
register (CR00) as the interval.
The TO0/P30 pin output status is reversed at intervals of the count value preset to CR00 by setting bit 0 (TOE0)
and bit 1 (TOC01) of the 16-bit timer output control register (TOC0) to 1. This enables a square wave with any selected
frequency to be output.
Table 6-6. 16-Bit Timer/Event Counter Square-Wave Output Ranges
TCL06 TCL05 TCL04
Minimum Pulse Width
Maximum Pulse Width
Resolution
0
0
0
2 x TI0 input cycle
2
16
x TI0 input cycle
TI0 input edge cycle
0
0
1
2 x 1/f
X
(400 ns)
2
16
x 1/f
X
(13.1 ms)
1/f
X
(200 ns)
0
1
0
2
2
x 1/f
X
(800 ns)
2
17
x 1/f
X
(26.2 ms)
2 x 1/f
X
(400 ns)
0
1
1
2
3
x 1/f
X
(1.6
µ
s)
2
18
x 1/f
X
(52.4 ms)
2
2
x 1/f
X
(800 ns)
1
0
0
2
4
x 1/f
X
(3.2
µ
s)
2
19
x 1/f
X
(104.9 ms)
2
3
x 1/f
X
(1.6
µ
s)
Remarks 1.
f
X
: Main system clock oscillation frequency
2.
TCL04 to TCL06: Bits 4 to 6 of timer clock select register 0 (TCL0)
3.
Figures in parentheses apply to operation with f
X
= 5.0 MHz.
Figure 6-19. Square-Wave Output Operation Timing
Note
Initial value of TO0 output can be set by bits 2 and 3 (LVR0 and LVS0) of the 16-bit timer output control
register (TOC0).
0000
TM0 count value
Count clock
0001
N _ 1
N
N _ 1
N
0000
TO0
Note
0002
0000 0001
0002
CR00
Count start
N
N