Hi all!
I'm trying to generate interrupts using timer0 on a Mega128 but unfortunately can't see any change in overflow and capture/compare flags. This is the code I tried (compiled using WinAVR 20081205):

TCCR0 = _BV(CS02);

cli();
while (1)
{
        if (TIFR & _BV(OCF0))
        {
                DEBUG_PORT ^= _BV(DEBUG_PIN);
                TIFR |= _BV(OCF0);
        }
}

I tried the same with TOV0 flag without success. If I read the counter register TCNT0 I can see the counter counting from 0x00 to 0xff. I verified in the list file that all registers and bits are correct. Surprisingly the code works well if changed to timer2.
        Can anyone give me a hit why timer0 is not raising this flags in my 
code?

        Kind regards
                Jan


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to