English
Language : 

UPD784938 Datasheet, PDF (232/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 9 TIMER/EVENT COUNTER 0
Figure 9-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 INTP3 interrupt
request flag
PIF3 ← 0
; Clear PIF3 to 0
Start count
CE0 ← 1
; Set CE0 to 1
End
(b) Processing when count value is read
Count value read
Read TM0 contents
AX ← TM0
AX = 0?
NO
YES
YES
AX ← AX+1
PIF3 = 1?
NO
; Check TM0 value
If 0, check interrupt
request flag
; Check PIF3 contents
If 1, there is a valid
edge
End
; Number of input valid edges is set in AX register
232
Preliminary User’s Manual U13987EJ1V0UM00