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

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

[avr-gcc-list] Timer0 interrupt on Mega128


From: Jan Menzel
Subject: [avr-gcc-list] Timer0 interrupt on Mega128
Date: Mon, 20 Apr 2009 17:40:11 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

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




reply via email to

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