4
\$\begingroup\$

Two weeks ago, I pulled out my AVR JTAG ICE MKII and successfully burned a few C programs to my Arduino through AVRStudio 4 SP3. Everything was working very well.

Life caught up to me and I did not touch the Arduino or JTAG until yesterday. I decided that I wanted to play with a few XBees. Downloaded XCTU to update firmware and what not. I realized I needed to reinstall Arduino firmware back on the Diecimila to use the Arduino-XBee shield to update the firmware. I attempted to load the original Arduino boot loader hex file via the JTAGICE2 with AVRProg in AVRStudio and ran into a problem that I have been unsuccessful in solving for the past 9 hours.

I switched over to AVRDude so I could see verbose output. Every time I use AVRDude to program the ATMEGA168, I get the following:

avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00savrdude:
Send: u [75]   [20]
avrdude: Recv:
Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0xffffff
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

I also received:

avrdude: jtagmkII_setparm()
avrdude: jtagmkII_setparm(): Sending set parameter command (parm 0x03, 1 bytes): 0xa0 (1 bytes msg)
avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
avrdude: jtagmkII_getsync(): ISP activation failed, trying debugWire
avrdude: jtagmkII_setparm()
avrdude: jtagmkII_setparm(): Sending set parameter command (parm 0x03, 1 bytes): 0xac (1 bytes msg)
avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_DEBUGWIRE_SYNC_FAILED
avrdude: failed to sync with the JTAG ICE mkII in ISP mode
avrdude: jtagmkII_close()
avrdude: jtagmkII_close(): Sending sign-off command: avrdude: usb_fill_buf(): usb_bulk_read() error error reaping URB: No such device
avrdude: jtagmkII_recv(): Timeout receiving packet

avrdude: jtagmkII_close(): timeout/error communicating with programmer (status -1) 

While using the JTAGICE2, I was connecting its 6 pin header to the ICSP header on the Arduino. I would plug in my 12VDC wall wart first to the Arduino, then turn on the USB connected JTAGICE2, and then open AVRStudio or use AVRDude in DOS to attempt programming. Both programs never had a problem with the jtag itself...just the target. During the JTAGICE2 issue, I would use the following command:

arduino-0021...\avr\bin>.\avrdude -C .\avrdude.conf -p m168 -c jtag2isp -P usb:64:b0 -vvvv -b 19200 -t

or

arduino-0021...\avr\bin>.\avrdude -C .\avrdude.conf -p m168 -c jtagmkII -P usb:64:b0 -vvvv -b 19200 -t

After quite a few hours without success, I finally pulled out a Arduino Nano v3.0 (ATMEGA328P) and blasted ArduinoISP on it via the latest Arduino Wiring. Connected wires correctly according to the Arduino.cc (First 'Schematic') website and attempted to upload the bootloader to the Diecimila again. This time I tried the following avrdude command:

arduino-0021\..\avr\bin>.\avrdude -C .\avrdude.conf -p m168 -c avrisp -P com4 -b 19200 -vvvv -t

I continue to receive the same error. The weird thing is that the last program I loaded 2 weeks ago on the Diecimila works perfectly fine. I just cannot get the darn thing off of there!

The fact that the error mentioned that the Device Signature of the ATMEGA168 chip is 0xffffff worries me.

Now I believe this problem may be occurring for a few different reasons:

  1. While programming the Arduino two weeks ago with AVRProg & JTAGICEMK2, maybe fuses were set. I can however tell you that they were in whatever default state AVRProg uses as I NEVER screwed with the fuses tab at all. My most plausible explanation however, is that ISP has been disabled via fuse.
  2. Somehow hardware may have been damaged causing the programming capability to not work. I do not know of any damage I did but cannot rule that out.
  3. The JTAGICEMKII may be damaged...although receiving the same error using ArduinoISP should disprove that possibility
  4. During Google research, I read that the JTAG ribbon cable has major touchy issues. Not sure if this is a serious problem or not.

Well I am officially at a loss. I hope I included all necessary information. I am running this setup off of a stable Windows 7 64bit PC using the latest Arduino, AVR ToolChain, and AVRStudio software available as of two weeks ago. In case it was my desktop computer, I also downloaded Arduino D/L and libusb-win32 on my Vista laptop, attempted AVRDude query using first DOS command and received the first error listed above. Do I just need to buy a new chip? I know they cost nothing but I would prefer to save it and learn from my mistake so I can fix it next time or avoid the problem all together.

Do you have any suggestions that might help? Thanks in advance for your reply.

\$\endgroup\$
1
  • \$\begingroup\$ I encountered a similar problem with my PICkit 2 and some dsPICs. I had neglected to connect the Vdd and Vss connector on the PICkit 2 to my circuit Vdd/Vss, which was causing all sorts of intermittent problems. Adding my scope probe would sometimes make it work. \$\endgroup\$
    – Thomas O
    Oct 30, 2010 at 11:21

1 Answer 1

2
\$\begingroup\$

I believe I may have found a two part solution for my particular problem. I currently own an Arduino Diecimila (which has the ATMEGA168 with the problem) and also a new Arduino Nano 3.0. I went ahead and flashed the Arduino Nano with the ArduinoISP firmware. I then picked up 3 28 Pin ATMEGA328P DIP chips for $5.00 each at the local electronics store.

I used the ArduinoISP to flash one of the virgin chips with the Arduino Firmware using the above link with a crystal. I plan to now flash one of the other ATMEGA328Ps with the High Voltage Programmer firmware. This chip along with a bit of wiring on a breadboard should allow me to reset all of the fuses on the original ATMEGA168. Once that is done, I will be able to use the Arduino Nano to reprogram the chip.

Since the ATMEGA328Ps only cost $5 each, my end goal is to setup one 328 as an Arduino ISP programmer, setup the 168 as a HV Programmer, keep one 328 chip in my current Arduino Diecimila (upgrade!!), and I'll have one left over for whatever. I can then either switch chips on the Diecimila or build out a real board for the ISP and HV Programmer boards.

I still have not tested the JTAG ICE MKII yet with a logic/oscilloscope. Not sure if it is the root of the problem or not. I will address this issue after I build the HV Programmer.

I will report back on the success/failure of the HV Programmer. I just need to go get a few more 1K resistors to pull it off. Anyone ever tried the HV Programmer? Any other suggestions? If nothing else, hope this helps someone.

\$\endgroup\$
3
  • \$\begingroup\$ I am happy to report back that the High Voltage Programmer firmware linked above aloud me to use the Arduino Nano to fix the ATMEGA168P I had messed up. Today I will be conducting tests on the JTAG ICE MKII to determine if it has a hardware problem. \$\endgroup\$ Nov 6, 2010 at 15:08
  • \$\begingroup\$ JTAG ICE MKII works perfectly after HVP. No true damage done so case closed on my problem. \$\endgroup\$ Nov 6, 2010 at 22:10
  • \$\begingroup\$ It's rare to see people follow through after their problem is solved. Normally bloke XYZ needs an answer now, and when the thread stops abruptly (after someone posted a solution for 'em); they vanish. Shame! So whoever you are, good for you on reporting your solution in detail, cheers. \$\endgroup\$
    – user56227
    Oct 15, 2014 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.