Go Down

Topic: Reprogramming Mega16u2 revisit (Read 2229 times) previous topic - next topic


I first posted this problem herehttp://arduino.cc/forum/index.php/topic,96706.0.html and Nick Gammon did a lot of research for me and I really appreciate it. I tried the instructions for using averdude, at the time it was way beyond me and I needed the Uno for another project that I could use my FTDIFriend to program so left it for awhile. I replaced the 16u2 with a new one (probably a mistake, didn't know for sure if it was bad) and now I want to program it. OK, got latest averdude in WINAvr so I patched it's .conf file as instructed and it ran - but - this is what I got for errors. The first part is the instruction line I used, as you can see I have a USBTinyISP.

C:\WinAVR-20100110\bin>avrdude -p Atmega16u2 -F -P -F usb -c usbtiny -U flash:w:
Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex -U lfuse:w:0xFF:m -U hfus
e:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA16U2 is 1E 94 89
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude done.  Thank you.

Don't know what this fist line means, avrdude: initialization failed, rc=-1, then everything seems to go on, then of course the mismatched device signature.
Looks like I messed up the soldering or the board, I'll try redoing it tomorrow, unless any of you can see a mistake in the way I'm trying to program it? All is not lost, I can still program the 328 with either ISP or ftdi.

Thanks ahead of time,
Einstein once said you don't really understand anything until you can explain it to your Grandmother


Got the rc-1 error figured out I think, I don't have an averdude.rc file, which is a user defined overide for the config file, shouldn't need it.
Tried to reheat the solder joints around the chip, still the same results, so I think I will give up and just use the isp or hot wire up an ftdi adapter.
Thanks anyway
Einstein once said you don't really understand anything until you can explain it to your Grandmother


Hi Tumbleweed,
I've been programming 8U2s (without patching the conf file) as follows:
Code: [Select]
avrdude -p at90usb82 -P com4 -b 19200 -c stk500v1 -v -F -e -u ^
  -U efuse:w:0xF4:m -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m ^
  -U flash:w:Arduino-usbisp.hex ^
  -U lock:w:0x2b:m

Maybe you could try something similar, substituting -p at90usb162 for -p at90usb82?

Go Up