English
Language : 

PIC24FJ128GC010 Datasheet, PDF (107/472 Pages) Microchip Technology – 16-Bit Flash Microcontrollers with 12-Bit Pipeline A/D, Sigma-Delta A/D, USB On-The-Go and XLP Technology
PIC24FJ128GC010 FAMILY
8.3 Interrupt Control and Status
Registers
The PIC24FJ128GC010 family of devices implements
a total of 44 registers for the interrupt controller:
• INTCON1
• INTCON2
• IFS0 through IFS7
• IEC0 through IEC7
• IPC0 through IPC13, ICP15, ICP16, ICP18
through ICP23, ICP25, ICP26 and ICP29
• INTTREG
Global interrupt control functions are controlled from
INTCON1 and INTCON2. INTCON1 contains the Inter-
rupt Nesting Disable (NSTDIS) bit, as well as the
control and status flags for the processor trap sources.
The INTCON2 register controls the external interrupt
request signal behavior and the use of the Alternate
Interrupt Vector Table (AIVT).
The IFSx registers maintain all of the interrupt request
flags. Each source of interrupt has a status bit, which is
set by the respective peripherals or an external signal
and is cleared via software.
The IECx registers maintain all of the interrupt enable
bits. These control bits are used to individually enable
interrupts from the peripherals or external signals.
The IPCx registers are used to set the Interrupt Priority
Level (IPL) for each source of interrupt. Each user
interrupt source can be assigned to one of eight priority
levels.
The INTTREG register contains the associated
interrupt vector number and the new CPU Interrupt
Priority Level, which are latched into the Vector
Number (VECNUM<6:0>) and the Interrupt Level
(ILR<3:0>) bit fields in the INTTREG register. The new
Interrupt Priority Level is the priority of the pending
interrupt.
The interrupt sources are assigned to the IFSx, IECx
and IPCx registers in the order of their vector numbers,
as shown in Table 8-2. For example, the INT0 (External
Interrupt 0) is shown as having a vector number and a
natural order priority of 0. Thus, the INT0IF status bit is
found in IFS0<0>, the INT0IE enable bit in IEC0<0>
and the INT0IP<2:0> priority bits in the first position of
IPC0 (IPC0<2:0>).
Although they are not specifically part of the interrupt
control hardware, two of the CPU Control registers con-
tain bits that control interrupt functionality. The ALU
STATUS Register (SR) contains the IPL<2:0> bits
(SR<7:5>). These indicate the current CPU Interrupt
Priority Level. The user can change the current CPU
priority level by writing to the IPLx bits.
The CORCON register contains the IPL3 bit, which
together with the IPL<2:0> bits, indicates the current
CPU priority level. IPL3 is a read-only bit so that trap
events cannot be masked by the user software.
The interrupt controller has the Interrupt Controller Test
register, INTTREG, which displays the status of the
interrupt controller. When an interrupt request occurs,
its associated vector number and the new Interrupt Pri-
ority Level are latched into INTTREG. This information
can be used to determine a specific interrupt source if
a generic ISR is used for multiple vectors (such as
when ISR remapping is used in bootloader applica-
tions) or to check if another interrupt is pending while in
an ISR.
All Interrupt registers are described in Register 8-1
through Register 8-46 in the succeeding pages.
 2012-2013 Microchip Technology Inc.
DS30009312B-page 107