MMC2001
PROGRAMMING REFERENCE
MOTOROLA
REFERENCE MANUAL
C-25
COUNT EN — Counter Enable
This bit enables or disables the PWM counter. The counter is actually enabled or dis-
abled some time after the CPU writes this bit, as the enable occurs on the next rising
PCLK edge following internal synchronization. Disabling the counter once it has been
running occurs following the next period match.
0 =
PWM disabled. While disabled, the counter is in low-power mode and does
not count. The following events occur:
When the output pin is configured to operate in PWM mode (MODE =1), the
output pin is forced to the setting of the POL bit.
The counter is reset to 00 and frozen.
The contents of the width and period registers are loaded into the compara-
tors.
The comparators are disabled.
If the counter has been running, and the actual disable occurs at the occur-
rence of a period match, an interrupt request may still be generated, even
though the counter is being disabled. To avoid this, write the interrupt enable
control bit (IRQ_EN) to zero when disabling the counter.
1 =
PWM is enabled and begins a new period. The following events occur:
The output pin changes state to start a new period (if width != 0 and
period != 0 and width < period).
The counter is released and begins counting
The comparators are enabled
The PWM IRQ bit is set, indicating the start of a new period if IRQ EN is set.
CLK SEL — Clock Select
These bits select the output of the divider chain.
C.6.2 PWM Period Register
The PWM period register (PWMPR) controls the period of the PWM by defining the
number of PCLKs in the period. When the counter value matches the value in this
register, an interrupt is posted and the counter is reset to start another period.
Table C-11 Clock Select Field Values
Value
Divide By
000
4
001
8
010
16
011
64
100
256
101
2048
110
16384
111
65536
Freescale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc.
..