146
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 0
User’s Manual U15798EJ2V0UD
Figure 6-20. 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/P35 pin is detected, the count value of 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/P35 pin is measured by clearing TM0 and restarting the count (see register settings in
Figure 6-21
).
The edge specification can be selected from two types—rising and falling edges—by bits 4 and 5 (ES00 and ES01)
of prescaler mode register 0 (PRM0).
In a valid edge detection, the sampling is performed by a cycle selected by 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 the TI00/P35 pin is specified to be both the rising and falling edges, 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
Содержание mPD780344 Series
Страница 2: ...2 User s Manual U15798EJ2V0UD MEMO...