UM10413
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2011. All rights reserved.
User manual
Rev. 1 — 16 December 2011
196 of 268
NXP Semiconductors
UM10413
MPT612 User manual
•
If a match register contains the same value as the timer reset value (the PWM cycle
length), then the PWM output is reset to LOW on the next clock tick. Therefore, the
PWM output always consists of a one clock tick wide positive pulse with a period
determined by the PWM cycle length (that is, the timer reload value).
•
If a match register is set to zero, then the PWM output goes HIGH the first time the
timer returns to zero and stays HIGH continuously.
Remark:
If the match outputs are selected to perform as PWM outputs, the timer reset
(MRnR) and timer stop (MRnS) bits in the match control register MCR must be set to logic
0 except for the match register setting the PWM cycle length. For this register, set bit
MRnR to logic 1to enable the timer reset when the timer value matches the value of the
corresponding match register.
22.6 Example timer operation
shows a timer configured to reset the count and generate an
interrupt on match. The prescaler is set to 2 and the match register set to 6. At the end of
the timer cycle where the match occurs, the timer count is reset which gives a full length
cycle to the match value. The interrupt indicating that a match occurred is generated in the
next clock after the timer reached the match value.
shows a timer configured to stop and generate an interrupt on
match. The prescaler is again set to 2 and the match register set to 6. In the next clock
after the timer reaches the match value, the timer enable bit in TCR is cleared, and the
interrupt indicating that a match occurred is generated.
Fig 56. Sample PWM waveforms with a PWM cycle length of 100 (selected by MR3) and
MAT3:0 enabled as PWM outputs by register PWCON
aaa-000619
PWM1/MAT1
MR1 = 41
PWM0/MAT0
MR0 = 65
0
41
65
100
(counter is reset)
PWM2/MAT2
MR2 = 100
Fig 57. A timer cycle in which PR = 2, MRx = 6, and both interrupt and reset on match are enabled
aaa-000620
PCLK
prescale
counter
2
4
5
6
0
1
0
1
2
0
1
2
0
1
2
0
1
timer
counter
timer counter
reset
interrupt