JTAGICE mkII with ATMega644

Go To Last Post
42 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is the fastest way to program an ATMega644 using the JTAGICE mkII? I have been successfully programming with JTAG interface on a custom board I've developed... but it takes a really long time (i.e. a couple minutes) to download the program. Is there a faster way to go about this? I have a finished board design & about 100 boards I want to load the program onto... and just didn't want to sit throgh that wait time on each one... or is there just no other way? I have never even figured out how to get my JTAGICE mkII to work with USB only... after following all of the instructions regarding the USB installation procedure. I have to have both serial (RS232) cable & USB cable connected for the JTAG programming to work. I only bring that up in case that has anything to do with why it takes so long? Also, is there any way to setup AVRStudio to automatically program everything you want... from fuse settings, flash, eeprom all in one click? I saw the "auto" panel under the "program avr" menu, but it wouldn't do anything for me. It just gave me some error that it couldn't find the right file or something? Is there any material available that explains how to do any of this?

Thanks,
James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A couple of minutes, even for 64K, is an unusually long time - something is clearly wrong somewhere.

As for "do everything" programming. That's probably easiest achieved using the command line .exe for jtagiceII and invoke it a number of times from a .bat file.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well my program is kinda long... it almost completely fills up the 64k of memory plus the eeprom is almost completely filled up as well... and then the time it takes to set the fuses, etc... all that I meant takes a couple of minutes total.

I'll read up on the command line method... so that can actually set fusese, program, and everything all in one? Are there any template scripts available anywhere to download that you know of?

Thanks,
James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can make an .elf file in AVR studio, or save one from a programmed chip. Then you can program everything including fuses with one click.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

how do you do that??? I see elf files in my program's directory... but was never sure how they got there or what to do with them...

- James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you have the programmer connected you can click the "Save" button in the Elf Production File section of the programming dialog box. Not sure what else is needed in a makefile, but the final lines in the contiki raven webserver make are

avr-objcopy -0 ihex -R .eeprom webserver6.elf webserver6.hex
avr-size -C webserver6.elf
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Make sure your jtag is set for the highest legal clock rate. If it's set for a 1MHz cpu, that could be dragging you down.

Otherwise, write smaller code :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jdowns wrote:
Well my program is kinda long... it almost completely fills up the 64k of memory plus the eeprom is almost completely filled up as well... and then the time it takes to set the fuses, etc... all that I meant takes a couple of minutes total.
I am programming well over twice that for my ATmega2560 (~160K) and it happens in seconds. Well, maybe a dozen or so, but definitely not minutes!

I am also using a JTAGICE mkII. CPU is running at 14.756 MHz and JTAG is running at... well whatever JTAG runs at. I can find no setting for it in the AVR Studio programming page.

I am curious why you need the serial cable attached to the JTAGICE mkII - I never need it. In fact, the JTAGICE pod gets its power from the USB cable, so there's only one cable attached. If the PC side thinks that it can only talk through serial, that would definitely slow you down!!

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well... I tried increasing the JTAG speed from 1Mhz to 2Mhz and it didn't seem to go any faster. I'm not sure why I have to have both the serial & USB connected for it to work... that has just always been the case with my setup (Dell D800 laptop, JTAGICE mkII) I have spent many hours following all instructions re-installing AVRStudio, and performing the USB driver update with AVRStudio not connected, etc... and it always completes successfully, however, I can simply not connect unless I have the both the serial cable & USB connected for some reason... With the USB connected only, it just times out eventually saying nothing was found on USB or COM ports, etc...

- James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I tried increasing the JTAG speed from 1Mhz to 2Mhz
That is only for debugging not programming AFAIK.

Can your laptop supply the necessary 500mA to the JTAG ICE? Many do not and need to be powered via a self powered hub.

