Hello guys
I'm using an ATMEGA256RFR2 and regarding WDT, I stucked in a bit.
I wanted to use the Interrupt mode or the "Interrupt and System Reset Mode". (Datasheet page 218).
Bitcloud has its own WDT functions.
I setup first a callback with HAL_RegisterWdtCallback(afunction);
And then I start the WDT with HAL_StartWdt(WDT_INTERVAL_8000);
In the "afunction" I restart the WDT with HAL_StartWdt(WDT_INTERVAL_8000); again.
This is needed because as per the datasheet, in the Interrupt and System Reset Mode, the first WDT overflow will generate an interrupt, and the second one will reset the IC. But if I set again the WDIE, the next one will also generate the interrupt. And HAL_StartWdt(...) sets this WDIE in the register.
However, my chip keeps restarting itself.
Do you have any idea, what could be the reason of this?
Thank you.