UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
126 of 362
NXP Semiconductors
UM10208
Chapter 9: LPC2800 Interrupt controller
This is the best workaround where the maximum time for which FIQs are disabled is
critical (it does not increase this time at all). However, it does not solve problem one, and
requires extra instructions at every point where IRQs and FIQs are disabled together.
6.2.3 Solution 3: Re-enable FIQs at the beginning of the IRQ handler
As the required state of all bits in the c field of the CPSR are known, this can be most
efficiently be achieved by writing an immediate value to CPSR_C, for example:
MSR cpsr_c, #I_Bit:OR:irq_MODE ;IRQ should be disabled
;FIQ enabled
;ARM state, IRQ mode
This requires only the IRQ handler to be modified, and FIQs may be re-enabled more
quickly than by using workaround 1. However, this should only be used if the system can
guarantee that FIQs are never disabled while IRQs are enabled. It does not address
problem one.
7.
Interrupt controller usage notes
IRQ and FIQ interrupt service routines always begin at memory addresses 0x18 and 0x1C
respectively. These locations typically contain a branch or "load r15" instruction to a
routine in internal ROM or RAM. Bit 0 of system control register SYS_BOOTMAP controls
whether internal ROM or RAM is read when the reset sequence begins at address 0
following a warm reset. This bit power-on-resets to 0 so that POR is always from internal
ROM.
Although multiple sources can be selected to generate FIQ requests, there is one starting
point for all FIQ interrupts. Therefore, if more than one interrupt sources are classified as
FIQ, the FIQ interrupt service routine must read INT_VECTOR1 to decide what to do and
how to process the interrupt request. However, it is recommended that only one interrupt
source should be classified as FIQ. Classifying more than one interrupt sources as FIQ
will increase the interrupt latency.
The LPC288x interrupt controller conforms to the 2001 Philips Interrupt Architecture
Specification.
The IRQ service routine that starts at 0x18 should save registers and processor context,
and then read the INT_VECTOR0 register. If there is more than one source of FIQ, the
FIQ service routine that starts at 0x1C should similarly read the INT_VECTOR1 register.
These routines can then use the value read to fetch the address of the specific interrupt
service routine from a table in memory, and either branch to the routine or call it. If the
interrupt service routine allows nested interrupts (interruption of the ISR by higher-priority
sources), it should also:
1. save the value in the INT_PRIOMASK(0 or 1) register.
2. read a second word from the memory table entry.
3. write its "priority limit" value into the INT_PRIOMASK(0 or 1) register.
4. re-enable processor interrupts.