avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] How to handle interrupt vectors ?


From: Gre7g Luterman
Subject: Re: [avr-gcc-list] How to handle interrupt vectors ?
Date: Wed, 29 Oct 2008 10:26:10 -0700 (PDT)

> From: Charalampos Alexopoulos <address@hidden>
> To: address@hidden
> Sent: Wednesday, October 29, 2008 12:12:00 PM
> Subject: Re: [avr-gcc-list] How to handle interrupt vectors ?
>
> I was asking for information about interrupt vector's not for ISR. Yes i
> have seen the code for the ISR and i have no understanding of the
> mechanism because i don't know what that vector is. It is very obvious
> that foo::mumble is not working, thats why i am asking for help.
It sounds to me like the problem we're having here is communication, not so much a programming issue. I'm gonna' take a wild shot at this, so if I'm way off base, please don't scold me!
 
If your background is not programming AVR's, then you may be accustomed to keeping your interrupt vector list in RAM. In such a case, you would need your code to set a given vector so that interrupts are handled by the correct routine.
 
In AVRs, this vector table is kept in Flash. You don't actually call a function with a vector number to set anything. The compiler (OK, the linker actually) looks at your code and if it recognizes a familiarly-named function, then it puts that vector in the table. This is done at compile time, not at run time. You never actually call anything with a parameter indicating which vector.
 
So you may be talking interrupt vectors, but we're talking ISRs. You need to identify what happens when that vector is called, create a function to hold that code, and correctly name the function so that the compiler will handle it correctly. There is no way (short of doing a Flash write) to change an interrupt vector in your code.
 
... Let the flames begin. :)
 
Gre7g


reply via email to

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