Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

ATMega16 remains "FF" after programming via AVR Studio & JTAG Ice-Cube

ATMega16 remains "FF" after programming via AVR Studio & JTAG Ice-Cube

2010-09-05 by Chuck Hackett

When I select "Build and Run" from the "Build" menu the build is successful and the
progress bar shows "loading program memory…" (and red led on Ice-Cube is flashing as
normal) then "loading event memory…" with no errors.  Message panel shows "Loaded
objectfile: …. RSS.elf" and no errors but, when I display "program memory" from
within AVR Studio all memory remains erased ("FF").

Configuration:

- AVR Studio 4.16 (I looked at newer version change logs but it apparently just
addresses newer Atmel processors and debugging devices)

- ATMega16L mounted in a development board (Olimex AVR-P40) with external 8.000 mhz
Xtal

- Loading and debugging via JTAG "Ice-Cube"

I have programmed and tested a different processor using the same setup (just
swapped processors in the development board) and they worked fine.

Unfortunately, the other processors that worked are now installed in devices that
are in the field being tested so I can't compare fuse settings, etc.

The fuse settings of the device I am trying to load are: 

(High=0x0B, Low=0xFF)

Checked:
	OCDEN, JTAGEN, SPIEN, CKOPT

Unchecked:
	EESAVE, BOOTRST, BODEN

Other:
	BOOTSZ = Size=512 words, Start=$1E00
	BODLEVEL = VCC=2.7v
	SUT_CKSEL = Ext. Xtal, High Freq., Stratup: 16k CK + 64 ms

I get the same results when I use the Connect dialog to program the device.

In all cases, the device resets but, when it runs the user LED on the board does not
light as it does with the other processors when my program runs.  This would seem to
confirm that memory is all "FF"s and the "view program memory" dialog is showing
correct data - i.e.: the ATMega16 did not program.

Whenever I stop the processor with AVR Studio, the program counter is at 0x00173E.

When I use the Memory dialog to alter "Data" (RAM) to 0 the light on the Ice-Cube
flashes and the content display shows 0 very briefly (only visible if I hold down 0
so that it repeats) but goes right back to "FF".

Any thoughts as to why it apparently will not program but AVR Studio does not report
a problem?

(BTW:  In the past I thought that I had seen the AVR Studio "progress bar" go
through a "verifying program memory..." after the "loading program memory…" but I
don't see it this time.  Is there a setting somewhere to cause AVR Studio to verify
after programming?  (I see a verify option under the "auto" tab on the "Connect"
dialog but this is apparently only in effect when you are using the "Connect" dialog
to program the device.)
 
Cheers,

Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck

RE: [AVR-Chat] ATMega16 remains "FF" after programming via AVR Studio & JTAG Ice-Cube

2010-09-07 by Chuck Hackett

> From: Chuck Hackett
> 
> When I select "Build and Run" from the "Build" menu the build is successful
> and the
> progress bar shows "loading program memory…" (and red led on Ice-Cube is
> flashing as
> normal) then "loading event memory…" with no errors.  Message panel shows
> "Loaded
> objectfile: …. RSS.elf" and no errors but, when I display "program memory"
> from
> within AVR Studio all memory remains erased ("FF").
> ....
> In all cases, the device resets but, when it runs the user LED on the board
> does not
> light as it does with the other processors when my program runs.  This would
> seem to
> confirm that memory is all "FF"s and the "view program memory" dialog is
> showing
> correct data - i.e.: the ATMega16 did not program.
> ....

I found the problem: When I programmed the fuses for internal clock, all was well.
Upon doing more investigation I found that the crystal must not have been making
good contact in its socket because after I re-seated it and retested with the
original fuse settings and all is well again ... mumble, mumble ...

So, Why can't AVR Studio/JTAG Ice-Cube tell that there is no clock and say
something?  It could have said something when I went to display memory instead of
telling me that memory was all 0xFF's ...

> (BTW:  In the past I thought that I had seen the AVR Studio "progress bar" go
> through a "verifying program memory..." after the "loading program memory…"
> but I
> don't see it this time.  Is there a setting somewhere to cause AVR Studio to
> verify
> after programming?  (I see a verify option under the "auto" tab on the
> "Connect"
> dialog but this is apparently only in effect when you are using the "Connect"
> dialog
> to program the device.)
 
I still have not figured out how to get it to verify when it programs via the "Build
and Run" command - or maybe it is and the compare was ok (I didn't see any messages
saying "verifying" ...

BTW: From this experience - I guess the ATMega16 can be programmed via JTAG even
when there is no clock present?

If so, why can't AVR Studio display memory correctly without a valid clock present?
 
Cheers,

Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck

Re: ATMega16 remains "FF" after programming via AVR Studio & JTAG Ice-Cube

2010-09-09 by ecros_technology

--- In AVR-Chat@yahoogroups.com, "Chuck Hackett" <egroupscdh@...> wrote:

> Why can't AVR Studio/JTAG Ice-Cube
> tell that there is no clock ...
> ... I guess the ATMega16 can be
> programmed via JTAG even when
> there is no clock present?

Atmel documents all this.  The JTAG programming interface has its own clock and can, indeed, work when there is no main clock.  Thus, you can rescue devices with mal-programmed clock fuses (one of the reasons that I personally prefer JTAG).  However, this doesn't work for debugging, which does require a main clock.  I would guess that verification is skipped because it would lengthen the code/compile/run cycle.  One could hope for the option, but I don't think its is there.

Graham.

RE: [AVR-Chat] Re: ATMega16 remains "FF" after programming via AVR Studio & JTAG Ice-Cube

2010-09-16 by Chuck Hackett

> From: ecros_technology
> 
> > Why can't AVR Studio/JTAG Ice-Cube
> > tell that there is no clock ...
> > ... I guess the ATMega16 can be
> > programmed via JTAG even when
> > there is no clock present?
> 
> Atmel documents all this.  The JTAG programming interface has its own clock
> and can, indeed, work when there is no main clock.  Thus, you can rescue
> devices with mal-programmed clock fuses (one of the reasons that I personally
> prefer JTAG).  However, this doesn't work for debugging, which does require a
> main clock.  I would guess that verification is skipped because it would
> lengthen the code/compile/run cycle.  One could hope for the option, but I
> don't think its is there.
> 
> Graham.

Hi Graham,

All true, my only complaint was that (assuming that it's possible) AVR Studio should
have said that it couldn't show me the contents of memory rather than showing me
incorrect data (all 'FF's) without an error message of any kind.  

(As a software developer of banking systems) this strikes me as bad design - If an
ATM can't access your bank balance should it tell you that your balance is
$999,999,999.99, $0.00? :-)
 
Cheers,

Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck

RE: [AVR-Chat] Re: ATMega16 remains "FF" after programming via AVR Studio & JTAG Ice-Cube

2010-09-16 by John Samperi

At 12:37 AM 17/09/2010, you wrote:
>should it tell you that your balance is $999,999,999.99,

No it should just spit out all the the money regardless so
one can grab as much as one can and ruuuuuuunnnnn.



Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

RE: [AVR-Chat] Re: ATMega16 remains "FF" after programming via AVR Studio & JTAG Ice-Cube

2010-09-16 by Chuck Hackett

> From: John Samperi
> 
> At 12:37 AM 17/09/2010, you wrote:
> >should it tell you that your balance is $999,999,999.99,
> 
> No it should just spit out all the the money regardless so
> one can grab as much as one can and ruuuuuuunnnnn.
> 
> Regards
> 
> John Samperi

John, -- I knew SOMEONE would not be able to resist that one :-)
 
Cheers,

Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.