This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Catch-all ISR? (MSP430)



Hi all,

Using the F5529 and was wondering if there is something like a 'catch-all' ISR? With other chips I have used I have been able to declare something that is usually called a 'bad ISR', which is basically an interrupt service routine that will service any interrupts which have been enabled but do not have individual service routines.

Does anyone know if this exists for the F5529 or MSP430 family in general?

Much appreciated :)

  • Yes, you can certainly do that. But there is really no need for that. Each of the potential interrupt source has an individual interrupt enable bit. If you do not enable it, it will not generate an interrupt even when the Global Interrupt Enable is set.  After power up or reset, all these are IE bits are cleared. Unless you specifically set them, they stay cleared.

  • Not sure which compiler you are using, but for CCS see CCS Compiler Warning #10374-D

  • I use IAR KickStart assembler only. But that does not matter. I have seen other people doing that in c. Some will just return from interrupt. Some will try to identify the source and disable the IE of that source and return from interrupt. Yet other will simply reset the system or try to log the event and reset. I do not think they are useful or necessary at all.

    By the way, if you use Grace or things like that, it might generate code to enable individual interrupts "automatically". In that case you may want to handle all kinds of interrupts automatically too. How about a universal program that does everything under the sun (and above the sun automatically ;)

  • I know that warning, and I know that you can enable/disable individual interrupts. I am purposefully enabling nearly all interrupts, and I will eventually write routines for each one. In the meantime, however, I don't want to do that, or at least not yet, or maybe I will disable individual interrupts down the road. What I was hoping was for a specific handler routine to catch all the undeclared ISRs. Almost every other compiler I have used does this. Does anyone know what this is called in CCS?

  • Not sure what you do once you catch them. I think something like this will catch them all in one interrupt service routing:

    #pragma vector = 0,2,4,6,8,10,12,14,16,18,20,..

  • This should trap all the interrupts on the F5529 device.

    #pragma vector=   41, 42, 43, 44, 45, 46, \

                      47, 48, 49, 50, 51, 52, \

                      53, 54, 55, 56, 57, 58, \

                      59, 60, 61, 62

    __interrupt void ISR_TRAP(void)

    {

          while(1);

    }

  • I think vectors have to be even, thus I said 0,2,4,6,8,10,12,14,...

    Yes, for F5529, you can forget about catching 0,2,4,6,8,10,12,14,...,80 and only try to catch 82,84,86,88,90,92,94,96,...,124

  • OCY said:
    Not sure what you do once you catch them.

    While it is surely possible to catch all unused interrupts on a common ISR (maybe jsut a RETI), and MSPGCC already does this by default, this makes not much sense. To be able to recover from an unintended interrupt, the ISR needs to clear teh IFG bit of this interrupt, or else the interrupt will happen again an again, leavign no time for anything else. The only purpose for such a common ISR is placing a breakpoint on it (and never return to the code at all)

**Attention** This is a public forum