
NUC126
Aug. 08, 2018
Page
436
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
these settings, the PWM channel outputs can be assigned to specified logic states independent of the
duty cycle comparison units. The PWM mask bits are useful when controlling various types of
Electrically Commutated Motor (ECM) like a BLDC motor. The PWM_MSKEN register contains six
bits, MSKENn(PWM_MSKEN[5:0]). If the MASKENn is set to active-high, the PWM channel n output
will be overridden. The PWM_MSK register contains six bits, MSKDATn(PWM_MSK[5:0]). The bit
value of the MSKDATn determines the state value of the PWM channel n output when the channel is
overridden. Figure 6.13-28 shows an example of how PWM mask control can be used for the override
feature.
PWMx_CH2
PWMx_CH0
PWM_MSK
[5:0]
0x8
0x11
0x5
PWM_MSKEN
[5:0]
PWMx_CH1
PWMx_CH3
0x2A (Mask channel 1, 3, 5)
0x15 (Mask channel 0, 2, 4)
PWMx_CH4
PWMx_CH5
Figure 6.13-28 Illustration of Mask Control Waveform
6.13.5.23 PWM Brake
Each PWM module has two external input brake control signals. User can select active brake pin
source is from PWMx_BRAKEy pin by BKxSRC bits of BNF register(x=0,1, y=0,1). The external
signals will be filtered by a 3-bits noise filter. User can enable the noise filter function by BRKxNFEN
bits of BNF reigster, and noise filter sampling clock can be selected by setting BRKxNFSEL bits of
BNF register to fit different noise properties. Moreover, by setting the BRKxFCNT bits, user can define
by how many sampling clock cycles a filter will recognize the effective edge of the brake signal.
In addition, it can be inversed by setting the BRKxPINV (x denotes input external pin 0 or 1) bits of
BNF register to realize the polarity setup for the brake control signals. Set BRKxPINV bit to 0, brake
event will occurred when PWMx_BRAKEy(x=0,1, y=0,1) pin status is from low to high; set BRKxPINV
to 1, brake event will occurred when PWMx_BRAKEy pin status is from high to low.