122
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 0
Preliminary User’s Manual U16035EJ1V0UM
Figure 6-18. Timing of Pulse Width Measurement Operation by Free-Running Counter
and Two Capture Registers (with Rising Edge Specified)
(4) Pulse width measurement by means of restart
When input of a valid edge to the TI00/TO0/P70 pin is detected, the count value of the 16-bit timer counter 0
(TM0) is taken into 16-bit timer capture/compare register 01 (CR01), and then the pulse width of the signal input
to the TI00/TO0/P70 pin is measured by clearing TM0 and restarting the count (see register settings in
Figure
6-19
).
The edge specification can be selected from two types, rising and falling edges by bits 4 and 5 (ES00 and ES01)
of the prescaler mode register 0 (PRM0).
In a valid edge detection, the sampling is performed by a cycle selected by the prescaler mode register 0 (PRM0)
and a capture operation is only performed when a valid level is detected twice, thus eliminating noise with a short
pulse width.
Caution
If the valid edge of TI00/TO0/P70 pin is specified to be both rising and falling edges, the 16-
bit timer capture/compare register 00 (CR00) cannot perform the capture operation.
t
0000H
0000H
FFFFH
0001H
D0
D0
INTTM01
OVF0
D2
D1
D3
D2
D3
D0 + 1
D2 + 1
D1
D1 + 1
CR00 capture value
Count clock
TM0 count value
TI00 pin input
CR01 capture value
(D1 – D0)
×
t
(D3 – D2)
×
t
(10000H – D1 + D2)
×
t