-
-
Notifications
You must be signed in to change notification settings - Fork 183
Uploading programs
Short the 16u2's reset pin twice to enter bootloader mode. You can upload your Arduino sketch like you are used to. You need to check the new Serial port in the IDE. To start the 16u2 sketch again short reset once. To get Serial Debug output from the 328/2560 you also have to enter bootloader mode again.
Tip: When in 16u2 program mode you can select HoodLoader2 Uno
/ HoodLoader2 Mega 2560
and hit upload. The 16u2 will reset, go into bootloader mode and the program will upload to the 328 instead.
You can now use the 16u2 as normal Arduino USB board like a Leonardo/Micro/Teensy.
You may want to have a look at the HID Project for more HID devices.
Have a look at avr/examples/
for HoodLoader2 related examples.
Keep in mind that the Leds have inverted logic. Writing LOW means turn them on.
Once you've uploaded your first HoodLoader2 sketch it should switch to a different Serial comport and show up as HoodLoader2 16u2:
If you want to upload a self compiled firmware(.hex file) from for example a LUFA project like the HoodLoader1 you wont be able to use DFU via Flip any more. But you can use avrdude instead.
This can also be used to erase the program from your 16u2 if you always want to use it as normal USB-Serial bridge again (always stay in bootloader mode).
A copy of avrdude for windows is already included in tools/avrdude/. The libusb0.dll was taken from an Arduino IDE installation. You can download the newest avrdude here.
Open a cmd or terminal and try the following code. You can also use the provided tools/flash.bat file (windows only) for easier uploading.
# select com port, device and .hex file yourself
# flash new firmware to the USB MCU
avrdude.exe -C avrdude.conf -p atmega16u2 -c avr109 -b 57600 -P COM1 -U flash:w:HoodLoader1_8.hex
# erase firmware from USB MCU
avrdude.exe -C avrdude.conf -p atmega16u2 -c avr109 -b 57600 -P COM1 -e
# Linux equivalent
avrdude -p Atmega16u2 -c avr109 -b 57600 -P /dev/ttyACM0 -U flash:w:Firmware.hex
And yes, it's correct that you can have HoodLoader2 and HoodLoader1 running 'at the same time' since v2 is a real bootloader and v1 'only' a firmware. HoodLoader1 is depreciated though.
Copyright (c) 2014-2021 NicoHood
Additional Information