ATMEGA328 locks up on watchdog reset

Optiboot is the bootloader used on the Uno. It handles the watchdog timer correctly. The Nano bootloader does not. Which, if any, have you installed?
If none, then move the two serial statements to the end of setup().
The 4 seconds does not apply after a reset. I think it drops to 16ms and the watchdog survives the reset.

1 Like