- The uno could :
- Run the last code that was on it
- The uno could not:
- Be recognized normally by a computer through the USB port therefore it could not
- Receive new code
Since then, I was thinking I'm out of luck and down $35 or whatever it cost me... until now. So if you have a newer Arduino uno (the one that uses the ATmega8U2 - look at the writing on the other little SMD chip next to USB port) and have some problem with it not being recognized by a computer normally, there may be hope!
Since I've been working on my ATtiny84, I needed some sort of programmer. I bought the USBtinyISP which I've talked about many times. With this I'm able to manually put code (flashing hex files or modify fuses) on most of the AVR AT* chips. Cool. Now I also knew that there were two microcontrollers on the newer Arduino Unos. The one you program normally: ATmega328 and the one whose job is to program the ATmega328 with what comes in from the USB. This uC is the ATmega8U2.
My first thought was to reflash the main uC (ATmega328) with its bootloader, thinking that something was wrong with it. I was wrong.
My second thought was, "Woah, Ethan. There's another 6 pin SPI interface for the in system programmer! Perhaps I can load the ATmega8U2 with its original program!" This is when things started getting exciting, since there was hardly any information on this. Many websites and walkthroughs told me to use the USB input, a utility from AVR, solder a resister on the back and wire up some other things to get it to work. I thought there had to be another way since these nice SPI pins were looking me right in the face. So I plugged in my USBtinyISP to these 6 pins and started looking for source code to upload.
Here you'll find where that code is. I used Arduino-usbserial-uno.hex for the file that needed to be flashed to the 8U2. Now I manually needed to run avrdude (found in win-avr) to actually write this hex file to the 8U2's flash memory. This can be done with this command:
avrdude.exe -c usbtiny -p at90usb82 -F -U flash:w:**********
where ********** is your path to Arduino-usbserial-uno.hex.
After a few seconds, this is completed. If the avrdude command doesn't work for you, perhaps your programmer isn't installed correctly, you've got it plugged in wrong, this isn't actually your problem, or many other things. The error would maybe give you a more specific direction.
When this was done writing, I plugged in my Arduino Uno. Pretty much to my full surprise my computer recognized the Uno...
I hope this helps some people out if they run into the same problem. Back when we were working on the project, we must've shorted something on the 8U2 to erase/corrupt the flash. This probably doesn't happen too often but maybe once in a while. Also some people get corrupted ones brand new. If you have a programmer on hand, this is a viable solution. I sincerely hope this does show up in google searches, because I could've used it a while ago!!