MS51
Dec. 17, 2019
Page
289
of 316
Rev 1.01
M
S51
SE
RIES
TE
CHNICA
L REF
ERE
N
CE MA
NU
A
L
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 PWMnNP bit to make PWM actually outputs according to the negative logic.
6.11.7
PWM Interrupt
The PWM module has a flag PWMF (PWMnCON0.5) to indicate certain point of each complete PWM
period. The indicating PWM channel and point can be selected by INTSEL[2:0] and INTTYP[1:0]
(PWMnINTC[2:0] and [5:4]). Note that the center point and the end point interrupts are only available
when PWM operates in its center-aligned type. PWMF is cleared by software.
The PWM interrupt related with PWM waveform is shown as figure below.
Reserved
PWMF (central point)
(INTTYP[1:0] = [1:0])
PWMF (end point)
(INTTYP[1:0] = [1:1])
Central point
End point
PWM channel 0/2/4
pin output
Software
clear
12-bit PWM counter
Dead time
PWMF (falling edge)
(INTTYP[1:0] = [0:0])
PWMF (rising edge)
(INTTYP[1:0] = [0:1])
Edge-aligned PWM
Center-aligned PWM
Reserved
Figure 6.11-7 PWM Interrupt Type
Fault Brake event requests another interrupt, Fault Brake interrupt. It has different interrupt vector from
PWM interrupt. When either Fault Brake pin input event or ADC compare event occurs, FBF
(PWMnFBD.7) will be set by hardware. It generates Fault Brake interrupt if enabled. The Fault Brake
interrupt enable bit is EFB0 (EIE0.5). FBF Is cleared via software.
6.11.8
Control Regsiter
PWMCON0
– PWM Control 0
Regiser
Address
Reset Value
PWMCON0
D7H, all pages, Bit addressable
0000_0000b
7
6
5
4
3
2
1
0
PWMRUN
LOAD
PWMF
CLRPWM
-
-
-
-
R/W
R/W
R/W
R/W
-
-
-
-
Bit
Name
Description