395
16-bit Timer/Event Counter P (TMP)
Chapter 11
Preliminary User’s Manual U17566EE1V2UM00
Figure 11-22
Basic timing in PWM output mode
When the TPnCE bit is set to 1, the 16-bit counter is cleared from FFFFH to
0000H, starts counting, and outputs a PWM waveform from the TOPn1 pin.
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 PWM waveform can be changed by rewriting the TPnCCRm register while
the counter is operating. The newly written value is reflected when the count
value of the 16-bit counter matches the value of the CCR0 buffer register and
the 16-bit counter is cleared to 0000H.
The compare match interrupt 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.
FFFFH
16-
b
it co
u
nter
0000H
TPnCE
b
it
TPnCCR0 regi
s
ter
CCR0
bu
ffer regi
s
ter
NTTPnCC0
s
ign
a
l
TOPn0 pin o
u
tp
u
t
TPnCCR1 regi
s
ter
CCR1
bu
ffer regi
s
ter
INTTPnCC1
s
ign
a
l
TOPn1 pin o
u
tp
u
t
D
10
D
00
D
00
D
01
D
00
D
10
D
11
D
10
D
11
D
01
D
10
D
10
D
00
D
00
D
11
D
11
D
01
D
01
Active period
(D
10
)
Cycle
(D
00
+ 1)
In
a
ctive period
(D
00
−
D
10
+ 1)
electronic components distributor