[Top][All Lists]

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

Re: [avr-chat] mega644 resetting continuously

From: Danilo Uccelli
Subject: Re: [avr-chat] mega644 resetting continuously
Date: Mon, 19 Jun 2006 09:15:16 +0200

2006/6/19, Steve Franks <address@hidden>:
Ah, welcome to another in my file of insane bugs.  It's not pressing,
becuase when running a debug session with a JtagIceII, the problem goes
away, so I can develop from a debug session.  Non-optimum, of course.

Anyone ever have a mega644 that resets constantly?  Details follow:

1) With WinAvr200601xx, it would happen with an 'empty' program, that just
turned on an led ( i.e. main() { DDRC = 0x01; PORTC = 0x01; while(1) {} } )

2) Installed WinAvr200604xx(latest), suddenly that started working fine, so
I put my serial port code back in which worked fine for the first 2 puts(),
then started reseting again in the !middle! of the second puts()

3) MCUCSR shows 0, so it must be a bug, not Hw, right?  I sure thought it
was a runaway watchdog for a long time the way the cpu reset in the middle
of a puts (and yes, it's a 20 char string in a 128 byte buffer, so it's not
that).  Also "WDT always on" fuse shows blank in avrstudio

4) call cli() from .init3, and have a default interrupt handler that just
returns (verified in .lst file).  Uart code is polled and is used in several
projects without error.

5) Optimization off. -O0 (-Os same behavior, just gets further through the
line before resetting)

6) I also do some spi between the two puts(), but I can see that
communication works perfectly in the debugger, and I get the expected result
from the second puts() (doing an spi tx to a device, of AA, then readback,
then 55, then readback, and if match, print one thing, no match print
something else).

7) prog size is under 4000 in a mega644

8) Single stepping in avrstudio, entire program will execute, including the
part where it's supposed to remain indefinately in the while(1) loop at the
end.  The second you F5 (run), it starts resetting again, until you do the
"reset" command from the debug menu.

Maybe someone's been here before...;)  At least I don't have any deadlines
for this (hobby project this time around).


I don't know the Atmega644, but with Atmega64, something like this
occur when the flag Atmega103 compatibility is set.
And this one is set by default when the chip is shipped by Atmel.


Danilo Uccelli
CH-2400 Le Locle

reply via email to

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