And DO NOT connect both the serial and USB, use a separate supply if you want to go serial only (with it's speed limitation).

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well... every time I write a long msg into here lately the whole website just hangs up...

I was just gonna say I managed to get my company laptop to work programming it with USB, but for some reason, my personal laptop will only do it with serial connection.

Also, dak664, I tried following your suggestion doing a "Save" in the Elf Production menu & over-wrote the main.elf created by WinAVR/GCC, and it all worked nicely for re-programming as many boards as I like after that with Flash, EEPROM, Fuse Bits, & Lock Bits, except that when I shutdown AVRStudio, save the project on exit, and then re-open it, it will no longer load the program. It looks like it loads the flash okay, but then it gives some error after that that it couldn't load the object file... I noticed that if I do a "make clean" and "make all" from WinAVR/GCC, my AVRStudio will load the program fine again from startup. But then I have lost the ability to hit the "program" button and have fuse bits and lock bits set at that point. Any ideas why this is happening?

Thanks,
James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The .elf file contains (or can contain) all the file references so you can debug with source code just by opening it alone. I suspect overwriting the compiled version messed up the links somehow. What if you create it with a different name? You can also run two instances of AVR studio, one for compilation and one for the .elf file.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
my personal laptop will only do it with serial connection.
Quote:
Can your laptop supply the necessary 500mA to the JTAG ICE? Many do not and need to be powered via a self powered hub.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not sure how much current it can supply... but I know that it all works on my personal laptop (Dell D800) when I have both the serial & usb plugged in... where I guess the usb is giving it power & it's using the serial cable for the communication. Could this work if it wasn't supplying enough current? The big thing I noticed that was different between my personal laptop & my new work laptop was that after installtion of AVRStudio, on my work laptop (an HP notebook), a little message popped up saying, "New hardware found... JTAGICE mkII... It is now configured to work on your computer." But on my personal laptop, nothing ever pops up... it just simply won't recognize the device at all when I plug it into any one of the 3 USB ports. I have tried going into "Device Manager" and on each USB selected "update driver", and this has not helped... Both laptops are running with Windows XP Pro so I'm not really sure why one would recognize it but the other not.

James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

p.s. And by the way, I have performed a complete un-install of AVRStudio on my personal laptop, manually deleted all remaining AVRStudio files & related lines from the registry (per Atmel's instructions if you cannot get USB to recognize the JTAGICE mkII) before re-installing AVRStudio + USB Driver Update... and none of this helped the situation at all.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jdowns wrote:
p.s. And by the way, I have performed a complete un-install of AVRStudio on my personal laptop, manually deleted all remaining AVRStudio files & related lines from the registry (per Atmel's instructions if you cannot get USB to recognize the JTAGICE mkII) before re-installing AVRStudio + USB Driver Update... and none of this helped the situation at all.
As I recall, the current AVR Studio still asks if you want to install the USB driver. Have you done this?

Your D800 is a relatively recent laptop -- I've run the JTAG on much older Dell laptops with no problem.

Make sure the USB drive is installed.

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"before re-installing AVRStudio + USB Driver Update..." - yes, nothing seems to work

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you create a new project in AVRStudio by opening an existing object file... are you supposed to select the .ELF file or the .HEX file? It displays either file type for you to select so I was just wondering which was appropriate. I've been using the .ELF file. And if you can load either, what is the difference? I wish there was any good explanation of all this anywhere... it all seems to just be passed down by word of mouth... ;)

James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

it all seems to just be passed down by word of mouth...

The use of the GCC plugin in Studio is fully explained in the user manual. Under "AVR Studio" look at "Project" and under that "AVR GCC Project"

I'd suggest you start at "Getting Started - Creating a New Project"

The point being that you don't really need to bother with opening either .ELF or .HEX but, instead, build the project inside Studio and then it will open the .elf for debugging when requested.

If you INSIST on building outside of Studio then it's far better to open the ELF rather than the HEX as that way you will get symbolic debug.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Cliff, thank you very much for that info...

- James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I created a new project in AVRStudio & did my first successful build from there of my code!!! I like this much better not having to go back & forth between programmer's notepad already...

I have a question though... while experimenting with the "ELF Production File" section trying to see if I could repeatedly hit the "Program" button on multiple boards, I have permanently lost communication now with two of my boards and not sure why. I have so many versions of my project now in different directories (one that I was using programmer's notepad with, another that I am now using with AVRStudio, etc...) and think that during one of my "Program" experiments from the ELF Production menu it may have been pointing to the ELF in the wrong directory... the one from Programmer's Notepad. I'm guessing that somehow the JTAG fuse got disabled during one of these programs, even though I have never unchecked that box since that is the only way I am setup to program my boards. Is it possible that programming with the wrong ELF file (i.e. using HEX file from the correct directory, but ELF from the wrong directory), could this result in inadvertantly disabling the JTAG fuse? I have used the "Program" button lots of times now successfully, but am just not sure what I did wrong the two times I've permanently lost communication with my two boards, and don't wanna make that mistake again. Unfortunately I'm just not sure what the mistake even was? When you're selecting files in the "ELF Production File" menu & it asks for the HEX file first, but then for the EEPROM it lets you select either a .hex or .eep file. I assume I'm supposed to pick the .eep file, but wonder why it would also be showing the .hex files as well?

Thanks,
James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wait, let me ask a more specific question... I could simply just do this & find out for myself I guess... but I really don't wanna permanently lose communication with another one of my boards. If I use Programmer's Notepad / WinAVR / GCC to compile my code, and then simply do a "Program" using the .ELF file it generated... will that set fuses to disable the JTAG interface? Because that seems to be what happened. It was only when I explicitly "Saved" the ELF file first from AVRStudio and THEN did the Program that it all worked successfully.

And one more question, on the "Auto" menu where you can select various things you want performed, what is the difference between a "Read" and a "Verify"? The documentation mentions that a typical procedure would be to perform a "Program" and "Verify" but does not address the purpose of the "Read". What does the read actually do? Does it literally read the program from the chip and display it as code in AVRStudio?

Thanks,
James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is there any way to recover communication with the AVR using the JTAGICE mkII assuming I have inadvertantly disabled the JTAG fuses? I only have access to the JTAG lines, however, not ISP... It sounds like the mkII cannot do the high voltage programming... Can I just apply 12V to the reset pin to erase the chip?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can use the JTAG as an ISP but it will involve wiring up the correct set of wires. (HVPP is NOT as simple as just applying 12V to reset - it's a completely different protocol and can almost never be done "in circuit")

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I was using the "ELF Production File" option successfully, I first programmed my chip for debugging, then exited debugging & connected to set the fuses & lockbits, then did a "Save" in the "ELF Production File" menu, & was then able to use "Program" on several chips after that & everything seemed to work just fine. But in the cases where I have lost communication, I think what I did was, after bringing up AVRStudio, went straight to the "ELF Production File" menu & clicked "Program", and afterwards noticed that the ELF file entered in the input file edit field was pointing to to an ELF in the wrong directory... one generated from just doing a build in AVR Gcc. Would the ELF generated by AVR Gcc call for fuses that disable JTAG? Is there any way to view an ELF file as far as what type of fuses & lockbits it will set?

Thanks,
James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Either use the menus in Studio to program the fuses by hand and .hex for the program CODE or learn to use GCC's support and ELF files. Don't try to mix one or the other.

Also don't expect Studio to necssasrily link the .hex file in the programming dialog to the project that is loaded. ALWAYS ensure you have the right .hex selected before programming

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cliff, sorry to keep asking all these questions, but the User's Manuals all seem to be very careful not to offer too much information... so as to make things all clear to the reader. In AVRStudio's program menu, what type of file do you enter for the EEPROM file? It tells you to enter the HEX file here, but when you browse for the file, it lists *.eep as well as *.hex files here. I have been selecting the .eep file for this rather than the .hex... Is this correct?

Thanks,
James

p.s. Thanks for the info on ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

.eep and .hex are BOTH Intel hex files. It's just that both the Atmel assembler and the GCC toolchain choose to give the one destined for EEPROM the .eep extension. If you are using GCC then you can completely ignore anything to do with .eep until you use and EEMEM to place some initialised data into EEPROM. In that case a valid .eep will be generated and when it comes to programming the AVR you will want to program project_name.hex into the code flash and project_name.eep into the EEPROM.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes. An eeprom file looks just the same as a regular hex file. The convention is to name the eeprom file "project.eep" and the flash file "project.hex".

Seeing as how you are using avr-gcc you have all the proper Unix utilities. e.g.

cat file // send a regular ascii file to stdout
od  file // octal dump a binary file to stdout
wc  file // word count an ascii file
diff file1 file2 // display the differences between files
egrep pattern files...
...

If in doubt about the format of a file, you can always:

od -x file | more  // hex dump the file by the page

So a lot of things you can investigate by yourself.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cliff, I was just reading the limited documentation on and it occurs to me that the capability of AVRStudio's "Program" button from an ELF file still allows more, in that it automatically sets both fuses & lockbits after loading & verifying the program. The only way to do this, it looks like, however is to over-write the ELF generated during the compile process? Am I missing something?

- James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks David... I'm actually running on Windows XP though... not UNIX, so I don't think I will be able to use those commands.

- James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

not UNIX, so I don't think I will be able to use those commands.

Au contraire - part of your WinAVR installation (which also adds this to your PATH) is:

 Directory of C:\WinAVR-20090313\utils\bin

04/05/2009  14:20              .
04/05/2009  14:20              ..
14/03/2009  04:26             5,632 ansi2knr.exe
14/03/2009  04:26            18,432 basename.exe
14/03/2009  04:26            52,736 bc.exe
14/03/2009  04:26           109,568 bison.exe
14/03/2009  04:26             6,811 bison.hairy
14/03/2009  04:26            19,933 bison.simple
14/03/2009  04:26            67,072 bunzip2.exe
14/03/2009  04:26            67,072 bzcat.exe
14/03/2009  04:26            67,072 bzip2.exe
14/03/2009  04:26            22,528 cat.exe
14/03/2009  04:26            23,552 chgrp.exe
14/03/2009  04:26            28,160 chmod.exe
14/03/2009  04:26            23,040 chown.exe
14/03/2009  04:26            19,968 cksum.exe
14/03/2009  04:26            11,264 cmp.exe
14/03/2009  04:26            21,504 comm.exe
14/03/2009  04:26            13,312 compress.exe
14/03/2009  04:26            74,240 cp.exe
14/03/2009  04:26            65,024 csplit.exe
14/03/2009  04:26            24,064 cut.exe
14/03/2009  04:26            47,616 date.exe
14/03/2009  04:26            25,600 dc.exe
14/03/2009  04:26            32,256 dd.exe
14/03/2009  04:26            25,600 df.exe
14/03/2009  04:26            68,608 diff.exe
14/03/2009  04:26            17,920 diff3.exe
14/03/2009  04:26            27,648 dircolors.exe
14/03/2009  04:26            17,920 dirname.exe
14/03/2009  04:26            25,600 du.exe
14/03/2009  04:26             7,680 echo.exe
14/03/2009  04:26            82,944 egrep.exe
14/03/2009  04:26            18,944 env.exe
14/03/2009  04:26            20,992 expand.exe
14/03/2009  04:26            49,152 expr.exe
14/03/2009  04:26            18,432 factor.exe
14/03/2009  04:26            12,288 false.exe
14/03/2009  04:26            82,944 fgrep.exe
14/03/2009  04:26            52,224 find.exe
14/03/2009  04:26           165,376 flex.exe
14/03/2009  04:26             1,170 flex.lib
14/03/2009  04:26            24,064 fmt.exe
14/03/2009  04:26            21,504 fold.exe
14/03/2009  04:26            53,248 fromdos.exe
14/03/2009  04:26             5,632 fsplit.exe
14/03/2009  04:26           149,504 gawk.exe
14/03/2009  04:26             7,680 gclip.exe
14/03/2009  04:26             4,608 gplay.exe
14/03/2009  04:26            81,408 grep.exe
14/03/2009  04:26            14,848 gsar.exe
14/03/2009  04:26            49,152 gunzip.exe
14/03/2009  04:26            46,592 gzip.exe
14/03/2009  04:26            26,624 head.exe
14/03/2009  04:26            21,504 id.exe
14/03/2009  04:26            55,296 indent.exe
14/03/2009  04:26           163,840 info.exe
14/03/2009  04:26            33,280 infokey.exe
14/03/2009  04:26            41,472 install-info.exe
14/03/2009  04:26            77,824 install.exe
14/03/2009  04:26            27,136 join.exe
14/03/2009  04:26            49,152 jwhois.exe
14/03/2009  04:26            99,328 less.exe
14/03/2009  04:26            72,704 ln.exe
14/03/2009  04:26             7,680 logname.exe
14/03/2009  04:26            69,632 ls.exe
14/03/2009  04:26            81,920 m4.exe
14/03/2009  04:26           166,400 make.exe
14/03/2009  04:26           153,600 make.exe.old
14/03/2009  04:26           180,224 makeinfo.exe
14/03/2009  04:26             5,632 makemsg.exe
14/03/2009  04:26            38,400 man.exe
14/03/2009  04:26            27,648 md5sum.exe
14/03/2009  04:26            28,672 mkdir.exe
14/03/2009  04:26            13,824 mkfifo.exe
14/03/2009  04:26            20,992 mknod.exe
14/03/2009  04:26             9,728 mount.exe
14/03/2009  04:26            81,408 mv.exe
14/03/2009  04:26            20,480 mvdir.exe
14/03/2009  04:26            51,712 nl.exe
14/03/2009  04:26            36,864 od.exe
14/03/2009  04:26            20,992 paste.exe
14/03/2009  04:26            57,344 patch.exe
14/03/2009  04:26            10,240 pathchk.exe
14/03/2009  04:26             7,680 pclip.exe
14/03/2009  04:26            37,376 pr.exe
14/03/2009  04:26             7,168 printenv.exe
14/03/2009  04:26            12,800 printf.exe
14/03/2009  04:26            10,752 ps.exe
14/03/2009  04:26             2,048 pwd.exe
14/03/2009  04:26            62,464 rm.exe
14/03/2009  04:26           136,704 rman.exe
14/03/2009  04:26            22,528 rmdir.exe
14/03/2009  04:26            19,968 sdiff.exe
14/03/2009  04:26            48,128 sed.exe
14/03/2009  04:26            18,432 seq.exe
14/03/2009  04:26           476,672 sh.exe
14/03/2009  04:26            34,816 shar.exe
14/03/2009  04:26            18,432 sleep.exe
14/03/2009  04:27            39,936 sort.exe
14/03/2009  04:27            23,552 split.exe
14/03/2009  04:27            12,800 stego.exe
14/03/2009  04:27            12,800 su.exe
14/03/2009  04:27            19,456 sum.exe
14/03/2009  04:27            18,944 sync.exe
14/03/2009  04:27            49,664 tac.exe
14/03/2009  04:27            35,840 tail.exe
14/03/2009  04:27           158,208 tar.exe
14/03/2009  04:27            19,456 tee.exe
14/03/2009  04:27            17,408 test.exe
14/03/2009  04:27            29,184 texindex.exe
14/03/2009  04:27            53,248 todos.exe
14/03/2009  04:27            38,400 touch.exe
14/03/2009  04:27            33,280 tr.exe
14/03/2009  04:27            12,288 true.exe
14/03/2009  04:27             3,072 type.exe
14/03/2009  04:27            18,944 uname.exe
14/03/2009  04:27            20,992 unexpand.exe
14/03/2009  04:27            24,576 uniq.exe
14/03/2009  04:27            10,752 unshar.exe
14/03/2009  04:27             9,728 uudecode.exe
14/03/2009  04:27             9,216 uuencode.exe
14/03/2009  04:27            32,256 wc.exe

More Unix utilities than you can shake a stick at! (though what kind of masochist actually uses od.exe?)

(there are a few beyond w*.exe above but the forum bug won't allow the entire list to be posted)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cliff, thanks.... Can you also read my post right before that last one regarding Saving the ELF file from AVRStudio. It just seems to me that the only way to get the functionality of that GUI, i.e. programming the hex files as well as setting fuses AND lockbits, is by Saving the ELF from that menu selection & thus over-writing the ELF produced by WinAVR Gcc. And if you do that, then it seems that setting up the fuses using is almost irrelevant? I will still try to learn it to have the correct defaults setup, in general... but you have me wondering now whether I should never over-write the ELF from AVRStudio like that again? Yet, without doing that I wouldn't get the full functionality of automatically setting fuses and lockbits...

- James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As far as I know there's only ONE way to get fuse settings into an ELF and that's to build it with the avr-gcc toolchain and use

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, read this from the AVRStudio help documentation under "Programming Dialog / Program Tab"... it sounds like this method will put Fuse & Lock bits in the ELF file from the GUI within AVRStudio...

- James

Quote:
ELF Production File Format
The production file format can hold the contents of both FLASH and EEPROM as well as the fuse- and lock bit configuration in one single file. The format is based on the Executable and Linkable Format (ELF).

Prior to creating the ELF file, the FLASH and EEPROM contents must be specified and the fuses and lockbits must be configured. Specify the FLASH and EEPROM input HEX files on the Program tab. Then go to the fuse tab and specify the wanted fuse bit configuration. Do the same on the lock bits tab. Back on the Program tab, press the "Save to ELF" button" go generate the ELF file.

The generated ELF file can be specified as input to the programming dialog so that all contents of the file is programmed in one operation. Specify the file name in the 'Input ELF File' edit box or browse for the file, then press 'Program'.

The ELF file can also be used as input to the command line tool for STK600. Command line tools for other platforms will have be supported in the future.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

By the way... I'm starting to think I lost communication with two of my boards by using the "Auto tab" from the Programming Dialogue. The documentation for this is very limited & does not clearly state where the fuse bit & lock bit info comes from it programs your chip with... whereas, the documentation for the "Program tab" is much more detailed and tells you exactly what to do step by step. I think I hit the Start button in the "Auto tab" without first setting up the Fuse & Lock bits and had it program my board followed by disabling all fuses & lock bits since they were never setup first. I just assumed since I would have ~never~ unchecked the "JTAG Enable" or "ISP Enable", etc... I did not even have to worry about that... but I'm starting to think what may have happened is that if you open up the Programming Dialogue, and never even click on the Fuse tab or Lock bits tab that they may start out with everything unchecked (until you click on that tab & it reads the actual settings)... but by just opening up the Programming Dialogue & going straight to the "Auto tab" and clicking Start... may have programmed my chips with all fuses un-checked as a result? I'm still not sure... as the documentation is not very detailed on the use of this tab. Unfortunately, I didn't have the "Log to File" option checked or I'd be able to see for sure if that's what happened... oh well. Does anyone have any thoughts as to whether this sounds plausible? I just wanna make sure to not make the same mistake again... but am not 100% sure how it happened... I was thinking it was in the "Program tab" using the Program ELF, but I'm now thinking it may have actually been the mis-use of the Auto tab... i.e. clicking Start without first clicking on the Fuse & Lockbits tabs for it to read in those settings...

- James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm pretty sure that's exactly what I did the more I experiment with AVRStudio... I will ~never~ use that "Auto tab" window again... I had assumed it would program my flash, eeprom, fuse bits, and lock bits the way that I wanted them when I hit "Start"... i.e. how they were saved in the ELF file the way the "Program" button does in the "Program tab"... but it instead uses the Fuses & Lockbits as they currently show in the GUI... yet, if you have not explicitly clicked on those panes for it to read your fuse & lockbits to populate the checkboxes, they are all taken as un-checked... and when you click "Start" it programs your flash, eeprom, and then sets all your fuses to un-checked disabling JTAG, ISP, etc... Lesson learned... Do not EVER hit the "Start" button in the "Auto tab" menu without FIRST clicking into the Fuse tab and Lockbits tab for AVRStudio to read from your chip & populate the checkboxes with the appropriate settings... otherwise it will just use the un-initialized checkboxes - all un-checked - and disable your JTAG & ISP programming capabilities. Would've been nice if this was clearly explained in the documentation... but, whatever... I know now...

- James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cliff, do you agree that using the AVRStudio GUI will also put those settings into the ELF file? Or is there still something I'm missing? Is their file a different type of ELF file? Anyway, I'm really enjoying programming, compiling, & debugging all from within AVRStudio now... I have always been using Programmer's Notepad up to now... AVRStudio is so much more enjoyable. Thanks for advising me to make that switch.

- James

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Cliff, do you agree that using the AVRStudio GUI will also put those settings into the ELF file?

Haven't a clue - never used it or seen the need to use it. What does the manual say? In fact, personally I don't even see much point in either except that I suppose it binds the fuse setting documentation into the app.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well according to the manual, it will... the only problem is that any time you re-compile the .elf no longer contains the fuse or lockbit settings... so you have to go into that GUI & over-write the file all over again.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

the only problem is that any time you re-compile the .elf no longer contains the fuse or lockbit settings

which is, presumably, where enters the picture?

But, tell me, WHY do you need the fuse setting embedded in the ELF? Until was (very) recently added to GCC this facility simply didn't exist and the world and their wife have been providing separate project.hex, project.eep and fuse programming instructions to the organisations planning to program their chips for them. I can't help thinking the only reason for the recent addition has been because PIC have been embedding it for years and some folks who've seen the light and moved to Atmel have asked "could we have something like that?". For the factory programming thing what most folks have done previously is to put together a batch file that invokes the command line Atmel tools (so that Studio does not need to be installed) and that batch file just works through in turn doing all the various programming steps. The operator then just clicks an icon to launch the batch file.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
But, tell me, WHY do you need the fuse setting embedded in the ELF?
I just thought it was neat that with one click you could load the hex, eep, fuses & lockbits that way... and I don't know how to write a batch file to do the same thing so... I had just never known you could do that before.

- James