Unable to upload programs to uno after flashing atmega16U2

Hi,

I had a perfectly working Arduino Uno and I needed to try out a project that required USB host on the Arduino so that it could send keyboard commands to my Windows PC.

I followed(this) guide to try and replace the firmware on the atmega chip with the one on the guide. I managed to do it successfully but the uno just shows up as a USB Input device in device manager. There is no com port and I cannot upload any sketched to the Arduino. The board just lights up and the Arduino IDE doesn’t recognise the board.

I am experienced with the Arduino but, this is my first time trying to flash any of the chips.

These are my specs:
Windows 10 with the latest Arduino software
Arduino Uno Compartible board with the ATMEGA16U2 chip (which I tried to flash)

I have included some pictures of the device manager and the Arduino IDE if it would help.

Any help would be appreciated ,
Vivek

You need to follow that guide again to do the part where you use DFU programming to upload the Arduino-usbserial-uno.hex back onto the ATmega16U2. That is the program that needs to run on the ATmega16U2 to allow you to upload normal sketches to the Uno's ATmega328P.

The Arduino-usbserial-uno.hex file is available in the Arduino IDE, in a subdirectory, hardware/arduino/avr/firmwares/atmegaxxu2/arduino-usbserial/

So the problem is - the 16U2 is the interface between your PC and the Arduino. it can either look like a serial port or it can look like a HID - keyboard/ mouse. Asking it to do both at once is - just a bit too much.

viveksahu: I needed to try out a project that required USB host on the Arduino so that it could send keyboard commands to my Windows PC.

No, a HID - not a "host". A host is the PC end, to which you connect keyboards, mice, drives and other stuff. You can get host boards for the Arduino but this is clearly not what you want.

Thanks for the quick response.

However, when I try to use Atmel’s FLIP program to flash the Atmega chip I just get the following error: com.atmel.IspException Could not open USB device.

I attached a pic of the error.

I get the error when I try to open an USB connection with the Arduino.

(deleted)

Yes, finally solved it. Thanks Paul, I can't run both hex files at the same time.

+spycatcher2k Thanks for showing me. Dumb mistake of mine.