CHAPTER 7 TIMER/COUNTER FUNCTION
User’s Manual U13850EJ4V0UM
195
Figure 7-20. Timing of Pulse Width Measurement with Free-Running Counter and
Two Capture Registers (with Rising Edge Specified)
t
(D1
−
D0)
×
t
(10000H
−
D1 + D2)
×
t
(D3
−
D2)
×
t
OVFn
0001H
0000H
D0
D1
Count clock
TMn count
value
TIn0 pin input
INTTMn1
Value loaded
to CRn1
Value loaded
to CRn0
D0 + 1
D1 + 1
0000H
FFFFH
D2 D2 + 1
D3
D0
D1
D2
D3
Remark
n = 0, 1
(4) Pulse width measurement by restarting
When the valid edge of the TIn0 pin is detected, the pulse width of the signal input to the TIn0 pin can be
measured by clearing 16-bit timer register n (TMn) once and then resuming counting after loading the count
value of TMn to 16-bit capture/compare register n1 (CRn1). (See
Figure 7-22
)
The edge is specified by bits 4 and 5 (ESn00 and ESn01) of prescaler mode register n0 (PRMn0). The rising or
falling edge can be specified.
The valid edge is detected through sampling at a count clock cycle selected by prescaler mode register n0, n1
(PRMn0, PRMn1) and the capture operation is not performed until the valid level is detected two times.
Therefore, noise with a short pulse width can be removed.
Caution If the valid edge of the TIn0 pin is specified to be both the rising and falling edges,
capture/compare register n0 (CRn0) cannot perform its capture operation.
Содержание MPD703030A
Страница 2: ...User s Manual U13850EJ4V0UM 2 MEMO ...
Страница 514: ...User s Manual U13850EJ4V0UM 514 MEMO ...