Chapter 25 FlexPWM
MPC5602P Microcontroller Reference Manual, Rev. 4
704
Freescale Semiconductor
•
The prescaler divisor—from the PRSC bits in the CTRL1 register
•
The PWM period and pulse width—from the INIT and VALx registers
LDOK allows software to finish calculating all of these PWM parameters so they can be synchronously
updated. The PSRC, INIT, and VALx registers are loaded by software into a set of outer buffers. When
LDOK is set, these values are transferred to an inner set of registers at the beginning of the next PWM
reload cycle to be used by the PWM generator. Set LDOK by reading it when it is a logic zero and then
writing a logic one to it. After loading, LDOK is automatically cleared.
25.9.2
Load frequency
The LDFQ bits in the CTRL1 register select an integral loading frequency of one to 16 PWM reload
opportunities. The LDFQ bits take effect at every PWM reload opportunity, regardless the state of the
LDOK bit. The HALF and FULL bits in the CTRL1 register control reload timing. If FULL is set, a reload
opportunity occurs at the end of every PWM cycle when the count equals VAL1. If HALF is set, a reload
opportunity occurs at the half
cycle when the count equals VAL0. If both HALF and FULL are set, a reload
opportunity occurs twice per PWM cycle when the count equals VAL1 and when it equals VAL0.
Figure 25-54. Full cycle reload frequency change
Figure 25-55. Half cycle reload frequency change
Counter
Reload
Change
Reload
Frequency
Every
two opportunities
to every
four opportunities
to every
opportunity
Counter
Reload
Change
Reload
Frequency
Every two
opportunities
to every four
opportunities
to every
opportunity