LowPower using RTC on Express M4 SAMD51

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
neilh20
 
Posts: 2
Joined: Mon Dec 16, 2013 9:58 pm

LowPower using RTC on Express M4 SAMD51

Post by neilh20 »

I've created a characterization lib for putting the SAMD51 to low power sleep, and then waking up on the RTC.
For an IoT or Solar Powered installation its valuable for the off time or "sleep" to be as low power as possible. While 120Mhz is really nice for some applications, its also capable of being turned down.
While the built in USB is extremely valuable for Arduino easy boot startup, it also uses power.
So this characterization setup can turn off the USB Phy, and turns down the clock to 48Mhz from 120Mhz.
The current measurements using a USB current meter, powering an Express M4, clock 48MHz (for USB subsystem)
with USB running 11mA sleep 4.4mA. By re-initilzing the USB I also get it to successfully connect on wake
with Serial1 UART and FTDI connector - running 3.3mA sleep 1.3mA
with 120Mhz and USB active the running current is 26Ma with sleep at 8mA.

https://github.com/neilh10/LowPower/tre ... rRtcSAMD51

This is built on the work of others, so very much appreciate the work of LowPowerLab, and the originators of this "LowPower" lib rocketscream, and also the work of adafruit in the BSP package for the Express M4.
I've built it in platformio - but haven't include the platformio.ini yet - will try to do that later.

I've got a couple of questions if anybody has some insights :)

a) How to start or switch to an 8Mhz clock. For some reason I can't wind down the clock below 48Mhz, there are some nice PLLs for the high speed side, and data sheet says it should work to DC.
I set the clock on the cc so it initializes with a slow clock.
I think it doesn't come out of initialization - so I suspect its something to do with the USB subsystem still attempting to be initialized, but haven't figured out a way of over-riding the startup.cpp:SystemInit().

b) is it possible to detect if a capable USB Host is plugged in, versus just a USB power supply. I think there are a couple of DC settings on the data lines that indicate the difference between powering and host capable - but I haven't gone down that route

Ideally what I'm aiming to do is to start with a low power use-age 8Mhz Clock (for UART 115K debug state tracing),
if the USB is there switch to a 48Mhz clock, for the USB Subsystem, and startup the USB subsystem. Of course the double RESET push goes to the boot, which allows programming.

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”