377
16-bit Timer/Event Counter P (TMP)
Chapter 11
Preliminary User’s Manual U17566EE1V2UM00
Figure 11-15
Basic timing in external trigger pulse output mode
16-bit timer/event counter P waits for a trigger when the TPnCE bit is set to 1.
When the trigger is generated, the 16-bit counter is cleared from FFFFH to
0000H, starts counting at the same time, and outputs a PWM waveform from
the TOPn1 pin.
If the trigger is generated again while the counter is operating, the counter is
cleared to 0000H and restarted.
The active level width, cycle, and duty factor of the PWM waveform can be
calculated as follows.
Active level width = (Set value of TPnCCR1 register)
×
Count clock cycle
Cycle = (Set value of TPnCCR0 re 1)
×
Count clock cycle
Duty factor = (Set value of TPnCCR1 register)/(Set value of TPnCCR0 re 1)
The compare match request signal INTTPnCC0 is generated when the 16-bit
counter counts next time after its count value matches the value of the CCR0
buffer register, and the 16-bit counter is cleared to 0000H. The compare match
interrupt request signal INTTPnCC1 is generated when the count value of the
16-bit counter matches the value of the CCR1 buffer register.
The value set to the TPnCCRm register is transferred to the CCRm buffer
register when the count value of the 16-bit counter matches the value of the
CCRm buffer register and the 16-bit counter is cleared to 0000H.
The valid edge of an external trigger input signal, or setting the software trigger
(TPnCTL1.TPnEST bit) to 1 is used as the trigger.
FFFFH
16-
b
it co
u
nter
0000H
TPnCE
b
it
TPnCCR0 regi
s
ter
INTTPnCC0
s
ign
a
l
TPnCCR1 regi
s
ter
INTTPnCC1
s
ign
a
l
TOPn1 pin o
u
tp
u
t
Extern
a
l trigger inp
u
t
(TIPn0 pin inp
u
t)
TOPn0 pin o
u
tp
u
t
(
s
oftw
a
re trigger)
D
1
D
0
D
0
D
1
D
1
D
1
D
1
D
0
D
0
D
0
W
a
it
for
trigger
Active level
width (D
1
)
Cycle (D
0
+ 1)
Cycle (D
0
+ 1)
Cycle (D
0
+ 1)
Active level
width (D
1
)
Active level
width (D
1
)
electronic components distributor