beautypg.com

Chapter 7 timer/counter units – NEC PD78214 User Manual

Page 250

background image

221

Chapter 7 Timer/Counter Units

7

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

(b) Count value read processing

Count starts

Clear INTP2 interrupt
request flag

; Clears PIF2 (0)

Start counting

; Sets CE2 (1)

End

TMC1.7

←1

IF0L.2

←0

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

A

←A + 1

A

←TM2

A = 0?

No

This manual is related to the following products: