MS51
Nov. 28, 2019
Page
326
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
PnG0/2/4 correspondingly.
Mask Output Control
6.6.2.9
Each PWM signal can be software masked by driving a specified level of PWM signal. The PWM
mask output function is quite useful when controlling Electrical Commutation Motor like a BLDC.
PWMnMEN determine which channel of PWM signal will be masked. PWMnMD set the individual
mask level of each PWM channel. The default value of PWMnMEN is 00H, which makes all outputs of
PWM channels follow signals from PWM generator. Note that the masked level is reversed or not by
PWM0NP setting on PWM output pins.
Fault Brake
6.6.2.10
The Fault Brake function is usually implemented in conjunction with an enhanced PWM circuit. It rules
as a fault detection input to protect the motor system from damage. Fault Brake pin input (FB) is valid
when FBINEN (PWMnCON1.3) is set. When Fault Brake is asserted PWM signals will be individually
overwritten by PWMnFBD corresponding bits. PWM0RUN (PWM0CON0.7) will also be automatically
cleared by hardware to stop PWM generating. The PWM 16-bit counter will also be reset as 0000H. A
indicating flag FBF will be set by hardware to assert a Fault Brake interrupt if enabled. PWMnFBD
data output remains even after the FBF is cleared by software. User should resume the PWM output
only by setting PWM0RUN again. Meanwhile the Fault Brake state will be released and PWM
waveform outputs on pins as usual. Fault Brake input has a polarity selection by FBINLS
(PWMnFBD.6) bit. Note that the Fault Brake signal feed in FB pin should be longer than eight-system-
clock time for FB pin input has a permanent 8/F
SYS
de-bouncing, which avoids fake Fault Brake event
by input noise. The other path to trigger a Fault Brake event is the ADC compare event. It asserts the
Fault Brake behavior just the same as FB pin input.
Note
that the
Fault Brake function are only valid in PWM0.
FBINEN
FB0
ADC comparator
ADC compare event
Fault Brake event
De-bounce
0
1
FBINLS
FBF
Fault Brake interrupt
Figure 6.6-8 Fault Brake Function Block Diagram
Polarity Control
6.6.2.11
Each PWM0 output channel has its independent polarity control bit, PNP0~PNP5. The default is high
active level on all control fields implemented with positive logic. It means the power switch is ON when
PWM outputs high level and OFF when low level. User can easily configure all setting with positive
logic and then set PNP bit to make PWM0 actually outputs according to the negative logic.
Note
that the
polarity control function are only valid in PWM0.