Hello!
I'd like to detect whether the last MCU reset was due to the watchdog or not. To do this, I'm inducing a watchdog reset (enabling the watchdog but never servicing it) when a UART message is received. I then try to detect the reset by checking that the WDFLAG bit == 1 in the WDCR register. However, this is never the case, even when I'm definitely resetting the MCU using the watchdog. Could there be something I'm missing? When enabling the watchdog, I also write a 1 to WDFLAG to clear the previously latched state.
As an alternative to this, are there any writable registers that do not get cleared on a reset that can be used for such a purpose?
Thanks,
Aditya