11-8
MSM66573 Family User's Manual
Chapter 11 PWM Function
(8)
PWM control register 0 (PWMCON0)
If PWM0OUT and PWM2OUT are to be used, set the count clock for PWM counter 0
(PWC0) with bits 1 and 2 (PWCK00, PWCK01), and specify the interrupt factor that will
initiate a PWINT0 interrupt request with bit 3 (PWC0OV). If bit 0 (PW0RUN) is set to "1",
the PWM counter 0 (PWC0) begins counting. If reset to "0" the counting is halted.
If PWM1OUT and PWM3OUT are to be used, set the count clock for PWM counter 1
(PWC1) with bits 5 and 6 (PWCK10, PWCK11), and specify the interrupt factor that will
initiate a PWINT1 interrupt request with bit 7 (PWC1OV). If bit 4 (PW1RUN) is set to "1",
the PWM counter 1 (PWC1) begins counting. If reset to "0" the counting is halted.
[Equation to Calculate 8-Bit PWM Cycle]
f(PWM8) = PWCLK / (256 – PWCYn)
f(PWM8) : PWM cycle [Hz]
PWCLK : PWM input clock frequency [Hz]
PWCYn : Value of PWCY0 or PWCY1 (8 bits)
16-bit PWM settings
(1)
Port 7 mode register (P7IO)
If PWM1OUT is to be used, set bit 7 (P7IO7) to "1" to configure the port as an output.
(2)
Port 8 mode register (P8IO)
If PWM3OUT is to be used, set bit 7 (P8IO7) to "1" to configure the port as an output. When
the PWM function does not operate, this port is fixed at "1".
(3)
Port 7 secondary function control register (P7SF)
If PWM1OUT is to be used, set bit 7 (P7SF7) to "1" to configure the port as a secondary
function output. When the PWM function does not operate, this port is fixed at "1".
(4)
Port 8 secondary function control register (P8SF)
If PWM3OUT is to be used, set bit 7 (P8SF7) to "1" to configure the port as a secondary
function output. When the PWM function does not operate, this port is fixed at "1".
(5)
PWM counters (PWC0, PWC1)
Set these counters with the value at which to start counting. Writing to PWC causes the
same value to be simultaneously and automatically written to PWCY.
(6)
PWM cycle register (PWCY)
Set the PWM cycle in PWCY.
(7)
PWM registers (PWR01, PWR23)
If PWM1OUT is to be used, set the desired output duty value in PWR01. If PWM3OUT is
to be used, set the desired output duty value in PWR23. Set a value for PWR01 and PWR23
that is larger than the value of PWCY.