Spurious interrupts?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Spurious interrupts?

5,588 次查看
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
标签 (1)
0 项奖励
回复
3 回复数

1,169 次查看
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 项奖励
回复

1,169 次查看
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 项奖励
回复

1,169 次查看
pittbull
Contributor III
Hello,
Thanks for the advice. Now I will always assign an ISR to it...
0 项奖励
回复