Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SparkFun Qwiic Micro SAMD21 - High Sleep Current #59

Closed
adamgarbo opened this issue Nov 6, 2019 · 4 comments
Closed

SparkFun Qwiic Micro SAMD21 - High Sleep Current #59

adamgarbo opened this issue Nov 6, 2019 · 4 comments

Comments

@adamgarbo
Copy link

Hi there,

This morning I received the SparkFun Qwiic Micro - SAMD21 Development boards I ordered. The first thing I did was to measure the quiescent draw when in deep sleep and I noticed immediately that something was up. After cutting the power LED trace, I placed the board into deep sleep using the Arduino Low Power library. I ended up measuring a sleep current draw of ~350 uA and an active current draw of ~9.0 mA. This definitely gave me a sense of déjà vu, as I encountered the very same issue with my SAMD-based Adafruit Feather boards.

The good news it's a simple fix! The following lines of code need to be commented out in the wiring.c file in the SAMD board definition (lines 83-87). The SAMD21 pins are tri-stated by default, which is their lowest power consumption configuration (Section 42.6 of SAMD21 manual). Commenting out (or removing) these lines of code prevents the digital and analog pins from being set to INPUT mode.

// Setup all pins (digital and analog) in INPUT mode (default is nothing)
for (uint32_t ul = 0 ; ul < NUM_DIGITAL_PINS ; ul++ )
{
  pinMode( ul, INPUT ) ;
}

After doing so, I was able to achieve a sleep current of ~60 uA, which is about as low as you're going to get with this board and the AP2112 LDO.

Cheers,
Adam

@edspark
Copy link
Contributor

edspark commented Nov 13, 2019

This is great info! I'd like to put this into our hookup guide - giving credit to you, if you don't mind?

@adamgarbo
Copy link
Author

Hi Ed,

I don't mind at all! Better yet, should this become a commit to the SparkFun board definitions? Adafruit ended up making the same change to their SAMD board definitions. Unless there's some reason I'm not aware of that requires the pins to be initialized as INPUTs?

Cheers,
Adam

@edspark
Copy link
Contributor

edspark commented Nov 13, 2019

That is a good point, I don't see a reason for that to be in there.... I'll update after a conversation with some coworkers around here. Thanks again @adamgarbo 👍.

@edspark
Copy link
Contributor

edspark commented Dec 4, 2019

I can not believe it's been 28 days - I guess there was a holiday in there 🤔 . I've released a new build or our Arduino boards that has these changes implemented. Thanks again 👍 !

@edspark edspark closed this as completed Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants