
132
CHAPTER 7 16-BIT TIMER/EVENT COUNTER
User
’
s Manual U15017EJ2V0UD
Figure 7-18. Timing of Pulse Width Measurement by Restarting (with Rising Edge Specified)
Caution In Figure 7-18, for simplification purposes, consideration of the delay caused by noise elimination
has been omitted from the timing of the capture operation based on the inputs to pin TI00 and
of interrupt request occurrence. For accurate information, refer to Figure 7-13 (which shows the
CR01 capture operation with a rising edge specified).
7.4.3 Operation as external event counter
16-bit time/event counter can be used as an external event counter which counts the number of clock pulses input
to the TI00/P20 pin from an external source by using 16-bit timer counter 0 (TM0).
Each time the valid edge specified by prescaler mode register 0 (PRM0) has been input to the TI00/P20 pin, TM0
is incremented.
When the count value of TM0 matches the value of 16-bit capture/compare register 00 (CR00), TM0 is cleared
to 0, and an interrupt request signal (INTTM00) is generated.
Set CR00 to the value other than 0000H. (A 1-pulse counter can not be operated.)
To perform counting with clock pulses input to pin TI00/P20, specify the valid edge for TI00 using bits 0 and 1
(PRM00 and PRM01) of PRM0.
The edge of the TI00/20 pin is specified by bits 4 and 5 (ES00 and ES01) of PRM0. The rising, falling, or both
the rising and falling edges can be specified.
For the capture operation is not performed until the valid level of pin TI00 is detected two times by sampling with
the count clock selected by PRM0. Therefore, noise with a small pulse width can be eliminated.
t
D1
×
t
D2
×
t
Count clock
0000
0001
D0
D1
0000
0001
D2
0001
TM0 count value
D0
D2
TI00 pin input
Value loaded to
CR01
Value loaded to
CR00
D1
INTTM01
0000