CHAPTER 7 TIMER/COUNTER FUNCTION
User’s Manual U13850EJ4V0UM
221
7.4.2 Operation as external event counter
The external event counter counts the number of external clock pulses that are input to TIn.
Each time a valid edge specified with timer clock selection register n0, n1 (TCLn0, TCLn1) is input, TMn is
incremented. The edge setting can be selected to be either a rising or falling edge.
If the total of TMn and the value of 8-bit compare register n (CRn0) match, TMn is cleared to 0 and the interrupt
request signal (INTTMn) is generated.
INTTMn is generated each time the TMn value matches the CRn0 value.
Remark
n = 2 to 5
Figure 7-42. Timing of External Event Counter Operation (When Rising Edge Is Set)
TIn
TMn count value
0005
0004
0003
0002
0001
0000
N
−
1
N
CRn0
INTTMn
N
0000
0001
0002
0003
Remark
n = 2 to 5