LowPowerLab Forum

Hardware support => Low Power Techniques => Topic started by: arf on June 07, 2021, 10:09:17 PM

Title: Is LowPowerLab Low-Power Library only for Moteinos?
Post by: arf on June 07, 2021, 10:09:17 PM
Is the LowPowerLab Low-Power library only compatible with Moteinos? 

I tried to compile a simple example on an Adafruit M0 but it is giving a compilation error saying that the chosen MCU is not a SAMD21. 
Title: Re: Is LowPowerLab Low-Power Library only for Moteinos?
Post by: Jason on June 07, 2021, 11:46:08 PM
Per the README file:

Quote
Lightweight low power library for AVR/SAMD21 Moteino boards.
By Felix Rusu, LowPowerLab.com
Forked from Low-Power.

Date: 08-08-2018

Devices Supported:

ATMega168
ATMega328P
ATMega32U4
ATMega644P
ATMega1284P
ATMega2560
ATMega256RFR2
ATSAMD21

Therefore it should "work" with a feather since it uses an ATSAMD21 but will need tweaking since I doubt the pin out on the feather matches the Moteino M0. If you pretend it is a MoteinoM0 and select that in the arduino IDE (see link below on how). I think it should "work" but not all the pins may match up.

https://lowpowerlab.com/guide/moteino/moteinom0/

This is all a hypothesis as I have not used either the moteino M0 nor the adafruit feather. I have used some knock off Arduinos as Moteinos and that has worked out though when the pinouts were different it added a level of complexity. For faster and easier prototyping I found it worth it to start out with the Moteino and branch if I wanted to later.
Title: Re: Is LowPowerLab Low-Power Library only for Moteinos?
Post by: Felix on June 08, 2021, 09:24:37 AM
Should work as long as it's a SAMD21, but it depends how adafruit defines their MCUs in the board definitions. You may want to choose a MoteinoM0 as target instead, though the pins may differ indeed.
Title: Re: Is LowPowerLab Low-Power Library only for Moteinos?
Post by: arf on June 16, 2021, 11:09:32 PM
I couldn't get any of the examples in that library to compile when I plugged in a moteino m0 and of course chose that as the board type
Title: Re: Is LowPowerLab Low-Power Library only for Moteinos?
Post by: Jason on June 17, 2021, 02:41:00 AM
It appears this library has limited functionality with SAMD21 based microcontrollers including the M0. (Or atleast limited examples).

See: https://lowpowerlab.com/forum/moteino-m0/compilation-error-for-examples-'please-ensure-chosen-mcu-is-a-samd21'/msg29041/?topicseen#msg29041
Title: Re: Is LowPowerLab Low-Power Library only for Moteinos?
Post by: Felix on June 17, 2021, 12:47:06 PM
Looks like the newer versions of the SAMD cores no longer define __SAMD21__.
I patched the library (https://github.com/LowPowerLab/LowPower/commit/833c2bd474d759fdf2a5da8f43b343e3a76d3632) to look for ARDUINO_SAMD_ZERO instead. Should support all arduino boards that have that #define ARDUINO_SAMD_ZERO in their board definitions.
Please get latest and retry. The idle and standby sleep modes for SAMD21 are supported.