Hi All, I am using the STR710 microcontroller. Does someone know if it is possible to catch all unused interrupts sources by putting an one single interrupt routine adress in all the different vectors? If an unused interrupt is triggert(whatever the source) than this will always execute the pre-defind service routine. In this case a system reset. This way I can manage all the unused interrupt sources preventing unexpected behaviour due to for example EMC problems. I tried to point a few different interrupt vertors to the same interrupt service routine but failt to do that. Does someone have idea's?? Regards, Erik
Wouldn't it actually be better to have separate handlers, so that you can tell which interrupts are triggering spuriously...?
all my unused interrupts call Icrash();
void Icrash(void) { U1 ICbit; #ifdef DEBUG ICbit = 1; #else ICbit = 0; #endif while ICbit; }
Hi and thanks for the anwers, Why don't you perform a MCU-reset in your IRS? This way all resisters are reset and restored and the bit that is the source of the interrupt is cleared. If I may ask, how does your code look that catches all unused interrupts? And how does it point to a single interrupt service routine? Regards, Erik
The STR71x has a vectored interrupt controller and it is up to the user to set the interrupt vectors of unused interrupts to some dummy routines. I do not see that this is something the tool vendor needs to take care of. Reinhard
Hi and thanks for the anwers, Why don't you perform a MCU-reset in your IRS? This way all resisters are reset and restored and the bit that is the source of the interrupt is cleared. If I may ask, how does your code look that catches all unused interrupts? And how does it point to a single interrupt service routine? Erik, it makes it a lot easier to answer when you, like this Erik put the question above the answer in italics. I have to guess ARGH! that your post is in reference to mine. 1) in the production mode erroneous interrupts are simply ignored, I have not had problems with that. Doing a reset there, would lead to all kinds if strange things. 2) in debug mode when Icrash catches an "unsolicited" interrupt just set ICbit to 0 in the ICE and step twice and you are in the return from the offending interrupt. All unused interrupts are, of course, coded like this void xxx (void) interrupt ... { call Icrash(): } ErikM
Ok! sorry, you say: "1) in the production mode erroneous interrupts are simply ignored, I have not had problems with that. Doing a reset there, would lead to all kinds if strange things." So, you say it is not possible that due to EMC events on the hardware interrupts are triggert random. Regards, Erik Z
So, you say it is not possible that due to EMC events on the hardware interrupts are triggert random. Not at all, I have actually seen it. However, if we are to get into all the nitty gritty details, this will become a 211 paragraph "lesson". If you do a processor reset on a "wild" interrupt that can lead to much worse effects than just ignoring it (It should not happen anyway). However, the "debug mode" does allow all "created" false interrupts to be caught. Erik