Spurious interrupts?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Spurious interrupts?

5,011 Views
pittbull
Contributor III
Hi,
The S12X can jump to a 'spurious' interrupt routine. What is this good for? Is this something like an exception handler when errors occur? Should I always have code for that vector e.g. to reset the system?

Thanks in advance,
pittbull
Labels (1)
0 Kudos
3 Replies

592 Views
SteveRussell
Contributor III
Unexpected interrupts are very confusing to track down.
 
For development I strongly recommend that you put code that goes into an infinite loop under ALL interrupts that you don't expect.
 
The reason is that erased flash for an interrupt vector loses all the information about the interrupt source.  A trivial interrupt service routine consisting of RTI has a similar problem.
 
Generating dummy interrupt service routines consisting of "for ( ; ; )" is a cut and paste exercise that takes less time than tracking down one unexpected interrupt bug. 
 
Doing it when you first start working on a particular MCU is well worth while.
 
For production releases, you might want to do something a little different, but the COP watchdog will get you restarted from the infinite loop.
0 Kudos

592 Views
Steve
NXP Employee
NXP Employee

It's there to handle situations where the interrupt source is lost before the vector is handled. See page 791 in the manual for a description. (An example of how this can occur is also given in the PIT section page 697).

It has the highest priority and is always handled by the CPU so you must always assign a vector and interrupt service routine to it. The situation is typically very rare and how you handle it depends on how deterministic your system needs to be. If you find this interrupt occurring often then you probably have some systematic defect somewhere. If you are unable to tolerate any lost interrupts then you may need to reset. Alternatively, you may wish to keep a record of these events for diagnostic analysis.

0 Kudos

592 Views
pittbull
Contributor III
Hello,
Thanks for the advice. Now I will always assign an ISR to it...
0 Kudos