[Top][All Lists]

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

[avr-gcc-list] bug with timer0 interrupt?

From: Jonathan Geisler
Subject: [avr-gcc-list] bug with timer0 interrupt?
Date: Thu, 14 Feb 2013 10:06:06 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

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 --

Attachment: main.cpp
Description: Text Data

Attachment: build.log
Description: Text document

Attachment: signature.asc
Description: Digital signature

reply via email to

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