CHAPTER 6 16-BIT TIMER/EVENT COUNTER
140
User’s Manual U11302EJ4V0UM
(2) Pulse width measurement by means of restart
When input of a valid edge to the TI0/P00 pin is detected, the count value of the 16-bit timer register (TM0) is
taken into the 16-bit capture register (CR01), and then the pulse width of the signal input to the TI0/P00 pin is
measured by clearing TM0 and restarting the count.
The edge specification can be selected from three types—rising, falling, and both edges—by using bits 2 and
3 (ES10 and ES11) of the external interrupt mode register (INTM0).
For valid edge detection, sampling is performed at the interval selected by the sampling clock select register
(SCS), and a capture operation is only performed when a valid level is detected twice, thus eliminating noise with
a short pulse width.
Figure 6-16. Timing of Pulse Width Measurement Operation by Means of Restart
(with Both Edges Specified)
6.5.4 External event counter operation
The external event counter counts the number of external clock pulses input to the TI0/P00 pin using the 16-bit
timer register (TM0).
TM0 is incremented each time the valid edge specified by the external interrupt mode register (INTM0) is input.
When the TM0 count value matches the 16-bit compare register (CR00) value, TM0 is cleared to 0 and the interrupt
request signal (INTTM0) is generated.
Set CR00 to a value other than 0000H (a 1-pulse count operation cannot be performed).
The rising edge, falling edge or both edges can be selected using bits 2 and 3 (ES10 and ES11) of INTM0.
For valid edge detection, sampling is performed at the interval selected by the sampling clock select register (SCS),
and a counter operation is only performed when a valid level is detected twice, thus eliminating noise with a short
pulse width.
t
0000
TM0 count value
Count clock
CR01 captured value
INTP0
0001
D0
0000
0001
D1
0000
0001
D0
(D0 + 1) x t
(D1 + 1) x t
TI0 pin input
D1
Содержание mPD780204
Страница 2: ...2 User s Manual U11302EJ4V0UM MEMO ...