cancel
Showing results for 
Search instead for 
Did you mean: 

WWDG Reset on Low Battery

ZThat
Senior

Hello,

I am using a windowed watchdog and resetting (petting) the timer in the EWI interrupt. I also kick/pet it in my main loop at 1000Hz. Time is kept via a systick handled flag. Systick, to my knowledge, is attached to the system core clock (same as the windowed watchdog). I also have a "first pass" flag set to prevent it from petting upon first entry to main (the systick handler usually fires before I reach main, which means that there isn't actually a 1mS delay between setting it and petting it on the first pass).

Somehow, when the device that my controller is being used for is at low battery, a sudden increase in load to the system is inducing a micro-controller reset. My knee **** reaction is that this is due to a system brown out, but when I remove my windowed watchdog the reset doesn't happen. This leads me to believe that my windowed watchdog is being called faster at low battery (since this is the only way it could cause a reset with the interrupt petting itself). But this seems impossible, since the windowed watchdog and the systick run on the same clock.

A possible scenario is that my main loop instructions take longer than 1mS to complete in normal use, but that less instructions are called when I add the load, allowing it to actually call at 1mS. This would imply that my window is too late for 1mS petting. However, I only have 1 tick between the start of the countdown and the window and I prescale by 1 off of a 200MHz system core clock. And all of the prescaling equations I have seen assume that you divide the system core clock by 4095 to get the watchdog clock frequency. This leaves my window as 2 hundredths of a mS. This possibility is also ruled out by the fact that I don't get this issue at higher battery voltages.

Could have the windowed watchdog on (initialized/clocked) be increasing the load just enough that a brownout reset occurs?

Any suggestions are helpful.

Thanks!

2 REPLIES 2

The DS contains power consumption data for individual modules. WWDG has a relatively low consumption compared to other modules. Brownout occurs at a specific voltage - is your battery running so low? Measure.

You could also toggle a pin each time you kick the dog and observe that by an oscilloscope/LA, together with the reset pin. You also can/should check (and clear) the reset reason in RCC_CSR.

JW

ZThat
Senior

​Thanks Jan!

This suggestion was very helpful. I have managed to determine that it is definitely a WWDG reset that is occurring at low battery. I am still unsure why exactly it is happening, but I have a strong suspicion that it has to do with the interrupt.

However, after learning that I could check the cause of a reset after the reset occurred, I realized that the WWDG interrupt wasn't necessary for my purposes. I have switched to the IWDG and everything works fine.

All the best,

Zach