Using Arduino Uno R3 to flash atmega16u2

Hello,

(Probably a noob question :sweat_smile:)
I have an Arduino Uno R3 thats not working anymore (the 328P works fine but it is not detected by my pc) I have tried to put it into DFU mode but that did not work.
I have another arduino R3, could i use that to try to reflash the 16U2 on my 'broken' Arduino?
If so, what would i need to buy/do to reflash it?

Thanks in advance.

Best regards,

Polo9n

If you have another Arduino you can use it as programmer, see Arduino as ISP.

Hello,

Today I saw that we have AVR ISP mk2 programmers at school.
Because using a Arduino as isp looks difficult, I think it will be much easier to use the avr programmer?
What do i need to do to reflash my 16u2 on my Uno R3 using the AVR programmer?
I can find a lot of tutorials on google but they are only for Uno R1 or R2.

Best regards,

Polo 9n

You can use AVR programmer if you have, should be more reliable. ArduinoISP maybe looks difficult but isn’t. The most frequent mistake is bad wiring, I think.
In the Arduino SW there is a folder …firmware\atmegaxxu2. Read the README.txt.

Hello,

Okay, so wich of the hex files do i need,

Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex

or inside the arduino-usbserial folder:

Arduino-usbserial-atmega16u2-Uno-Rev3.hex

Or another file?

Where should i attach my avr programmer, to the header next to the 16u2 or to the icsp header?
And how do i make sure my 16u2 chip is not just broken?
And what command should i enter?

avrdude -p at90usb82 -F -P usb -c avrispmkii -U flash:w:UNO-dfu_and_usbserial_combined.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

This is the standard code from the readme file, of course i have to change it to the hex file i want to use and i should change at90usb82 to at90usb162 correct?

Is that all that has to be changed, are the fuse settings correct?

Where should i enter my changed command, in cmd?

Thanks for the help!

Best regards,

Polo9n

Use combined hex file.
ISCP is above the 16U2, the second one is for 328P.
Use this command you've posted for 8u2 it works without changes I don't knov about 16U2 but could be the same. Time for little experiment.

Where should i enter my changed command, in cmd?

Yes.

Hello,

I have another problem again, I cant find drivers that work with my windows 8.1 64 bit laptop.
Which drivers should I use?
If neccesery I also have a 64 bit win7 netbook.
Or should I use the arduino as isp after all, we do have a lot of components at school so I can use them if I need to.
If the arduino is the answer, how should I wire it up?

Best regards,

Polo9n

ArduinoISP is here described in details. Wiring is included also.

Just check all twice before any action to prevent of problems.
Another good tutorial is here (some people preffered this):

It's about programming bootloader but the same way can be used to program whole chip. Important thing is to have everything wired right.
I can't help with Win8.1 64. I have no experience with. I'm using old good XP. Did you try to search on this forum? What about Google? I can't believe that there is no answer.
Or, you can try to use virtual machine with other OS, e.g. XP.

Hello,

I wired my arduinos up using this:

And i used:

to find the matching pins from the 16u2's icsp header on the arduino itself.
So it looks like this:
Board to be programmed: Filled the icsp header with jumper cables.
Programmer Board:Plugged in the other side of the jumper cables to matching outputs (Reset to D10, MOSI to D11, MISO to D12 and SCK to D13)
After that I followed the first steps from:

I also connected the 10uF capacitor.
I opened up a cmd window and used this command:

avrdude -p at90usb162 -F -P usb -c arduino -U flash:w:UNO-dfu_and_usbserial_combined.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

But I get: avrdude not recognized as internal or external command.
I thought avrdude was included with arduino IDE.

Is everything I am doing ok?

Best regards,

Polo9n

Avrdude is included (..\arduino-1.0.x\hardware\tools\avr\bin). Problem is OS related.
You have to have a set the path to the avrdude or to be directly in its folder.