Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Low-Power with a hardware watchdog? #85

Open
Bambofy opened this issue Jun 3, 2019 · 3 comments
Open

Using Low-Power with a hardware watchdog? #85

Bambofy opened this issue Jun 3, 2019 · 3 comments

Comments

@Bambofy
Copy link

Bambofy commented Jun 3, 2019

Hi, i need to ping a watchdog frequently to keep the Arduino running.

Am i ok to loop say, 10 times, and perform a SLEEP_60MS multiple times, pinging the watchdog after each sleep?

@Bambofy
Copy link
Author

Bambofy commented Jun 3, 2019

Like this:

 int numberOfLoopsToPerform = (int)numberOfLoopsInDelay;
  
  for (int i = 0; i < numberOfLoopsToPerform; i++)
  {
    Pin_Interface_WatchdogHeartbeat();
    
    LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF);
  }

@robervaltaylor
Copy link

robervaltaylor commented Aug 30, 2020

Related to #89 ?

@mariovaldez
Copy link

Yes, that will work, I use similar code with external watchdog timers (like the TPS3828 or a second MCU). I just would just make sure the external watchdog signal is send not only before sleeping but also on wake up, so your code would be:

  int numberOfLoopsToPerform = (int)numberOfLoopsInDelay;
  for (int i = 0; i < numberOfLoopsToPerform; i++)
  {
    Pin_Interface_WatchdogHeartbeat();
    LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF);
  }
  Pin_Interface_WatchdogHeartbeat();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants