221
Chapter 7 Timer/Counter Units
7
Fig. 7-140 How to Distinguish Input of No Valid Edge from Input of Only One Valid Edgewith External Event Counter(a) Count start processing(b) Count value read processing
Count starts
Clear INTP2 interrupt
request flag ; Clears PIF2 (0)
Start counting ; Sets CE2 (1)
End
TMC1.71
IF0L.20
Reads count value
Read contents of TM2
; Check TM2 value.
If 0, check interrupt
request flag.
; Check contents of PIF2.
If 1, valid edge has
been input.
End ; The number of valid edges input to register A is set.
IF0L.2 = 1?
Yes
Yes
No
AA + 1
ATM2
A = 0?
No