Spurious Interrupts; Details And Case Studies On Spurious Interrupts - Philips LPC2101 User Manual

Table of Contents

Advertisement

Philips Semiconductors
Volume 1

5.6 Spurious interrupts

Spurious interrupts are possible in the ARM7TDMI based microcontrollers such as the
LPC2101/02/03 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, FAQ
section.
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 — 12 January 2006
;disable IRQ and FIQ interrupts
UM10161
Chapter 5: VIC
© Koninklijke Philips Electronics N.V. 2006. All rights reserved.
55

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2103Lpc2102

Table of Contents