DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10316_0
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 00.06 — 17 December 2008
92 of 571
NXP Semiconductors
UM10316
Chapter 9: LPC29xx Vectored Interrupt Controller (VIC)
If the level-sensitive interrupt request line of the VIC is enabled (depending on the polarity
setting), the request is forwarded to the interrupt selection. The interrupt selection part
selects the interrupt request line with the highest priority, based on the target and priority
of the interrupt request and priority masks.
The VIC introduces an interrupt latency (measured from assertion of an INT_N signal to
an assertion of IRQ/FIQ) of less than two periods of the system clock.
The INT_VECTOR register can be used to identify the interrupt request line that needs to
be served. It can be used as an interrupt vector to the interrupt service routine. In
TABLE_ADDR the offset of the vector table can be programmed. Together with the INDEX
this information forms a vector.
The IRQ or FIQ generates a corresponding exception on the ARM core. The exception
handler should read the INT_VECTOR register to determine the highest-priority interrupt
source. This functionality should be implemented in a dispatcher, usually in the assembler.
This dispatcher performs the following steps:
2.1 Non-nested interrupt service routine
1. Put all registers that are used (according to the ARM-Procedure-Call Standard) on
stack.
2. Determine the interrupt source by reading The INT_VECTOR register
3. Call the interrupt service routine
4. Get all (saved) registers back from the stack
5. End the interrupt service routine by restoring the Program Counter register (PC).
2.2 Nested interrupt service routine
1. Put all registers that are used (according to the ARM-Procedure-Call Standard) on
stack.
2. Determine the interrupt source by reading The INT_VECTOR register
3. Raise the priority-masking threshold to the priority level of the interrupt request to be
served
4. Re-enable interrupt in the processor
5. Call the interrupt service routine
6. Restore the saved priority mask
7. Get all (saved) registers back from the stack
8. End the interrupt service routine by restoring the program counter.
3.
VIC programming example
The VIC driver provides an API to set up an interrupt source with all its parameters. All this
information ends up in the INT_REQUEST register of the VIC.
In most cases interrupt handling is controlled by some kind of OS. Installation of interrupt
vector tables depends on this.