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   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
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:
- 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.
- 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.
- The JTAGICEMKII may be damaged...although receiving the same error using ArduinoISP should disprove that possibility
- 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.