412
Chapter 11
16-bit Timer/Event Counter P (TMP)
Preliminary User’s Manual U17566EE1V2UM00
(3)
Operation timing in free-running timer mode
(a) Interval operation with compare register
When 16-bit timer/event counter P is used as an interval timer with the
TPnCCRm register used as a compare register, software processing is
necessary for setting a comparison value to generate the next interrupt
request signal each time the INTTPnCCm signal has been detected.
When performing an interval operation in the free-running timer mode, two
intervals can be set with one channel.
To perform the interval operation, the value of the corresponding
TPnCCRm register must be re-set in the interrupt servicing that is
executed when the INTTPnCCm signal is detected.
The set value for re-setting the TPnCCRm register can be calculated by
the following expression, where “D
m
” is the interval period.
Compare register default value: D
m
–
1
Value set to compare register second and subsequent time:
Previous set value + D
m
(If the calculation result is greater than FFFFH, subtract 10000H from the
result and set this value to the register.)
FFFFH
16-
b
it co
u
nter
0000H
TPnCE
b
it
TPnCCR0 regi
s
ter
INTTPnCC0
s
ign
a
l
TOPn pin o
u
tp
u
t
TPnCCR1 regi
s
ter
INTTPnCC1
s
ign
a
l
TOPn1 pin o
u
tp
u
t
D
00
D
01
D
02
D
0
3
D
04
D
05
D
10
D
00
D
11
D
01
D
12
D
04
D
1
3
D
02
D
0
3
D
11
D
10
D
12
D
1
3
D
14
Interv
a
l period
(D
10
+ 1)
Interv
a
l period
(
D
11
−
D
10
)
Interv
a
l period
(
D
12
−
D
11
)
Interv
a
l period
(
D
1
3
−
D
12
)
Interv
a
l period
(D
00
+ 1)
Interv
a
l period
(
D
01
−
D
00
)
Interv
a
l period
(D
02
−
D
01
)
Interv
a
l period
(
D
0
3
−
D
02
)
Interv
a
l period
(
D
04
−
D
0
3
)
electronic components distributor