Skip to content

Installation sketch (standalone Arduino Uno Mega)

Nico edited this page Jan 18, 2015 · 27 revisions

This installation method is designed to work with a single Arduino Uno/Mega. To install a bootloader in general you would need an ISP (In system programmer). Most of you (me too) down own a professional ISP so we will use a trick here.

We use a modified version of Nick Gammon's Atmega Board Programmmer. In this case the 328/2560 acts as ISP with a the HoodLoader2.hex preloaded in PROGMEM.

1. Prepare your Arduino.

First remove all hardware/wires/usb-cable from your Arduino to ensure nothing is messing up the upload. Connect all wires like in the picture below. Double check connections!

Note: It might be possible that your ICSP header of the 16u2 is flipped 180 degrees on some unofficial boards.

The 100nF Capacitor is needed to prevent the 328/2560 from not being reset. Only plug it in after the sketch is uploaded to the 16u2, you will see a note later in the instruction.

Connections

100nF Capacitor:
328/2560 RESET - GND (after sketch is uploaded)

Pin connections:
328/2560 - 16u2
MOSI     - MOSI
MISO     - MISO
SCK      - SCK
PIN 10   - 16u2 RESET

Optional Buttons for recovery:
PIN 8    - Force DFU upload
PIN 7    - Force HoodLoader2 upload

2. Upload the installation sketch

Connect your Arduino to your PC, select the Arduino Uno/Mega board like you are used to. The installation sketch is located in tools/Atmega_Board_Programmer/Atmega_Board_Programmer.ino, open it with your Arduino IDE.

In the first lines of the sketch you can optionally choose to what Arduino you are uploading to otherwise it will automatically detect the correct Arduino. Upload the installation sketch to your Arduino Uno/Mega. This may take a while.

board-programmer

3. Burn the bootloader

Once the installation sketch is uploaded to your main MCU you are able to burn the bootloader to your 16u2. To control the burning you have two options:

Control via Serial:

Open the Serial port monitor at baud 115200. Now put in the 100nF capacitor. Follow the instructions (press 'H' + Enter) and wait. You may close the Serial monitor now.

installation-sketch

(Optional) Control via pin 7:

First put in the 100nF capacitor. Press the reset button. Connect pin 7 with ground to flash the HoodLoader2 if your serial port does not work for some reason.

Your USB device will disconnect and the 328/2560 will flash the new bootloader.

4. Check bootloader installation

Now your Arduino should be flashed with the new bootloader. If its not correctly installed read the instructions carefully and try again. To check if the installation worked fine you may check your device like that in "Devices and Printers" for Windows:

version

You may remove all wires now, they are not needed anymore once the HoodLoader2 is flashed. Normally you don't need to do this again, maybe if there is a new HoodLoader2 version.

Keep on reading on how to install the board definition files and use the HoodLoader2.

5. (Optional) Switch back to the old DFU bootloader

If you want to switch back to the original DFU bootloader with usbserial just do the same procedure. Enter 'D' for DFU on the Serial monitor or short pin 8 to ground. You can use avrdude to flash .hex files so DFU is not really needed anymore.