Confusion about Deep sleep modes for M0 products

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Ebel
 
Posts: 3
Joined: Fri Jan 27, 2023 8:22 am

Confusion about Deep sleep modes for M0 products

Post by Ebel »

I just started off the Adafruit journey with the Adalogger M0. One setup with Arduino IDE, and the other with CircuitPython and MU IDE. Windows and Linux both at hand.

Maybe this is the wrong forum thread….but the issue is a common one for all devices with the same MCU

So far so good once overcoming the basic about (feather)boot, CircuitPy drive and overview of libraries. Etc.

Most important in any IoT project is current drain / power usage and battery life. All MCUs have a deep sleep mode. In which a program either halts, keeping the random access memory powered, or a power down state in which no dynamic memory is powered, and an interrupt is needed to restart. Here different libs are using a lot of different naming conventions, standby(), idle(), power_down() etc.

Which seems to be the hardest documentation to find good information on….always!

Let’s take this example
https://learn.adafruit.com/deep-sleep-w ... -and-sleep

https://docs.circuitpython.org/en/7.3.x ... index.html

So the 7.3.3 lib is suppose to have an alarm module available for import. But no. Not in the core UF2 made available for the Adalogger…

Searching in arduino forums and various lowpower.h libs just turns out a bunch of unanswered help requests.

Hey Adafruit: Please give some guidance, many thanks!

Ebel, Oslo, Norway
5 yrs. experience with nRF528xx and neighbour to Nordic Semiconductors

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: Confusion about Deep sleep modes for M0 products

Post by neradoc »

In Circuitpython, modules are available on the ports they are implemented on, and on the boards they are enabled on. To know what module is on what board, there is: Unfortunately, while the alarm module is implemented on the SAMD21 port, it is not enabled on most (any?) M0 board because the available space is very limited. The adalogger is a non-express board with no additional flash, meaning that CP and its drive have to fit inside the chip's flash itself. You can make a custom build by setting CIRCUITPY_ALARM in the board's configboard.mk file, and disabling other modules to make space.
https://learn.adafruit.com/building-circuitpython

For Arduino I don't know much, i have used the sleepydog library for a SAMD21 board that would sit outside and report temperatures from time to time via lora. It's a small duration sleep that has to be repeated in a loop for longer sleeps.
https://github.com/adafruit/Adafruit_SleepyDog

User avatar
Ebel
 
Posts: 3
Joined: Fri Jan 27, 2023 8:22 am

Re: Confusion about Deep sleep modes for M0 products

Post by Ebel »

Many thanks for this info and explanations, and prompt reply 👍👍
The support matrix was clear, and can be a good thing to advertise.
And links for how to do custom builds mk files.

I suspected that the size of CP w its on_board compilator and std libs compared to plain C eats up a lot of the SAMD21 flash.

With the variety of boards and different MCUs I appreciate that it’s challenging to create a support/ do not support on every board page.

As for the alarm module the sample page was very instructive, however for the novice of us, it lacked a compatibility list for the various boards. So it became a bit misleading for the CP newbie’s

BR

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”