I am having a nightmarish time with AVR Studio and JTAGICE mkII

Greetings:

I am helping a friend with a small battery charger project. I chose the Atmega88 for this project because it has a good mix of peripherals, memory size and physical size.

I am using Winavr 4.11 to develop the code (which I found to be very easy to use) and a combination of AVR Studio, STK500 and JTAGICE mkII for debugging.

I am having a hell of time getting AVR Studio to work with JTAGICE mkII. I have encountered the following problems:

1- The USB interface does not work on the JTAGICE mkII, even where I work (I am working on PowerPC) they are using the same thing, they can't get the USB interface to work. The host is a Dell D505 laptop.

2- Perhaps my choice of ATmega88 was not the best choice because it does have a debugwire interface and not a JTAG interface. Because the debugwire is also the reset pin, one can not use the debugwire and ISP simultaneously. It is either debugwire or ISP and the chip has to be re-prgrammed for either one.

3- The latest revision to the STK500 firmware does not work with avrdude 4.4 or even 4.3. I understand that there is avrdude 5.0 beta that solves this problem but I could never find it for Windoze and I don't want to switch to Linux just to be able to use avrdude 5.0.

4- The worst problem is that JTAGICE mkII either loses connection to the debugwire and ISP or can't find them and I have to unplug the serial port connection from JTAGICE mkII and connect to the STK500, reconnect the parallel programing cables on the STK500 and re-program the chip for the JTAGICE mkII to declare that it can not see the debugwire again.

5- Even at the odd time when the JTAGICE mkII sees the debugwire, I am seeing ridiculous things, F11 (step into in the AVR Studio) goes through every line of code indiscriminately after loading the .elf file.

Any bright ideas besides switching to a processor with JTAG interface? Unfortunately they are at least 40 pins and more expensive and the PCB is about to be routed (not too late to change though).

Best regards,

Mostafa

--
----------------------------------------
Mostafa Kassem
M Dot Kassem At ieee Dot org
---------------------------------------
Reply to
Mostafa Kassem
Loading thread data ...

I've never had any problems with the mkII's usb port with both my desktop pcs and a Sony Vaio SR1K notebook (all Windows XP). A fried of mine had problems with ground loops and the STK500, which went away with swapping polarity on the STK500's power supply.

Why should I use avrdude instead of AVR Studio?

A better way would be developing on a JTAG capable chip (via adapter board) and porting to a smaller chip after everything is working.

Mit freundlichen Grüßen

Frank-Christian Krügel

Reply to
Frank-Christian Kruegel

I tried the mkII with an IBM Thinkpad running Win98SE and the USB interface did not work either. The DEll is running Win2K.

Because I suspected the AVR Studio was not programming the chip correctly. I did a DIFF on the hex file generated by AVR GCC and the hex file read by AVR Studio from the chip and there was quite a bit of discrepancy. After I posted, I came across these two links which confirmed my suspicion.

formatting link

formatting link

Yep, I should have done that from the start. Except that I did not want to duplicate the work as there is really no direct downgrade path. Also, I didn't think it was going to be that difficult as this is my first experience using AVR and its tools.

Wielen danke.

Mostafa

--
----------------------------------------
Mostafa Kassem
M Dot Kassem At ieee Dot org
---------------------------------------
Reply to
Mostafa Kassem

to

debugging.

(I

USB

simultaneously.

either

4.4

to

Hello,

I'm using the IAR toolset to generate code but the AVR Studio/JTAGICEMkII (via USB) combination to debug mega88.

I have seen symptoms very like yours when the ISP pins from the JTAGICE were connected to the target when using the debug wire. (The docs say that the ISP pins will be high Z duirng debugWire operations but I think that signals on them fool the JTAGICE into never properly starting the debugWire session.) Whatever the exact cause when I connected ONLY the debugWire pins to the target it all works fine.

Hope this is some help - please let me know.

Michael Kellett

formatting link

Reply to
MK

Hello Michael:

I decided to take Frank-Christian Krügel's advice and use a processor with JTAG. So, I switched to the ATMEGA16 that came with the STK500 and things seem to work much better with the JTAG. I'll switch back to the M88 once everything is working.

However, in the process of switching I discovered that I may have been setting the clock fuse to the wrong value and that may have been my problem all along even when I used only the three wires for the DEBUGWIRE.

Thanks for your post.

Best regards,

Mostafa

--
----------------------------------------
Mostafa Kassem
M Dot Kassem At ieee Dot org
---------------------------------------
Reply to
Mostafa Kassem

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.