175
CHAPTER 8 16-BIT TIMER/EVENT COUNTER
8.2 Functions of 16-Bit Timer/Event Counter
The 16-bit timer/event counter (TM0) has the following functions:
Interval timer
PWM output
Pulse width measurement
External event counter
Square wave output
The PWM output and pulse width measurement functions can be used at the same time.
(1) Interval timer
When the 16-bit timer/event counter is used as an interval timer, it generates an interrupt request at any time
intervals set in advance.
Table 8-2. Interval Time of 16-Bit Timer/Event Counter
Minimum Interval Time
Maximum Interval Time
Resolution
2
×
TI0 input cycle
2
16
×
TI0 input cycle
TI0 input edge cycle
2
2
×
1/f
X
(400 ns)
2
17
×
1/f
X
(13.1 ms)
2
×
1/f
X
(200 ns)
2
3
×
1/f
X
(800 ns)
2
18
×
1/f
X
(26.2 ms)
2
2
×
1/f
X
(400 ns)
2
4
×
1/f
X
(1.6
μ
s)
2
19
×
1/f
X
(52.4 ms)
2
3
×
1/f
X
(800 ns)
Remarks 1.
f
X
: main system clock oscillation frequency
2.
( ): f
X
= 10.0 MHz operation
(2) PWM output
The 16-bit timer/event counter can be used for PWM output with a resolution of 14 bits.
(3) Pulse width measurement
The 16-bit timer/event counter can be used to measure the pulse width of an externally input signal.
(4) External event counter
The number of pulses of an externally input signal can be measured.
(5) Square wave output
A square wave of any frequency can be output.
Table 8-3. Square Wave Output Range of 16-Bit Timer/Event Counter
Minimum Interval Time
Maximum Interval Time
Resolution
2
×
TI0 input cycle
2
16
×
TI0 input cycle
TI0 input edge cycle
2
2
×
1/f
X
(400 ns)
2
17
×
1/f
X
(13.1 ms)
2
×
1/f
X
(200 ns)
2
3
×
1/f
X
(800 ns)
2
18
×
1/f
X
(26.2 ms)
2
2
×
1/f
X
(400 ns)
2
4
×
1/f
X
(1.6
μ
s)
2
19
×
1/f
X
(52.4 ms)
2
3
×
1/f
X
(800 ns)
Remarks 1.
f
X
: main system clock oscillation frequency
2.
( ): f
X
= 10.0 MHz operation