404
Chapter 11
16-bit Timer/Event Counter P (TMP)
Preliminary User’s Manual U17566EE1V2UM00
When the TPnCE bit is set to 1, 16-bit timer/event counter P starts counting,
and the output signals of the TOPn0 and TOPn1 pins are inverted. When the
count value of the 16-bit counter later matches the set value of the TPnCCRm
register, a compare match interrupt request signal (INTTPnCCm) is generated,
and the output signal of the TOPnm pin is inverted.
The 16-bit counter continues counting in synchronization with the count clock.
When it counts up to FFFFH, it generates an overflow interrupt request signal
(INTTPnOV) at the next clock, is cleared to 0000H, and continues counting. At
this time, the overflow flag (TPnOPT0.TPnOVF bit) is also set to 1. Clear the
overflow flag to 0 by executing the CLR instruction by software.
The TPnCCRm register can be rewritten while the counter is operating. If it is
rewritten, the new value is reflected at that time, and compared with the count
value.
Figure 11-26
Basic timing in free-running timer mode (compare function)
FFFFH
16-
b
it co
u
nter
0000H
TPnCE
b
it
TPnCCR0 regi
s
ter
INTTPnCC0
s
ign
a
l
TOPn0 pin o
u
tp
u
t
TPnCCR1 regi
s
ter
INTTPnCC1
s
ign
a
l
TOPn1 pin o
u
tp
u
t
INTTPnOV
s
ign
a
l
TPnOVF
b
it
D
00
D
01
D
10
D
11
D
00
D
10
D
10
D
11
D
11
D
11
D
00
D
01
D
01
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
Cle
a
red to 0
b
y
CLR in
s
tr
u
ction
electronic components distributor