I made simple board with ATMega8U2 microcontroller for my USB experimenting (I'd like to make MIDI, HID, ... devices). I took inspiration in Arduino Uno. If you look on schematic below, you can see it is almost the same as Uno.

I programmed 8U2 with firmware from Arduino project — UNO-dfu_and_usbserial_combined.hex. Now, if I connect board to USB, I get serial port and it works just like Arduino, so this is perfectly OK.

My problem is: how can I put 8U2 into DFU mode, so I can change firmware without external programmer? If you look on picture, I connected HWB (pin PD7) to ground, so it should be simple — just pressing reset button. Unfortunately, it isn't working.

Am I missing something? Can be a problem in wrong fuse bites?

Edit: My fuses are lfuse=0xff hfuse=0xd9 efuse=0xf4


I checked fuses on chip

$ avrdude -p at90usb82 -P /dev/tty.usbmodem411 \
> -F -c arduino \
> -U lfuse:r:low:h \
> -U hfuse:r:high:h
$ cat high low

For programing, I'm using Arduino Uno as ISP and this commant (on Mac):

$ avrdude -p at90usb82 -F -P /dev/tty.usbmodem411 \
> -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
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
  0xff != 0x00
avrdude: verification error; content mismatch

So I suppose, avrdude did not programed fuses and they are still blank. Is it possible? Because board is working corrently, except DFU mode after reset.

Schematic ATMega8U2


1 Answer 1


Is the HWBE bit (HardWare Boot Enable) set in your fuses?

  • \$\begingroup\$ HWBE bit is cleared (=zero). My fuses are: lfuse=0xff hfuse=0xd9 efuse=0xf4 \$\endgroup\$
    – vasco
    Feb 1, 2012 at 15:51
  • \$\begingroup\$ Ok, so problem was in fuses. I do not know why, but hfuse wasn't set. \$\endgroup\$
    – vasco
    Feb 13, 2012 at 15:42
  • \$\begingroup\$ So what the fuses should be after setting the HWBE bit ? \$\endgroup\$
    – Amer Sawan
    Jul 13, 2014 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.