
ML66517 Family User’s Manual
Chapter 11
PWM Function
11 – 10
11.4.2 PWM Operation During 16-Bit Mode
During the 16-bit mode, PWM output can use the two output pins of PWM1OUT and PWM3OUT.
PWM is started by first setting PW1RUN to “1”, and then by setting PWM0RUN to “1”. When the RUN bit
becomes 1, PWC begins counting, the output flip-flop is simultaneously set to “1”, and a High level is output
from the PWM1OUT pin (PWM3OUT pin). PWC continues to count upward. When its value matches the
contents of PWR01 (PWR23), a PWINT1 (PWINT3) interrupt request is generated, the output flip-flop is reset
to “0”, and a Low level is output from the PWM1OUT pin (PWM3OUT pin). If PWC overflows, the output
flip-flop is set to “1”, and the PWM1OUT pin (PWM3OUT pin) outputs a High level. Also, the value of PWCY
is loaded into PWC. Thereafter, until the RUN bit is reset to “0”, this operation will repeat and the duty
controlled waveform will be output from the PWM1OUT pin (PWM3OUT pin). By resetting the RUN bit to “0”,
the PWMnOUT is not fixed to “1”.
However, even in the 16-bit mode, an interrupt request (PWINT2) is generated when the value of PWC0 (lower
8 bits of PWC) matches that of PWR2 (lower 8 bits of PWR23). Also, a PWINT0 interrupt is generated when the
value of PWC0 (lower 8 bits of PWC) matches that of PWR0 (lower 8 bits of PWR01), and an interrupt request
(PWINT0) is generated when PWC0 overflows.
[Note]
Depending upon the count clock selected for PWC, immediately after PWM is started, the PWM output duty
may be shortened (for one cycle only).
If the value of PWC is 0000H, and the value of PWR01 (PWR23) is 0000H, the duty output is 1/65536.
Increasing the value of PWR01 (PWR23) increases the output duty (High level). If the value of PWR01
(PWR23) is FFFFH, the output is 65536/65536 or 100% duty. To realize 0/65536 or 0% duty, use the port 1
primary function since 0% duty cannot be realized with the PWM function.
Figure 11-4 shows an example of PWM output operation. Figure 11-5 shows an example of the timing at which
PWM output changes.