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 _______________________________________________ AVR-GCC-list mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
