How To Distinguish Input Of No Valid Edge From Input Of Only One Valid Edge With External Event Counter - NEC PD78212 User Manual

8-bit single-chip microcomputer sub-series
Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

Table of Contents