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

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

[avr-gcc-list] Spurious restarts on atmega128l


From: edSteve
Subject: [avr-gcc-list] Spurious restarts on atmega128l
Date: Fri, 13 Jul 2007 11:07:18 -0700
User-agent: KMail/1.9.6

I've encountered a problem that I do not understand. Perhaps someone can help 
me out.

The problem is the atmega128l is restarting. I've created code that hangs in a 
loop and the restart still occurs. The reset status register (MCUCSR) offers 
no clue. If I write a null to the register it remains null after a restart.

I'm developing this for a custom board but have duplicated the problem on an 
stk300 development board with an atmega128l daughter board. I use the stk300 
LEDs to display the reset status register (MCUCSR).

Here's the essence of the code that is restarting:

DDRB = 0xFF;
PORTB = ~(MCUCSR | 0x40); // displays PORF and EXTRF on power on. The 0x40 is 
to show activity.

MCUCSR = 0; // Clear reset status. No reset status after this point.

while (1);    // Loop forever (disassembly shows "rjmp  .-2"). The restart 
occurs while in this loop.

The stk300 led corresponding to ~0x40 blinks and stays on for approximately 
12mS (according to my o-scope).


The fuses are:
  lfuse = 0xE0
  hfuse = 0x9C
  efuse = 0xFF
  lock  = 0xFF


gcc specifics are:

$ avr-gcc -v
Using built-in specs.
Target: avr
Configured 
with: ../build-tree/gcc-4.1.0/configure -v --enable-languages=c,c++ 
--prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-shared 
--with-system-zlib --enable-long-long --enable-nls --without-included-gettext 
--disable-checking --disable-libssp --build=i486-linux-gnu 
--host=i486-linux-gnu --target=avr
Thread model: single
gcc version 4.1.0


Any help is appreciated.

Steve

btw: I may have posted on the wrong list. Feel free to redirect me. For some 
reason I'm unable to post on avrfreaks (I have an account but the browser 
hangs when I submit).

-- 
---------
Steve Isaacs
Embedded Domain




reply via email to

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