English
Language : 

PXS20RM Datasheet, PDF (470/1368 Pages) Freescale Semiconductor, Inc – PXS20 Microcontroller
Enhanced Motor Control Timer (eTimer)
20.5.2.11 FIXED-FREQUENCY PWM Mode
If the counter is setup for CNTMODE = 001, count through roll-over (LENGTH = 0), continuous count
(ONCE = 0) and the OFLAG OUTMODE is ‘0111’ (set on compare, cleared on counter roll-over) then the
counter output yields a Pulse Width Modulated (PWM) signal with a frequency equal to the count clock
frequency divided by 65,536 and a pulse width duty cycle equal to the compare value divided by 65,536.
This mode of operation is often used to drive PWM amplifiers used to power motors and inverters.
20.5.2.12 VARIABLE-FREQUENCY PWM Mode
If the counter is setup for CNTMODE = 001, count till compare (LENGTH = 1), continuous count (ONCE
= 0) and the OFLAG OUTMMODE is ‘0100’ (toggle OFLAG and alternate compare registers) then the
counter output yields a Pulse Width Modulated (PWM) signal whose frequency and pulse width is
determined by the values programmed into the COMP1 and COMP2 registers, and the input clock
frequency. This method of PWM generation has the advantage of allowing almost any desired PWM
frequency and/or constant on or off periods. This mode of operation is often used to drive PWM amplifiers
used to power motors and inverters. The CMPLD1 and CMPLD2 registers are especially useful for this
mode, as they allow the programmer time to calculate values for the next PWM cycle while the PWM
current cycle is underway.
COMP2
COMP1
Clock
CNTR
0
COMP1
3
COMP2
2
CMPLD1
1
CMPLD2
4
COMP1 match
COMP2 match
OFLAG
PWM Period
Figure 20-28. Variable PWM Waveform
1
2
3
0
1
2
0
1
1
4
ignored since
OFLAG=0
ignored since
OFLAG=1
0
1
2
1
ignored since
OFLAG=1
CLC1=010, load COMP1 when CNTR=COMP1
CLC2=101, load COMP2 when CNTR=COMP2
Figure 20-29. Variable Frequency PWM Mode Timing
20-28
PXS20 Microcontroller Reference Manual, Rev. 1
Freescale Semiconductor