[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Looking for a spurious interrupt

From: Trevor White
Subject: Re: [avr-gcc-list] Looking for a spurious interrupt
Date: Fri, 03 Sep 2004 11:38:34 +0100

When you say you have a spurious interrupt. I take it you have all the interrupts enabled for everything? Are you able to turn everything off and then start turning interrupts on one by one...

Another thought is could you use a register to identify what routine you were running when the interrupt occurs. For example

IDInterruptRegister = 0

int main(void)
   IDInterruptRegister = 1;
   IDInterruptRegister = 2;
   ..more code...
   IDInterruptRegister = 3;

Maybe this would enable you to gain focus on the part of the software where the interrupt is happening. Might not help with some interrupts but thought it might trigger something.


Bernard Fouché wrote:

Hi René.

I've thought of that, but it will generate one handler per signal and at the
moment I'm very tight in memory and, if possible, I would prefer to read a
particular register, if ever such a register presenting this information
exist. Otherwise I'll do something like you describe.

-----Message d'origine-----
De : René Liebscher [mailto:address@hidden
Envoyé : vendredi 3 septembre 2004 12:04
À : Bernard Fouché
Cc : address@hidden
Objet : Re: [avr-gcc-list] Looking for a spurious interrupt

Bernard Fouché wrote:

Using SIGNAL(__vector_default), I'm tracking a problematic unexpected
interrupt. How can I know what interrupt called SIGNAL(__vector_default)
from the body of the function that I define?

For instance:

        .. code to known what vector was activated ...
        .. code to store this information somewhere ...



I have no idea how to get the information which interrupt was called.
But you could create handlers for every possible interrupt.
Probably you want to use a script for the task.

For the Mega32 this could be done like the following.
(should be all in one  line)

cat /usr/avr/include/avr/iom32.h
| grep "#define SIG_"
| awk 'BEGIN{print "#include <avr/signal.h>";
             print "#define NUMBER_OF_VECTOR(x) x" };
      { printf("SIGNAL(%s){ save=NUMBER_OF%s; };\n",$2,$3); }'

Then you only have to delete the interrupts you use already in your
program. (and change the "save=" statement to what ever you like.)

Kind regards

avr-gcc-list mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]