Determining IRQ Source

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

Determining IRQ Source

1,073 次查看
jimfell
Contributor III

My ColdFire application is jumping into the default ISR.  (All "unused" ISRs are mapped to a default ISR.)  How do I determine the source of the interrupt/exception?  I am using MCF51JM128 and CodeWarrior 10.2.  Thanks.

标签 (1)
0 项奖励
4 回复数

807 次查看
kef
Specialist I

It is simple. For debugging purposes you can make each vector-N pointing to empty ISR_n.

0 项奖励

807 次查看
jimfell
Contributor III

I need to know what triggered the ISR, after getting into the ISR.  There are not enough breakpoints available to be able to set a breakpoint in every possible ISR.

0 项奖励

807 次查看
TomE
Specialist II

The standard method for common interrupt service routines (like when you have multiple serial ports using common code) is to have separate service routines with different vectors, but have them load up a register with a unique number (the vector index usually) and then branch to a common service routine. In your case that's where you set the one breakpoint, and then examine the register (or variable where the routine saves the number) to see which one did it. Or you can have the individual routines simply CALL the common function, and when in there you just display a stack-trace to see which service routine called the common one.

Tom

807 次查看
kef
Specialist I

Then instead of empty ISR's you need ISR with for(;;){} inside. In case watchdog is enabled, make these forewer loops resetting watchdog timer. Then just halt timer to see which ISR is running. LED could be used to signal when ISR is called.