
Chapter 4. Interrupts Page 4-7
4.3.1.1 Interrupt Priorities
There are two stages of interrupt priority: assigned interrupt level and natural priority. Assigned pri-
ority is set by FX2 firmware; natural priority is as shown in Table 4-9, and is fixed.
The assigned interrupt level (highest, high, or low) takes precedence over natural priority.
The
RESUME (USB wakeup) interrupt always has highest assigned priority and is the only interrupt
that can have highest assigned priority. All other interrupts can be assigned either high or low prior-
ity.
In addition to an assigned priority level (high or low), each interrupt also has a natural priority, as
listed in Table 4-9.
Simultaneous
interrupts with the same assigned priority level (for example, both
high) are resolved according to their natural priority. For example, if INT0 and INT1 are both
assigned high priority and both occur simultaneously, INT0 takes precedence due to its higher nat-
ural priority.
Once an interrupt is being serviced, only an interrupt of higher assigned priority level can interrupt
the service routine. That is, an ISR for a low-assigned-level interrupt can only be interrupted by a
high-assigned-level interrupt. An ISR for a high-assigned-level interrupt can only be interrupted by
the RESUME interrupt.
Table 4-9. Interrupt Flags, Enables, Priority Control, and Vectors
Interrupt Description
Interrupt
Request Flag
Interrupt
Enable
Assigned
Priority
Control
Natural
Priority
Interrupt
Vector
RESUME Resume interrupt EICON.4 EICON.5 Always
Highest
0
(highest)
0x0033
INT0 External interrupt 0 TCON.1 IE.0 IP.0 1 0x0003
TF0 Timer 0 interrupt TCON.5 IE.1 IP.1 2 0x000B
INT1 External interrupt 1 TCON.3 IE.2 IP.2 3 0x0013
TF1 Timer 1 interrupt TCON.7 IE.3 IP.3 4 0x001B
TI_0 or RI_0 Serial port 0 transmit or
receive interrupt
SCON0.1 (TI.0)
SCON0.0 (RI_0)
IE.4 IP.4 5 0x0023
TF2 or EXF2 Timer 2 interrupt T2CON.7 (TF2)
T2CON.6 (EXF2)
IE.5 IP.5 6 0x002B
TI_1 or RI_1 Serial port 1 transmit or
receive interrupt
SCON1.1 (TI_1)
SCON1.0 (RI_1)
IE.6 IP.6 7 0x003B
USBINT Autovectored USB interrupt EXIF.4 EIE.0 EIP.0 8 0x0043
I²CINT I²C-Compatible Bus inter-
rupt
EXIT.5 EIE.1 EIP.1 9 0x004B
INT4 Autovectored FIFO / GPIF or
External interrupt 4
EXIF.6 EIE.2 EIP.2 10 0x0053
INT5 External interrupt 5 EXIF.7 EIE.3 EIP.3 11 0x005B
INT6 External interrupt 6 EICON.3 EIE.4 EIP.4 12 0x0063
Comentarios a estos manuales