Philips LPC213 Series User Manual page 59

Table of Contents

Advertisement

Philips Semiconductors
Volume 1
5.6 Spurious interrupts
Spurious interrupts are possible in the ARM7TDMI based microcontrollers such as the
LPC2131/2/4/6/8 due to asynchronous interrupt handling. The asynchronous character of
the interrupt processing has its roots in the interaction of the core and the VIC. If the VIC
state is changed between the moments when the core detects an interrupt, and the core
actually processes an interrupt, problems may be generated.
Real-life applications may experience the following scenarios:
Furthermore, It is possible that the VIC state has changed during step 3. For example, VIC
was modified so that the interrupt that triggered the sequence starting with step 1) is no
longer pending -interrupt got disabled in the executed code. In this case, the VIC will not
be able to clearly identify the interrupt that generated the interrupt request, and as a result
the VIC will return the default interrupt VicDefVectAddr (0xFFFF F034).
This potentially disastrous chain of events can be prevented in two ways:
5.6.1 Details and case studies on spurious interrupts
This chapter contains details that can be obtained from the official ARM website
(http://www.arm.com), FAQ section under the "Technical Support" link:
http://www.arm.com/support/faqip/3677.html.
What happens if an interrupt occurs as it is being disabled?
Applies to: ARM7TDMI
If an interrupt is received by the core during execution of an instruction that disables
interrupts, the ARM7 family will still take the interrupt. This occurs for both IRQ and FIQ
interrupts.
For example, consider the following instruction sequence:
MRS r0, cpsr
ORR r0, r0, #I_Bit:OR:F_Bit
MSR cpsr_c, r0
If an IRQ interrupt is received during execution of the MSR instruction, then the behavior
will be as follows:
User manual
1. VIC decides there is an IRQ interrupt and sends the IRQ signal to the core.
2. Core latches the IRQ state.
3. Processing continues for a few cycles due to pipelining.
4. Core loads IRQ address from VIC.
1. Application code should be set up in a way to prevent the spurious interrupts from
occurring. Simple guarding of changes to the VIC may not be enough since, for
example, glitches on level sensitive interrupts can also cause spurious interrupts.
2. VIC default handler should be set up and tested properly.
The IRQ interrupt is latched.
Rev. 01 — 24 June 2005
;disable IRQ and FIQ interrupts
UM10120
Chapter 5: VIC
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
59

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2131Lpc2132Lpc2134Lpc2136Lpc2138

Table of Contents