413
16-bit Timer/Event Counter P (TMP)
Chapter 11
Preliminary User’s Manual U17566EE1V2UM00
(b) Pulse width measurement with capture register
When pulse width measurement is performed with the TPnCCRm register
used as a capture register, software processing is necessary for reading
the capture register each time the INTTPnCCm signal has been detected
and for calculating an interval.
When executing pulse width measurement in the free-running timer mode,
two pulse widths can be measured with one channel.
To measure a pulse width, the pulse width can be calculated by reading the
value of the TPnCCRm register in synchronization with the INTTPnCCm
signal, and calculating the difference between the read value and the
previously read value.
FFFFH
16-
b
it co
u
nter
0000H
TPnCE
b
it
TIPn0 pin inp
u
t
TPnCCR0 regi
s
ter
INTTPnCC0
s
ign
a
l
TIPn1 pin inp
u
t
TPnCCR1 regi
s
ter
INTTPnCC1
s
ign
a
l
INTTPnOV
s
ign
a
l
TPnOVF
b
it
0000H
D
00
D
01
D
02
D
0
3
D
04
D
10
D
00
D
11
D
01
D
12
D
04
D
1
3
D
02
D
0
3
D
10
0000H
D
11
D
12
D
1
3
P
u
l
s
e interv
a
l
(D
00
)
P
u
l
s
e interv
a
l
(
D
01
−
D
00
)
P
u
l
s
e interv
a
l
(D
02
−
D
01
)
P
u
l
s
e interv
a
l
(
D
0
3
−
D
02
)
P
u
l
s
e interv
a
l
(
D
04
−
D
0
3
)
P
u
l
s
e interv
a
l
(D
10
)
P
u
l
s
e interv
a
l
(
D
11
−
D
10
)
P
u
l
s
e interv
a
l
(
D
12
−
D
11
)
P
u
l
s
e interv
a
l
(
D
1
3
−
D
12
)
Cle
a
red to 0
b
y
CLR in
s
tr
u
ction
Cle
a
red to 0
b
y
CLR in
s
tr
u
ction
Cle
a
red to 0
b
y
CLR in
s
tr
u
ction
electronic components distributor