Go Down

Topic: 16u2 will no longer enter DFU mode (Read 1 time) previous topic - next topic

joshglendenning

Working on a project where I'm having my Arduino Uno R3 act as an HID keyboard, following this tutorial. I've managed to flash back and forth between the normal usbserial firmware and the keyboard firmware multiple times already while testing my project, but now when I short the reset and ground pins on the 16u2 ICSP  (just like on this page), nothing happens.

I think the 328P is fine since it seems by the LED behavior that it's still running the last sketch I uploaded. I can't imagine that I fried the memory on the 16u2 since the datasheet says it's rated for 10,000 writes.

Anybody have any ideas?

SantinoPrice

You could try reflashing the 16u2 with a ISP device. The file you would need to reflash is "Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex". It can be found in a subdirectory under the arduino install directory.
Need help troubleshooting problems with your Arduino (Uno, Mega or Pro-mini) have a look at my book on the kindle store.
 Arduino Troubleshooting

joshglendenning

Have any tips on how to go about doing that? Obviously there are guides like this for using another Arduino to program the 328, but I'm not sure how to do that for the 16u2.

SantinoPrice

#3
Jun 20, 2015, 07:48 am Last Edit: Jun 20, 2015, 07:49 am by SantinoPrice
The connections and process is really similar. I am presuming you have another Arduino board and as such these instructions will be for using that to reprogram the 16u2.

The first step will be to download and upload to your working Uno the Atmega board programmer sketch by Nick Gammon. That sketch will enable you to reload the firmware of the 16u2, it also supports other boards/processor combo's and is a really good sketch to have on hand.

Having loaded the working board with the sketch the next step will be to connect the board to the 16u2. This can be done as follows: (The image attached can be used to identify the corresponding pins for the 16u2)

Pin 10 : Reset2
Pin 11 : MOSI2
Pin 12 : MISO2
Pin 13 : SCK2
VCC : VCC
GND: GND



Once you have that connected; you will then launch the IDE, open the serial monitor and then connect the "working board" to your computer. You should receive some information from the board identifying the chip that is connected to it (in this case the 16U2) after which you can type "G" to reload the firmware.

More information on how this sketch works can be found on Nick's website.

Let me know if you need anymore information and I will do my best to help.
Need help troubleshooting problems with your Arduino (Uno, Mega or Pro-mini) have a look at my book on the kindle store.
 Arduino Troubleshooting

joshglendenning

#4
Jul 01, 2015, 02:13 am Last Edit: Jul 01, 2015, 02:15 am by joshglendenning
Thanks for the help. I finally got the other Arduino I needed in the mail so I tried to re-flash the bootloader with the Gammon program you gave me but it doesn't seem to be recognizing the 16u2. Here's the response I get:

Code: [Select]
Atmega chip programmer.
Written by Nick Gammon.
Version 1.35
Compiled on Jun 30 2015 at 18:59:00 with Arduino IDE 10605.
Attempting to enter ICSP programming mode ......................................................
Failed to enter programming mode. Double-check wiring!
Type 'C' when ready to continue with another chip ...


Just as a sanity check I had it verify the firmware on the ATMega, which worked just fine. Could my 16u2 just be fried?

SantinoPrice

It is possible although I would think unlikely if all you did was use it as a keyboard. At this point you basically have two choices:

1. You can use the "new" Uno, by holding its processor in reset (similar to when doing a loop-back test) with connections between both boards on pins 0 and 1, to program the Atmega on the defective board.

2. You can attempt reloading the 16u2 through a command line interface (admittedly it might seem a bit more challenging) but that would allow us to get a better idea of where exactly the process is failing.
Need help troubleshooting problems with your Arduino (Uno, Mega or Pro-mini) have a look at my book on the kindle store.
 Arduino Troubleshooting

Go Up