Urgent! Trying to use usbtiny ISP to flash a hex file onto the 16u2 chip of mega

Hi folks,

I am currently working on a MIDI controller prototype using Hiduino.
(GitHub - ddiakopoulos/hiduino: Native USB-MIDI on the Arduino).

I successfully managed to flash this firmware onto the 16u2 about a year ago (With great effort)
and now I have to do it again. The problem is I keep getting the following error:

My command is
avrdude -p m16u2 -P usb -c usbtiny -U flash:w:usbserial_mega_16u2.hex -v

and the response I get is:

avrdude: Version 6.0.1, compiled on Sep 18 2013 at 08:20:41
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Users\Jamie\Desktop\avrdude.conf"

Using Port : usb
Using Programmer : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\.\libusb0-0001--0x1781-0x0c9f
AVR Part : ATmega16U2
Chip Erase delay : 9000 us
BS2 : PC6
RESET disposition : possible i/o
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack

eeprom 65 20 4 0 no 512 4 128 9000 9000 0x00 0x00
flash 65 6 128 0 yes 16384 128 128 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : USBtiny
Description : USBtiny simple USB programmer, USBtinyISP - Inexpensive USB AVR Programmer
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

usbtiny does appear to be working but it just wont communicate.
The mega is brand new :confused:

I am at my wits end having been trying to fix this for over 8 hours now

Try this to see if you are hooked up right.

avrdude -p m16u2 -P usb -c usbtiny

$ avrdude -p m16u2 -P usb -c usbtiny

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9489 (probably m16u2)

avrdude: safemode: Fuses OK (E:F4, H:D9, L:FF)

avrdude done. Thank you

The ATmega16U2 supports DFU programming over USB. So you can just use Atmel Flip or dfu-programmer to flash the hex file.

Full instructions can be found here.


Kprims I did that and got the same result.
In the end I suceeded through the DFU method although when I try to rename the device it still enumerates as arduino_midi.

However the ISP works fine when programming the 2560 in the arduino IDE so I don't know what gives.

although when I try to rename the device it still enumerates as arduino_midi.

Did you compile the firmware yourself?


Did you compile the firmware yourself?


Yes, Even had to install Gnu make for windows and mess with my path variables to do so.

Why is this urgent?

Why is this urgent?

Because I am working on a project that I want to get to market.
At the time I was not able to get the firmware on the chip at ALL until I discovered the DFU method, and therefore couldn't proceed with my project