English
Language : 

MC68HC908LB8_05 Datasheet, PDF (147/234 Pages) Freescale Semiconductor, Inc – M68HC08 Microcontrollers
PWM Generators
For ease of software, the LDFQx bits are buffered. When the LDFQx bits are changed, the reload
frequency will not change until the previous reload cycle is completed. See Figure 15-5.
NOTE
When reading the LDFQx bits, the value is the buffered value (for example,
not necessarily the value being acted upon).
RELOAD
RELOAD
RELOAD
CHANGE RELOAD
FREQUENCY TO
EVERY 4 CYCLES
RELOAD
RELOAD
RELOAD
RELOAD
CHANGE RELOAD
FREQUENCY TO
EVERY CYCLE
Figure 15-5. Reload Frequency Change
PWMINT enables CPU interrupt requests as shown in Figure 15-6. When this bit is set, CPU interrupt
requests are generated when the PWMF bit is set. When the PWMINT bit is clear, PWM interrupt requests
are inhibited. PWM reloads will still occur at the reload rate, but no interrupt requests will be generated.
VDD
RESET
D
LATCH
PWMF
READ PWMF AS 1,
WRITE PWMF AS 0
OR RESET
CPU INTERRUPT
REQUEST
PWM RELOAD
CK
PWMINT
Figure 15-6. PWM Interrupt Requests
To prevent a partial reload of PWM parameters from occurring while the software is still calculating them,
an interlock bit controlled from software is provided. This bit informs the PWM module that all the PWM
parameters have been calculated, and it is “okay” to use them. A new modulus, prescaler, and/or PWM
value cannot be loaded into the PWM module until the LDOK bit in PWM control register 1 is set. When
the LDOK bit is set, these new values are loaded into a second set of registers and used by the PWM
generator at the beginning of the next PWM reload cycle as shown in Figure 15-7 and Figure 15-8. After
these values are loaded, the LDOK bit is cleared.
NOTE
When the PWM module is enabled (via the PWMEN bit), a load will occur
if the LDOK bit is set. Even if it is not set, an interrupt will occur if the
PWMINT bit is set. To prevent this, the software should clear the PWMINT
bit before enabling the PWM module.
NOTE
Setting PWMEN forces PWM1 and PWM0 to be inputs and the
appropriately configured FAULT pin to be an output, overriding the data
MC68HC908LB8 Data Sheet, Rev. 1
Freescale Semiconductor
147