<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I made a little progress by looking at this post: <a href="https://forum.arduino.cc/index.php?topic=420453.0" class="">https://forum.arduino.cc/index.php?topic=420453.0</a><div class=""><br class=""></div><div class="">I first moved my external interrupt over to A0, which is EINT2, and doesn’t seem to be shared by anything important. Then I added the following to my code:</div><div class=""><br class=""></div><div class="">REG_EIC_INTENSET = EIC_INTENSET_EXTINT2;</div><div class=""><br class=""></div><div class="">before the attachInterrupt()</div><div class=""><br class=""></div><div class="">and</div><div class=""><br class=""></div><div class="">REG_EIC_INTENCLR = EIC_INTENCLR_EXTINT2;</div><div class=""><br class=""></div><div class="">in the handler on wake. This seems to get things working, but not consistently. Sometimes it will wake up via tapping the accelerometer (as I want), and sometimes it acts like it’s not going to sleep at all.</div><div class=""><br class=""></div><div class="">Oh btw I had to do the following before calling __WFI() to get sleep to work at all:</div><div class=""><br class=""></div><div class=""><div class="">    //set System Control Register (SCR) sleep bit to deep sleep (do once so wfi (wait for intyerrupt)  in loop waits)</div><div class="">    //There are 2 sleep modes, idle and standby (deep) Sleep bit is SCR bit 2, 0 is idle, 1 is standby</div><div class="">    // SCB->SCR |= 0b00000100; //just a test to see how to code binary--this works</div><div class="">    SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;  // set to deep sleep (bit-1) by ORing with 100</div><div class="">     //SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;   //set to idle (bit=0) by ANDing with the inverse of above--leaves all bita alone except sleep, which ANDs to 0</div><div class="">    //  SCB->SCR &= 0b11111011;  //another test</div><div class="">    //There are 3 idle modes, 0 (CPU),1 (CPU,AHB clock),2 (CPU,AHB,APB). Set this if using IDLE</div><div class="">     PM->SLEEP.reg |= PM_SLEEP_IDLE_APB;  //idle turn off CPU, AFB, APB //Advanced Peripheral Bus (APB)   Advanced High-performance Bus (AHB)</div><div class=""><br class=""></div><div class="">M0 support is definitely still beta. Too bad.</div><div class="">
<div style="color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">|\ |  (¯  \/ |¯\  |V| |\ ¯|¯ |¯) | \/ | | | |¯\ (¯   /¯  /\ |V|</div><div style="color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">|-||_ (_  /\ |_/ @| | |-| |  | \ | /\ |^| | |_/ (_ . \_  \/ | |</div><br style="color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br style="color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br style="color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br style="color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br style="color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br style="color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">
</div>
<br class=""></div></body></html>