Skip to content

How to use on Arduino Uno and Arduino Mega

Leon Kiefer edited this page Jul 8, 2019 · 8 revisions

Arduino Uno and Arduino Mega are based on an ATmega328 and ATmega16U2, yes two microcontroller on one board. The ATmega328 does not handle the USB communication on the Arduino boards, the ATmega16U2 handle the communication. The sketch you upload, is uploaded to the ATmega328, so you can't change what the ATmega16U2 is doing. But that is important for this library. This library needs control over the USB communication in such a way that:

  1. VID and PID can be changed
  2. new USB Endpoint can be defined
  3. HID Reports can be send and received Nothing of that can be done with the normal Arduino Uno and Mega, because you can not program the ATmega16U2.

To change this HoodLoader2 must be used. HoodLoader2 is a bootloader to reprogram the ATmega16U2.

If anything goes wrong while burning the HoodLoader2 bootloader you can 'brick' your Arduino. It's up to you to decide what to do with your Arduino.

Setup HoodLoader2 on Arduino

  1. follow the instructions carefully to install HoodLoader2
  2. read how to use reset with HoodLoader2
  3. read how to upload sketches using HoodLoader2

Upload the Sketches

  1. open example/HoodLoader2UnoMegaController/HoodLoader2UnoMegaController.ino in Visual Studio
  2. select HoodLoader2 Uno / HoodLoader2 Mega 2560 in boards menu
  3. hit upload to upload HoodLoader2UnoMegaController.ino to the IO MCU
  4. open example/HoodLoader2CLPBridge/HoodLoader2CLPBridge.ino in Visual Studio
  5. select HoodLoader2 16u2 in boards menu
  6. hit upload to upload HoodLoader2CLPBridge.ino to the 16u2

Troubleshooting

Upload problem?

Short the reset pin twice to enter bootloader mode manually as described here. Then retry uploading with the new COM port.

Clone this wiki locally