Hi
I have the following situation: Watchdog is enabled on the Uno which is calculating some variable.
For multiple reasons the Uno hangs from time to time. This is where the watchdog kicks in, restarts the module and the value of the variable is lost, which is not fun at all.
For the time being I am saving the value of that variable in each iteration in EEPROM but this has two problems:
1- From what I understood, I have like 100000 writes before that EEPROM address is burned out.
2- EEPROM writing takes sometime by itself and it adds up to the total delay.
So I am wondering can I have another routine (function) to be called/activated when the module hangs i.e., when the arduino hangs call some function (to save to EEPROM) and then restart.
Any ideas, comments, about how to do that?
Note: streaming the value of the variable via ethernet (i.e. to store it somewhere else and then restoring) is not an option as the scenario is more complex than I described.
Thx.
Mike