www
.mcu.com.cn
134
/
239
Rev.
1.00
CMS80F731x Reference Manual
17.6 PWM Interrupt
PWM has a total of 12 interrupt flags, of which 6 zero interrupt flags, 6 downward comparison interrupt flags, the generation
of interrupt flag bits and the corresponding interrupt enable bit is not related to whether the corresponding interrupt enable bit is
turned on. To enable PWM, any type of interrupt requires the global interrupt enable bit (EA=1) and the PWM global interrupt
enable bit PWMIE to successfully configure the PWM interrupt function. All interrupts of PWM share an interrupt vector entry, so
after entering the interrupt service program, the user can determine which type of interrupt is generated by the interrupt flag.
The interrupt enable and priority of the PWM can be set by the following relevant register bits.
17.6.1
Interrupt Mask Register EIE2
0xAA
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
EIE2
SPIIE
I2CIE
WDTIE
ADCIE
PWMIE
--
ET4
ET3
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Reset value
0
0
0
0
0
0
0
0
Bit7
SPIIE:
SPI interrupt enable bit;
1=
Enable SPI interrupts;
0=
Prohibited SPI Interrupt.
Bit6
I2CIE:
I2C interrupt enable bit;
1=
Enable I2C interrupts;
0=
Disable I
2
C Interrupt.
Bit5
WDTIE:
WDT interrupt enable bit;
1=
Enable WDT overflow interrupts;
0=
Disable WDT overflow interrupts.
Bit4
ADCIE:
ADC interrupt enable bit;
1=
Enable ADC interrupts;
0=
Disable ADC interrupts.
Bit3
PWMIE:
PWM global interrupt enable bit;
1=
Enable all PWM interrupts;
0=
Disable all PWM interrupts.
Bit2
--
Reserved, must be 0.
Bit1
ET4:
Timer4 interrupt enable bit;
1=
Enable Timer4 interrupts;
0=
Disable Timer4 Interrupt.
Bit0
ET3:
Timer3 interrupt enable bit;
1=
Enable Timer3 interrupts;
0=
Disable Timer3 Interrupt.