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

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

Re: [avr-gcc-list] Timer Interrupt Problem on ATmega 103L


From: René Liebscher
Subject: Re: [avr-gcc-list] Timer Interrupt Problem on ATmega 103L
Date: Fri, 28 May 2004 11:45:21 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.6) Gecko/20040114

Matthew Arcus schrieb:
----- Original Message ----- From: "'Andrew McNabb'" <address@hidden>
To: "Rune Christensen" <address@hidden>
Cc: <address@hidden>
Sent: Thursday, May 27, 2004 10:55 PM
Subject: Re: [avr-gcc-list] Timer Interrupt Problem on ATmega 103L



However when I add something to my while loop that polls TCNT0 to check
"manually" whether there's been an overflow, the behavior depends on
whether or not I've set TOIE0 in TIMSK.


A bit of a long shot - are you definitely compiling for ATmega 103L so you
are getting the right value for TOIE0 (it's bit 0 on the mega103L, but is
bit 1 on some (earlier?) processors (the 2313 for example).

Matthew.

If TOIE0 is not set, everything
works properly and the lights flip on and off every second.  However if
TOIE0 is set, the lights on PORTB all turn on and stay on.  But if the
while loop is empty, the lights stay off.

Even if it is the same bit, it could be the wrong vector number for the signal handler. This would result in a reset if the timer overflows. Then you get the result which is mentioned above. Lights are switched on, timer overflows => RESET, lights switched off for very short period of time until they are switched on again in the while loop.


Rene


reply via email to

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