ML51/ML54/ML56
Sep. 01, 2020
Page
431
of 719
Rev 2.00
ML
51
/ML
54
/ML
5
6 S
E
RI
E
S
TECHNI
CA
L
RE
F
E
R
E
NC
E
M
A
NU
A
L
ML51/M
L54
/M
L56
Series
Tec
hnical Reference
Manual
6.8.4
Functional Description
PWM Generator
6.8.4.1
The PWM generator is clocked by the system clock or Timer 1 overflow divided by a PWM clock pre-
scalar selectable from 1/1~1/128. The PWM0/1/2/3 period is defined by effective 16-bit period
registers, {PWMnPH, PWMnPL}. The period is the same for all PWM0/1/2/3 channels for they share
the same 16-bit period counter. The duty of each PWM is determined independently by the value of
duty registers. PWM0 has six duty registers. PWM1/2/3 has two duty registers. These PWMs output
can be generated independently with different duty cycles. The interval and duty of PWM0/1/2/3 signal
is generated by a 16-bit counter comparing with the period and duty registers.
Only PWM0 has group mode to facilitate the three-phase motor control, a group mode can be used by
setting GP (PWM0CON1.5), which makes {PWM0C0H, PWM0C0L} and {PWM0C1H, PWM0C1L}
duty register decide duties of the PWM outputs. In a three-phase motor control application, two-group
PWM outputs generally are given the same duty cycle. When the group mode is enabled, {PWM0C2H,
PWM0C2L}, {PWM0C3H, PWM0C3L}, {PWM0C4H, PWM0C4L} and {PWM0C5H, PWM0C5L}
registers have no effect. This mean is {PWM0C2H, PWM0C2L} and {PWM0C4H, PWM0C4L} both as
same as {PWM0C0H, PWM0C0L}. Also {PWM0C3H, PWM0C3L} and {PWM0C5H, PWM0C5L} are
same as {PWM0C1H, PWM0C1L}.Note that enabling PWM0 does not configure the I/O pins into their
output mode automatically. User should configure I/O output mode via software manually.
The PWM0 counter generates six PWM0 signals called P0G0, P0G1, P0G2, P0G3, P0G4, and P0G5.
These signals will go through the PWM0 and Fault Brake output control circuit. It generates real
PWM0 outputs on I/O pins. The output control circuit determines the PWM mode, dead-time insertion,
mask output, Fault Brake control, and PWM polarity. The last stage is a multiplexer of PWM0 output or
I/O function.
The PWM1/2/3 counter generates two PWM1/2/3 signals. These signals will go through the
PWM1/2/3. It generates real PWM1/2/3 outputs on I/O pins. The output control circuit determines the
PWM mode, mask output and PWM polarity. The last stage is a multiplexer of PWM1/2/3 output or I/O
function.