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

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

[avr-gcc-list] assembly-c mix and interrupts


From: darkschine
Subject: [avr-gcc-list] assembly-c mix and interrupts
Date: Thu, 19 Nov 2009 05:08:45 -0800 (PST)

Before I continue, I would like to suggest a resolution to my problem. I am
using the ATmega328P
My assembly code follows a standard that ALL registers used are pushed and
popped from the stack. However, my assembly code does NOT store the SREG.
Could this be causing my problems?

I am coming across a problem in a fairly large project where the system
seems to display incorrect data on the LCD screen and eventually reset
itself. Other symptoms include displaying incorrect data when string
constants are transfered to the LCD. The worst case of the problem has been
uninitiated transfer to a part in the program requiring text input from the
user. The text input also automatically accepts the character selected first
by default.

The problem has proved very difficult to debug since modifying the code can
cause unpredictable behaviour of the error.

I believe that the problem first appeared as a global variable changing its
value for no reason. The problem was corrected by declaring the global
variable as static which I then considered to be the standard, but am now
thinking it only masked the problem by storing the variable in a different
location or modifying the compilation structure.

Now, all functions seem to be operating correctly and all unit tests pass,
until interrupt routines are enabled.

Can anyone provide any insight into this problem or provide some debugging
techniques to help identify it?
-- 
View this message in context: 
http://old.nabble.com/assembly-c-mix-and-interrupts-tp26421328p26421328.html
Sent from the AVR - gcc mailing list archive at Nabble.com.





reply via email to

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