
NUC126
Aug. 08, 2018
Page
442
of 943
Rev 1.03
NUC12
6 S
E
RI
E
S
T
E
CH
NI
CA
L R
E
F
E
RE
NCE
MA
NUA
L
PWMx_CH0
PWMx_CH1
PWMx_CH0
PWMx_CH1
off
on
on
off
off
off
on
off
(PINV0=0)
(PINV1=0)
Dead-time insertion; It is only effective in complementary mode
Note
: PINVx: Negative Polarity control bits; It controls the PWM
output initial state and polarity, x denotes 0 or 1.
PWMx_CH0
PWMx_CH1
PWMx_CH0
PWMx_CH1
PWMx_CH0
PWMx_CH1
(PINV0=1)
(PINV1=0)
(PINV0=0)
(PINV1=1)
(PINV0=1)
(PINV1=1)
Initial State
PWM Starts
on
off
off
on
off
off
on
off
off
on
on
off
off
off
on
off
off
off
on
off
on
off
off
on
Figure 6.13-36 Initial State and Polarity Control with Rising Edge Dead-Time Insertion
6.13.5.26 PWM Interrupt Generator
There are three independent interrupts for each PWM as shown in Figure 6.13-38.
The 1
st
PWM interrupt (PWM_INT) comes from PWM complementary pair events. The counter can
generate the Zero point Interrupt Flag ZIFn (PWM_INTSTS0[5:0], n=0,1..5) and the Period point
Interrupt Flag PIFn (PWM_INTSTS0[13:8], n=0,1..5
). When PWM channel n’s counter equals to the
comparator value stored in PWM_CMPDATn register, the different interrupt flags will be triggered
depending on the couting direction. If the matching occurs at up
–count direction, the Up Interrupt Flag
CMPUIFn (PWM_INTSTS0[21:16]) is set and if matching at the opposite direction, the Down Interrupt
Flag CMPDIFn (PWM_INTSTS0[29:24]) is set. If the corresponding interrupt enable bits are set, the
trigger events will generates interrupt signals.
PWM_INT can use the PWM_IFA register to accumulate the number of times that the interrupt flags
have been triggered. By setting IFAENn_m (IFAEN0_1(PWM_IFA[7]), IFAEN2_3 (PWM_IFA[15]) and
IFAEN4_5 (PWM_IFA[23])) bits to 1 to enable accumulator. When the accumulator is enabled,
PWM_INT will switch interrupt source from every event trigger interrupt to trigger interrupt once every
accumulate times.
By setting the IFSELn_m (IFSEL0_1 (PWM_IFA[6:4]), IFSEL2_3 (PWM_IFA[14:12]) and IFSEL4_5
(PWM_IFA[22:20])) bits, user can select one of the 8 interrupt sources to accumulate, and compare
with IFCNTn_m (IFCNT0_1 (PWM_IFA[3:0]), IFCNT2_3 (PWM_IFA[11:8]) and IFCNT4_5
(PWM_IFA[19:16])) bits, when interrupt accumulator equals IFCNTn_m then set IFAIFn_m (IFAIF0_1
(PWM_INTSTS0[7]), IFAIF2_3 (PWM_INTSTS0[15]) and IFAIF4_5 (PWM_INTSTS0[23])) bits as
PWM_INT
signal
when
enable
IFAIENn_m
(IFAIEN0_1
(PWM_INTEN0[7]),
IFAIEN2_3
(PWM_INTEN0[15]) and IFAEN4_5 (PWM_INTEN0[23])) bits. Figure 6.13-37 is an example of channel
0 and channel 1 pair using PWM_IFA register to output PWM_INT once every I1 times
interrupt events occurred.