MS51
Dec. 17, 2019
Page
285
of 316
Rev 1.01
M
S51
SE
RIES
TE
CHNICA
L REF
ERE
N
CE MA
NU
A
L
PG0
PG1
PG2
PG3
PG4
PG5
FBINEN
(PWMnCON1.3)
PWM and Fault Brake output control
PWM
mode
select
PWMnMOD[1:0]
(PWMnCON1[7:6])
Dead
time
insertion
PWMnDTEN,
PWMnDTCNT
Mask
output
PMD0
PMEN0
PMD1
PMEN1
Brake
control
PWM
polarity
Brake event
(FBn)
PG0_DT
PG1_DT
PWM0/1
mode
PWM0/1
dead
time
FBD0
FBD1
PNP0
PNP1
PMD2
PMEN2
PMD3
PMEN3
PG2_DT
PG3_DT
PWM2/3
mode
PWM2/3
dead
time
FBD2
FBD3
PNP2
PNP3
PMD4
PMEN4
PMD5
PMEN5
PG4_DT
PG5_DT
PWM4/5
mode
PWM4/5
dead
time
FBD4
FBD5
PNP4
PNP5
BRK
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
PWMnMEN,
PWMnMD
PWMnFBD
PWMnPNP
PWMn_CH0
PWMn_CH3
PWMn_CH1
PWMn_CH2
PWMn_CH5
PWMn_CH4
Figure 6.11-2 PWM and Fault Brake Output Control Block Diagram
User should follow the initialization steps below to start generating the PWM signal output. In the first
step by setting CLRPWM (PWMnCON0.4), it ensures the 16-bit up counter reset for the accuracy of
the first duration. After initialization and setting {PWMnPH, PWMnPL} and all {PWMnH, PWMnL}
registers, PWMRUN (PWMnCON0.7) can be set as logic 1 to trigger the 16-bit counter running. PWM
starts to generate waveform on its output pins. The hardware for all period and duty control registers
are double buffered designed. Therefore, {PWMnPH, PWMnPL} and all {PWMnH, PWMnL} registers
can be written to at any time, but the period and duty cycle of PWM will not be updated immediately
until the LOAD (PWMnCON0.6) is set and previous period is complete. This
prevents glitches
when
updating the PWM period or duty.
NOTE
: A loading of new period and duty by setting LOAD should be ensured complete by monitoring
it and waiting for a hardware automatic clearing LOAD bit. Any updating of PWM control registers
during LOAD bit as logic 1 will cause unpredictable output.