to be honest I'm a little bit lost at this question (I'm using arduino on a custom PCB with ATMEGA 32U4 5V@16MHz):
is it possible by using a interrupt (attachInterrupt) on the RESET Pin, to execute one quick "last task" (in my case: writing a log entry into ext. FRAM) before the MCU "shuts down" (goes into its RESET-State) ?
or is the ATMEA's RESET interrupt-source triggered on a POWER-UP event, only ?
There is a Vss controlled "watchdog" circuit on this custom PCB that pulls the RESET-Pin permanently down (=RESET-State), if the Vss drops below a certain value (here: 4,5V)
So what I want to do is to log this event ("power off" or "Voltage below 4,5V") in my ext. FRAM