1

Has anyone got sleep/standby + watchdog to work together on their Arduino Zero or Sparkfun SAMD mini?

I am able to get the WDT to reset the device, and am able to put it to sleep - but can't get the WDT to bring it out of sleep. Every time I try, it pops right back out of sleep mode again as if SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk was never even called

1 Answer 1

1

use this:

attachInterrupt(wakeUpPin, wakeupFunction, HIGH);
    USBDevice.detach();
    SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
    __DSB();
    __WFI();

void wakeupFunction(){
  NVIC_SystemReset();
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.