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

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

Re: [avr-gcc-list] Spurious restarts on atmega128l


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

On Friday 13 July 2007 13:03:57 Juergen Harms wrote:
> I would also check for a watchdog reset (your 12 msec are close to the
> 15 msec period for the shortest watchdog reset) - try to disable the
> watchdog timer at the start of your program, see <avr/wdt.h> page of the
> avr-libc-user-manual. But I do not understand why there is a reset but
> no significant info in the copy of MCUCSR.

Yes, that was the clue I needed. I discovered I was looking in the wrong 
place. I was thinking that my fuse bit settings were correct -- and they 
were. However, the sequence in which the flash was being programmed and the 
bits set were causing some of the fuse bits to return to a default state. My 
make file was programming the flash (using avrdude) after setting the fuse 
bits. The reprogram of the flash triggered a chip erase by avrdude which set 
the fuses back to the default states. I also found that setting lfuse after 
hfuse can cause hfuse to have incorrect settings (0x20). Here's the order I 
determined works with avrdude:

1 flash
2 lfuse
3 hfuse
4 efuse

I have left the lock bits all ones and haven't experimented to determine the 
best time to set the lock bits. I'm assuming that the lock bits should be set 
before programming the flash but can't say one way or the other since I 
haven't tried that yet. In anycase, using the above sequence has produced a 
stable device.

Thanks for your help and the other suggestions I received.

Steve

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




reply via email to

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