English
Language : 

MC68HC908LB8_05 Datasheet, PDF (152/234 Pages) Freescale Semiconductor, Inc – M68HC08 Microcontrollers
Pulse Width Modulator with Fault Input (PWM)
15.6 Initialization and the PWMEN Bit
For proper operation, all registers should be initialized and the LDOK bit should be set before enabling
the PWM via the PWMEN bit. When the PWMEN bit is first set, a reload will occur immediately, setting
the PWMF flag and generating an interrupt if PWMINT is set.
NOTE
If the LDOK bit is not set when PWMEN is set after a RESET, the prescaler
and PWM values will be 0, but the modulus will be unknown. If the LDOK
bit is not set after the PWMEN bit has been cleared then set (without a
RESET), the modulus value that was last loaded will be used.
Because of the equals-comparator architecture of this PWM, the modulus =
0 case is considered illegal. Therefore, the modulus register is not reset,
and a modulus value of 0 will result in waveforms inconsistent with the other
modulus waveforms. See 15.8.2 PWM Counter Modulo Registers.
When PWMEN is set, the PWM pins change from high impedance to outputs. At this time, assuming no
fault condition is present, the PWM pins will drive according to the PWM values and polarity. See the
timing diagram in Figure 15-13.
CPU CLOCK
PWMEN
PWM PINS
PORT FUNCTION
DRIVE ACCORDING TO PWM
VALUE AND POLARITY
PORT FUNCTION
Figure 15-13. PWMEN and PWM Pins
When the PWMEN bit is cleared, this will occur:
• PWM pins will be three-stated
• PWM counter is cleared and will not be clocked
• Internally, the PWM generator will force its outputs to 0 to avoid glitches when the PWMEN is set
again
When PWMEN is cleared, all fault circuitry remains active.
NOTE
The PWMF flag and pending CPU interrupts are NOT cleared when
PWMEN = 0.
15.7 PWM Operation in Low-Power Modes
15.7.1 Wait Mode
When the microcontroller is put in low-power wait mode via the WAIT instruction, all clocks to the PWM
module will continue to run. If an interrupt is issued from the PWM module (via a reload or a fault), the
microcontroller will exit wait mode.
MC68HC908LB8 Data Sheet, Rev. 1
152
Freescale Semiconductor