[ATMEL-SAMD21] trouble implementing deepsleep

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
Posts: 1
Joined: Wed Aug 09, 2017 6:23 pm

[ATMEL-SAMD21] trouble implementing deepsleep

Post by donblair » Wed Aug 09, 2017 10:08 pm

Hi All,

We're looking to implement a low-power version of 'deepsleep' for the Feather M0 Express (which uses the Atmel SAMD21). Our first approach has been to use the watchdog timer, following the approach taken in the Adafruit "Sleepydog" library (we'd prefer to use the lowest-power, 'standby' sleep modes, but this seemed the easiest place to begin). So far, we've been successful in being able to sleep the board from within Circuitpython -- we're just not able to wake it up again :)

Various readings into implementations of 'deep sleep' in Micropython have led us to believe that our problem might be with the way that Circuitpython and Mircopython handle interrupts, and possible conflicts with our call to the WFI instruction when putting the board to sleep.

Any advice / guidance/ gotchas around writing sleep functionality within Micropython would be greatly appreciated!

Our fork of Circuitpython, implementing our attempted sleep code, is here: https://github.com/edgecollective/circuitpython

Don & Craig

Post Reply