ATmega32u4 Reset Button Usage

Hi all,

Am I correct in saying that with the Arduino bootloader I am not able to use the reset button on the 32u4 as a button that, when pressed, restarts the module and instantly runs the code again (like basically all other AVR chips), unless I flash the code directly via SPI without the bootloader?

Every time I hit the reset button it waits like 10s, expecting to be programmed via USB, then proceeds to run the code, which is really annoying.

I want to be able to push the reset button, have it run something once (like in the setup() function), then go to sleep until the reset button is pressed again. I can do this with a wake-up interrupt on another pin, but it would be easier to do it via the REST button on another processor like ATmega328, etc.

Thanks!

Every time I hit the reset button it waits like 10s, expecting to be programmed via USB, then proceeds to run the code, which is really annoying.

The timeout is 8s but you are correct that using the reset button the caterina bootloader code does exactly this.

but it would be easier to do it via the REST button on another processor like ATmega328, etc.

You also have a timeout on Arduinos based on other processors. The Duemillanove bootloader has about 2s, the UNO bootloader (optiboot) waits only 500ms.

You're free to change the bootloader but it's not that bad to have a possibility to recover if you uploaded a freezing sketch.

OK thanks! So I guess I'm better off just using another pin as an interrupt instead of coping with the bootloader delay.