Updating the Atmega8U2 on an Uno or Mega2560 using DFU

Updating the Atmega8U2 on an Uno or Mega2560 using DFU © GPL3+

The ATmega8U2 chip on your Arduino board acts as a bridge between the computer's USB port and the main processor's serial port.

  • 4,519 views
  • 0 comments
  • 0 respects

Components and supplies

About this project

1. Check whether you need to update the firmware

The Arduino Uno and Mega 2560 have been shipping with the updated (rev. 0001) version of the ATmega8U2 firmware since around May, 2011. To check which version of the firmware is on your board, connect it to your computer and follow the directions for your operating system:

  • Windows: locate the board in the Device Manager (it should be under Ports), right click on it and select "Properties"; in the resulting dialog, click on "driver details" in the "driver" tab. In one the properties, you should the VID, PID, and the revision number.
  • Mac OS X: run the System Profiler application (e.g. by selecting "About This Mac" from the Apple menu and clicking the "More Info..." button); go to the USB sheet and click on the item for the Arduino board. The 8U2 firmware version is listed as "version" (e.g. 0.01 for rev. 0001).

If your board has rev. 0001 of the 8U2 firmware on it, there's no need to upgrade it.

2. Download a DFU Programmer

This is the software that will update the code on the 8u2

Windows: Download Atmel's flip programmer from here http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886

Mac: Install MacPorts following these instructions: http://www.macports.org/install.php#pkg Once MacPorts is installed, in a Terminal window, type:

sudo port install dfu-programmer

NB: If you've never used sudo before, it will ask for your password. Use the password you login to your Mac with. sudo allows you to run commands as the administrator of the computer

Linux: from a command line type

sudo apt-get install dfu-programme

or

sudo aptitude install dfu-programmer

depending on your distribution.

3. Download updated firmware for the 8U2

The latest version is here https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares Choose the version that is suitable for your board, either arduino-usbserial/Arduino-usbserial-uno.hex or arduino-usbserial/Arduino-usbserial-mega.hex.

The firmware is also located with the Arduino software in the /hardware/arduino/firmwares/arduino-usbserial folder. On OSX, right-click or command-click on the Arduino application and select "show package contents" to find this folder.

4. If your board is NOT an Arduino UNO SMD

You'll need to solder a 10k resistor (Brown-black-orange) at the back of your board in the same location as this picture.

5. Connect the Arduino to your computer with a USB cable

Just like you do whenever you're programming it.

6. Reset the 8u2

To do this, briefly bridge the reset pin with the ground. The pins are located near the USB connector, as shown in this picture. Connect them briefly with a piece of wire.

To verify you have reset the 8u2 chip: In the Arduino programming environment, check the list of serial ports. The serial port for your board should no longer show up.

7. Program the chip

Windows: Use flip to upload the hex file to your board.

Mac & Linux: From a terminal window, change directories to get into the folder with the firmware. If you saved the firmware in your downloads folder on OSX, then you might type:

cd Downloads/

Once there, type:

sudo dfu-programmer at90usb82 erase

When this command is done and you get a command prompt again, type:

sudo dfu-programmer at90usb82 flash Arduino-usbserial-uno.hex

Finally, type:

sudo dfu-programmer at90usb82 reset

8. Unplug your board and plug it back in

Your board should be ready and up to date. You can check this by looking in the serial port menu of the Arduino software. Your port should re-appear.

9. Using other firmware

The 8U2's flexibility allows for other firmware so your board can appear as a different USB device (MIDI controller, HID, etc.). See the tutorials below for additional information.

MIDI Note Player using the MIDI firmware

Code

Github
https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares

Comments

Similar projects you might like

Interfacing Arduino UNO with SURE Electronics LED Dot Matrix

Project tutorial by Arduino_Scuola

  • 4,979 views
  • 1 comment
  • 3 respects

Connect to Blynk using ESP8266 as Arduino Uno wifi shield

Project tutorial by Nolan Mathews

  • 88,331 views
  • 12 comments
  • 62 respects

Arduino UNO Guitar Pedal

Project tutorial by electrosmash

  • 62,573 views
  • 30 comments
  • 186 respects
Add projectSign up / Login