-
-
Notifications
You must be signed in to change notification settings - Fork 187
Installation sketch (standalone Arduino Uno Mega)
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.
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.
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
Connect your Arduino to your PC, select the Arduino Uno/Mega board like you are used to (do not select 16u2). The installation sketch is located in sketchbook/hardware/HoodLoader2/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(ctrl + U). This may take a while.
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:
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.
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.
Now your Arduino should be flashed with the new bootloader. To check your HoodLoader2 installation read on here. If its not correctly installed read the instructions carefully and try again.
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.
Copyright (c) 2014-2021 NicoHood
Additional Information