Anyone has bootloader for ATMega16u2?

Hi,
I want to make a macro-pad, but ATMega32u4 seems a bit… overkill.
So I guess using a smaller MCU, like ATMega16u2, would be… good, since it’s smaller and, maybe, cheaper.

But I can’t find bootloader for this mcu, (bootloaders on qmk: qmk_firmware/util at master · qmk/qmk_firmware · GitHub)

Do you have bootloader for ATMega16u2 and can you share it with me (and other people who might need it)?

The ATMega*U2 and ATMega*U4 come with a DFU bootloader preinstalled from the factory.
You can find information in this application note:

If you pull ~HWB low and ~RESET high on the board, every time you bring ~RESET low the board will go into DFU mode and can be flashed by dfu-programmer or avrdude -c flip1.

You can see an example implementation in my macropad, using ATMega32U2:

schematic

The ATMega16U2 and ATMega32U2 are identical, but the 32u2 has more flash and RAM. I’d be very careful with the ATMega16U2, it only has 512 bytes of RAM. At least with QMK and RGB backlighting IME that’s not even enough for a macropad like this one, even with just 12 keys.

1 Like

Hi,
Thank for reminding me about the RAM, I totally forgot about it.
And thank for sharing your macropad implementation, I will research it carefully. :+1: