|
UPD784938 Datasheet, PDF (287/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers | |||
|
◁ |
CHAPTER 10 TIMER/EVENT COUNTER 1
Figure 10-12. To distinguish whether One or No Valid Edge has been Input with External Event Counter
(a) Processing when count is started
Start count
Clear INTP0 interrupt
request flag
PIF0 â 0
; Clear PIF0 to 0
Start count
CE1 â 1
; Set CE1 to 1
End
(b) Processing when count value is read
Count value read
Read TM1 contents
A â TM1
A = 0?
NO
A â A+1
YES
YES
PIF0 = 1?
NO
; Check TM1 value
If 0, check interrupt
request flag
; Check PIF0 contents
If 1, there is a valid edge
End
; Number of input valid edges is set in A register
Preliminary Userâs Manual U13987EJ1V0UM00
287
|
▷ |