19 Interrupt System
The MPC82G516A has 14 interrupt sources with a four-level interrupt structure. There are several SFRs
associated with the four-level interrupt. They are the IE, IP, IPH, AUXIE, AUXIP, AUXIPH, XICON and TCON.
The IPH (Interrupt Priority High) and AUXIPH (Auxiliary Interrupt Priority High) registers make the four-level
interrupt structure possible. The four priority level interrupt structure allows great flexibility in handling these
interrupt sources.
19.1 Interrupt Sources
Table 19-1 lists all the interrupt sources. The ‘Request Bits’ are the interrupt flags that will generate an interrupt if
it is enabled by setting the ‘Enable Bit’. Of course, the global enable bit EA (in IE register) should have been set
previously. The ‘Request Bits’ can be set or cleared by software, with the same result as though it had been set
or cleared by hardware. That is, interrupts can be generated or pending interrupts can be cancelled in software.
The ‘Priority Bits’ determine the priority level for each interrupt. The ‘Priority within Level’ is the polling sequence
used to resolve simultaneous requests of the same priority level. The ‘Vector Address’ is the entry point of an
interrupt service routine in the program memory.
Figure 19-1 shown the interrupt system. Each of these interrupts will be briefly described in the following sections.
Table 19-1. Interrupt Sources
Source
Name
Enable
Bit
Request
Bits
Priority
Bits
Priority
within Level Address
Vector
No
#1
#2
External Interrupt, INT0
Timer 0
EX0
ET0
IE0
TF0
PX0H, PX0
PT0H, PT0
PX1H, PX1
PT1H, PT1
PSH, PS
(Highest)
0003H
000BH
0013H
001BH
0023H
002BH
0033H
003BH
0043H
004BH
0053H
005BH
0063H
006BH
.
.
.
.
.
.
.
.
.
.
#3
External Interrupt, INT1
Timer 1
EX1
ET1
IE1
#4
TF1
#5
Serial Port
ES
RI, TI
TF2, EXF2
IE2
#6
Timer 2
ET2
PT2H, PT2
PX2H, PX2
PX3H, PX3
PSPIH, PSPI
PADCH, PADC
PPCAH, PPCA
PBDH, PBD
PS2H, PS2
PKBH, PKB
#7
External Interrupt, INT2
External Interrupt, INT3
SPI
EX2
EX3
ESPI
EADC
EPCA
EBD
ES2
EKB
#8
IE3
#9
SPIF
ADCI
#10
#11
#12
#13
#14
ADC
CF, CCFn
(n=0~5)
PCA
Brownout Detection
UART2
OPF, CPF
S2RI, S2TI
KBIF
.
.
Keypad Interrupt
(Lowest)
89
MPC82G516A Data Sheet
MEGAWIN