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

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

Re: [avr-gcc-list] Issue with interrupt handler on Atmel Mega 8


From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] Issue with interrupt handler on Atmel Mega 8
Date: Wed, 02 Nov 2005 00:55:26 +0100

On Wed, 2005-11-02 at 00:03 +0100, Jerome Kerdreux wrote:

> > I'm trying to use the timer 0 on a mega 8.  Everything works fine, 
> > (I mean, i can see the timer TCNT0 incrementing) but when I want 
> > to route the interrupt to an handler, I get a infinite reset. 

I think that's normal. You forgot to include <avr/signals.h>, so the
"SIG_OVERFLOW0" name was unknown at compile time, and as stated in the
avr-libc documentation, this does not generate a warning and simply
defaults the ISR to the bad interrupt vector, which by default generates
a reset. In the code of your ISR, you put a "return 0" (why?), so the
"reti" instruction that the compiler generated, never gets executed,
hence the interrupt flag doesn't get cleared, therefore it instantly
executes the ISR egain, hence a reset, and so on, forever.

Why did you put a "return" in your ISR ? Am I missing something very
subtle ???


HTH,


--
Vince





reply via email to

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