|
From: | Michael Clift |
Subject: | Re: [avr-gcc-list] bug with timer0 interrupt? |
Date: | Tue, 19 Feb 2013 12:18:14 +1100 |
User-agent: | Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 |
On 2/15/2013 2:06 AM, Jonathan Geisler
wrote:
I'm encountering a strange error with avr-gcc 4.6.3 and 4.7.2 using the timer interrupt. The code I'm using is attached. As you can see, I was trying to tie in to the Arduino environment (with Eclipse) so that I could help my students wean off that set of functions to being able to use the hardware directly. When I set up the library, I encountered a strange error and was able to trace it back to this simple program that sets up the timer with a prescalar of 1024 and then increments an unsigned long counter when that timer overflows. When the counter reaches a specific value, I toggle the built-in LED on the Arduino board connected to PORTB. The strange behavior is that if I initialize the counter to 0, the code doesn't work--appearing to hang. If I initialize the counter to 1, everything works perfectly. I have verified that if I make a similar change to the Arduino libraries that the original code begins to work properly. I'm not sure what the exact error is since I can use the Arduino environment on my machine without a problem, but when I try to compile it through Eclipse it gives me this error. I'll include the build log as an attachment in case particular compiler/linker flags are triggering the error. -- Jonathan Geisler -- Hi Jonathan, Just a thought, maybe by removing the Arduino header, you are removing something which is needed to disable your watchdog timer. Read under 'Detailed description' in this link: http://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html --
|
[Prev in Thread] | Current Thread | [Next in Thread] |