Technical Support

GENERAL: DUMMY INTERRUPT SERVICE ROUTINES

QUESTION

How do I insert dummy interrupt vectors in my code for debug purposes?

ANSWER

Create an interrupt service routine using the interrupt keyword for each unused interrupt. In these routines, use a while (1) {} statement to create a tight loop jumping to itself. The following is a typical example:

void empty_isr (void) interrupt 0
        {
        while (1) {};
        }

Copy it for each interrupt and remember to change the interrupt number. If you forget, the linker posts an error message about code space overlap.

If a spurious interrupt is received, your interrupt handler halts your program in this tight loop. This may give you an idea where the problem may lie.

Last Reviewed: Saturday, May 08, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure