|
UPD784938 Datasheet, PDF (270/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers | |||
|
◁ |
CHAPTER 9 TIMER/EVENT COUNTER 0
Figure 9-54. To Distinguish whether One or No Valid Edge has been Input with External Event Counter
(a) Processing on starting counting
Start count
Clear INTP3
interrupt request flag
PIF3 â 0
; Clear PIF3 to 0
Start count
CE3 â 1
; Set CE3 to 1
End
(b) Processing on reading count value
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, valid edge is input.
End
Number of input valid edges is set to AX register
270
Preliminary Userâs Manual U13987EJ1V0UM00
|
▷ |