12. Interrupt
The device has a total of 12 interrupt sources. Each of the interrupt sources can be individually enabled or
disabled by setting or clearing a bit in the Interrupt Enable registers (IE, AUXIE and XICON). And, each interrupt
source can also be individually programmed to one of two priority levels by setting or clearing bit in the Interrupt
Priority registers (IP & AUXIP). The two priority level interrupt structure allows great flexibility in controlling the
handling of these interrupt sources. The following table lists all the interrupt sources.
Table: Interrupt Sources
Interrupt
Enable
Bit
Interrupt
Flag
Interrupt
Priority
Bits
Source
No.
Interrupt
Name
Polling
Priority
Vector
Address
Bit
#1
#2
External Interrupt, INT0
EX0
ET0
EX1
ET1
ES
ET2
EX2
EX3
ESPI
-
IE0
PX0
PT0
PX1
PT1
PS
(Highest)
0003H
000BH
0013H
001BH
0023H
002BH
0033H
003BH
0043H
004BH
0053H
005BH
0063H
006BH
0073H
007BH
Timer 0
TF0
.
#3
External Interrupt, INT1
IE1
.
#4
Timer 1
TF1
.
#5
Serial Port
RI+TI
.
#6
Timer 2
TF2+ EXF2
PT2
PX2
PX3
PSPI
-
.
#7
External Interrupt, INT2*
IE2
.
#8
External Interrupt, INT3*
IE3
.
#9
SPI
SPIF
.
#10
#11
#12
#13
#14
#15
#16
-
-
.
-
-
-
-
.
-
-
-
-
.
-
-
-
KBIF
-
.
Keypad Interrupt
EKBI
PKBI
PTWSI
PUSB
.
Two Wire Serial Interface ETWSI
USB EUSB
SI
.
(See Note1)
(Lowest)
Note1: The USB interrupt flags include:
(1) URST, URSM and USUS: contained in USB register UPCON.
(2) UTXD0, URXD0, UTXD1, UTXD2, ASOFIF and SOFIF: contained in USB register UIFLG.
(3) UTXD3, URXD3, URXD4 and UTXD5: contained in USB register UIFLG1
IE (Address=A8H, Interrupt Enable Register)
7
6
5
4
3
2
1
0
EA
-
ET2
ES
ET1
EX1
ET0
EX0
EA: Global disable bit. If EA = 0, all interrupts are disabled. If EA = 1, each interrupt can be individually enabled
or disabled by setting or clearing its enable bit.
ET2: Timer 2 interrupt enable bit.
ES: Serial Port interrupt enable bit.
ET1: Timer 1 interrupt enable bit.
EX1: External interrupt 1 enable bit.
ET0: Timer 0 interrupt enable bit.
EX0: External interrupt 0 enable bit.
MEGAWIN
MG84FL54B Data sheet
35