[TriEmbed] some progress with sleep modes using Arduino M0 (ATSAMD21)
Pete Soper
pete at soper.us
Thu Feb 22 08:19:01 CST 2018
Thanks for the update, Alex. This is very interesting.
-Pete
On 02/22/2018 09:03 AM, Alex Davis via TriEmbed wrote:
> I finally got my Adafruit M0 Adalogger board to sleep without
> crashing, as well as to get a LIS3DH accelerometer to do both event
> interrupt triggering and continuous readout. It’s not a full success,
> however, as measuring current draw shows the M0 does not always go to
> actual low-power mode. The best I have achieved so far as about 2mA -
> that’s pretty poor. Worst case “sleep” was 18 mA.
>
> I’m using the LowPower.h library. Yes, that is lazy and I should be
> setting the registers manually etc…
>
> I think also there are some subtleties with the ATSAMD21 concerning
> the stack and vectors with interrupts and sleep. If I keep my
> sleep/wake within main(), it works fine, but if I try do it within a
> function as part of a switch-case state machine, it fails or appears
> to run the wrong code.
>
> I would not recommend the ATSAMD21 for low-power projects when using
> Arduino. The Adafruit M0 products in particular do not have a JTAG
> interface, so you’re reduced to using LEDs to try to debug, since
> sleeping shuts down the USB serial interface. I think if you want to
> use the Feather stuff and want low-power, stick with the 32u4 models.
>
> I put my working and non-working code here on my github:
> https://github.com/quarterturn/feather-m0-sleep-shake-project
>
> I can probably accept a 2mA draw in sleep mode. I have a 110 mAh
> battery, and at 2 mA standby and the occasional 15 mA during recording
> it should last a whole night. I just have to figure out why the exact
> same sleep command behaves differently at times.
>
> Alex
>
> |\ | (¯ \/ |¯\ |V| |\ ¯|¯ |¯) | \/ | | | |¯\ (¯ /¯ /\ |V|
> |-||_ (_ /\ |_/ @| | |-| | | \ | /\ |^| | |_/ (_ . \_ \/ | |
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Triangle, NC Embedded Computing mailing list
>
> To post message: TriEmbed at triembed.org
> List info: http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> TriEmbed web site: http://TriEmbed.org
> To unsubscribe, click link and send a blank message: mailto:unsubscribe-TriEmbed at bitser.net?subject=unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20180222/cfc6c6e8/attachment.htm>
More information about the TriEmbed
mailing list