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

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

Re: [avr-gcc-list] AVR-GCC help


From: E. Weddington
Subject: Re: [avr-gcc-list] AVR-GCC help
Date: Thu, 29 Jan 2004 17:26:22 -0700

On 29 Jan 2004 at 15:53, ks_347 wrote:

> Hello,
> 
> I have declared an interrupt routine in my program using
> INTERRUPT(SIG_UART0_DATA). When I was looking at the disassembler code using
> AVRSTUDIO, in the interrupt vector table on the location 0x02A, there was no
> proper address of my interrupt routine.My understanding is that the avr-gcc
> compiler should take care of the address of this routine internally. Due to 
> this
> what is happening is everytime it receives an interrupt, it will go to address
> 0x02A and there it only finds out the default address, which will transfer the
> program control to the reset address, so my program is in infinite loop. Any
> suggestions or idea on whats going on here? I hope I am describing this well, 
> so
> that you people can understand. I have included all the files and my program 
> is
> compiled fine. 
> 

Re-read the "Interrupts and Signals" section in the avr-libc user manual:

Note: 
The SIGNAL() and INTERRUPT() macros currently cannot spell-check the argument 
passed to them. Thus, by misspelling one of the names below in a call to 
SIGNAL() or INTERRUPT(), a function will be created that, while possibly being 
usable as an interrupt function, is not actually wired into the interrupt 
vector table. No warning will be given about this situation.

Make sure that the name matches those available to your specific AVR part. You 
might have to look in the part's header file to see which names are available 
for your part.

Also you might want to re-read this in the docs as well:

INTERRUPT()
"Introduces an interrupt handler function that runs with global interrupts 
initially enabled. This allows interrupt handlers to be interrupted."

SIGNAL()
"Introduces an interrupt handler function that runs with global interrupts 
initially disabled. "

So you might want to use SIGNAL on a UART Interrupt Service Routine. The reason 
why, is left as an exercise for the poster. :)






reply via email to

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