Determining IRQ Source

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

Determining IRQ Source

958 Views
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.

Labels (1)
0 Kudos
4 Replies

692 Views
kef
Specialist I

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

0 Kudos

692 Views
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 Kudos

692 Views
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

692 Views
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.