MS51
Nov. 28, 2019
Page
319
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
PWM Channel
Output
Pin
Control register 1
Control register2
SFR Byte Name
Bit name
Value
SFR Byte Name
Bit name
Value
P3.1
PIOCON2[4]
PIO31
1
01
P0.0
PIOCON0[3]
PIO00
1
10
P0.4
PIOCON1[3]
PIO04
1
11
PWM3_CH0
P3.2
PIOCON2[5]
PIO32
1
AUXR5[1:0]
PWM3C0P-
01
P0.1
PIOCON0[4]
PIO01
1
10
P1.7
PIOCON1[7]
PIO17
1
11
PWM3_CH1
P3.4
PIOCON2[7]
PIO34
1
AUXR5[3:2]
PWM3C1P
01
P1.5
PIOCON1[5]
PIO15
1
10
P0.3
PIOCON0[5]
PIO03
1S
11
Table 6.6-1 PWM Pin Define And Enable Control Register
6.6.2
Functional Description
PWM Generator
6.6.2.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.