416
Chapter 11
16-bit Timer/Event Counter P (TMP)
Preliminary User’s Manual U17566EE1V2UM00
Figure 11-34
Example when two capture registers are used (without using overflow
interrupt)
Note
The TPnOVF0 and TPnOVF1 flags are set on the internal RAM by software.
<1> Read the TPnCCR0 register (setting of the default value of the TIPn0
pin input).
<2> Read the TPnCCR1 register (setting of the default value of the TIPn1
pin input).
<3> An overflow occurs. Nothing is done by software.
<4> Read the TPnCCR0 register.
Read the overflow flag. If the overflow flag is 1, set only the TPnOVF1
flag to 1, and clear the overflow flag to 0.
Because the overflow flag is 1, the pulse width can be calculated by
( D
01
-
D
00
).
<5> Read the TPnCCR1 register.
Read the overflow flag. Because the overflow flag is cleared in <4>, 0
is read.
Read the TPnOVF1 flag. If the TPnOVF1 flag is 1, clear it to 0.
Because the TPnOVF1 flag is 1, the pulse width can be calculated by
( D
11
-
D
10
) (correct).
<6> Same as <3>
FFFFH
16-
b
it co
u
nter
0000H
TPnCE
b
it
INTTPnOV
s
ign
a
l
TPnOVF
b
it
TPnOVF0 fl
a
g
Note
TIPn0 pin inp
u
t
TPnCCR0 regi
s
ter
TPnOVF1 fl
a
g
Note
TIPn1 pin inp
u
t
TPnCCR1 regi
s
ter
D
10
D
11
D
00
D
01
D
10
<1>
<2>
<5> <6>
<
3
>
<4>
D
00
D
11
D
01
electronic components distributor