Upgrading the firmware of the Arduino Due Programming port 16U2

Behind the Arduino Due Programming port there is an AVR microcontroller ( ATmega16U2 ) which converts the USB signals coming from the computer to the first serial port of the SAM3X . In this tutorial you will update the ATmega16U2 firmware using an Arduino Uno or Mega as an AVR-ISP (in-system programmer).

Instructions

To use your Arduino board to burn a bootloader onto an AVR, you need to follow a few simple steps.

  1. Open the ArduinoISP sketch (in Examples) in the Arduino IDE.
  2. Select the items in the Tools Board and Serial Port menus that correspond to the board you are using as the programmer (not the board being programmed).
  3. Upload the ArduinoISP sketch.
  4. Connect a 10uF (micro Farad) capacitor between the GND and RESET pin.
  5. Connect the following pins from the Arduino Uno (or Mega) to the ATmega16U2 ICSP connector:
Uno Mega 16U2 ICSP
SCK 13 52 3
MISO 12 50 1
MOSI 11 51 4
Reset 10 10 5
GND GND GND 6
+5V 5V 5V 2

The Arduino Due will take power from the Arduino Uno set as AVR programmer. If you want further details on the connections between the Uno/Mega and the ICSP connector of the target please look this tutorial: Arduino as AVR-ISP

Upgrade the firmware using avrdude

To upgrade the firmware you need to use a command line tool called "avrdude", that is already included inside your IDE folder. You find it at the following path: /path_to_arduino/arduino.1.5.x/hardware/tools

The firmware to upload on the 16U2 is in a binary format that has the .hex extension.

Linux and Mac

First thing to do is to go to the directory that contains the avrdude tools that comes with the IDE. For doing that, open a terminal window and type:

the path to reach the Arduino directory depends where you placed it. Then you can execute the avrdude tool specifing all the parameters you need to flash the firmware. Here the complete line:

Windows

First thing to do is to go to the directory that contains the avrdude tools that comes with the IDE. For doing that open a command prompt window clicking on Start and typing cmd then press enter.

Once the command prompt is open should display a row like this: C:\Users\USER then type the following command to move inside the Arduino folder (it depends where you placed it): cd arduino-1.5.2\hardware\tools

the path to reach the Arduino directory depends where you placed it. Then you can execute the avrdude tool specifing all the parameters you need to flash the firmware. Here the complete line:


Источник: www.arduino.cc