What are the best practices for WDT and BOD in low power mode?

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello! 

I have a low power project with a SAML21 powered by 2 AA cells. The mcu wakes up every 2 seconds to measure, and in case of a change of state, transmit data to my server. The RTC is configured to run with the ULP 32K oscillator. My questions are, 

1- What are the best practices to use the brown out detector and watchdog in low power applications? 

2- should I disable the watchdog and BOD in the "sleep" function and enable them again in the "wake" function? 

actually my code looks like this

<code>

void main (void)

{

configure rtc in 2000ms with callbacks;

configure wdt with WDT_PERIOD_16384CLK, always on false, enable true.

while(1)

{

kick wdt;

measure, compare, transmit if necessary;

sleep; (set performance level 0, disable xosc32k, set sleep mode standby)

}

</code>

With this code, I have some erratic watchdog resets.

thanks