Moteino M0 vs Arduino Zero Board Definitions

Started by adam.g, November 08, 2018, 10:37:32 AM

adam.g

Hey Felix,

I spotted a post over on the Arduino forums that was asking about the differences between the Moteino M0 and Arduino Zero board definitions. The author of the post was getting a much reduced quiescent current when compiling and uploading his code to an Adafruit Feather RadioFruit M0 board when selecting the Moteino M0 board in the Arduino IDE and was curious why this was occurring. I thought I'd give you the heads up in case you wanted to chime in!

Here is the post: http://forum.arduino.cc/index.php?topic=578180

Cheers,
Adam

Felix

Thanks Adam!
Nice to have a forum watchgdog :)
The answer is already there looks like, essentially there are some pin input initializations that are omitted in the Moteino M0 definition.

Felix

Adam,
Saw your follow up on the arduino forum, I haven't checked but adafruit's definition pins might be arranged differently.
Also, the MoteinoM0 can actually reach sub 10uA, a magnitude less current consumption, something to consider for true low power applications.

adam.g

Hi Felix,

Thanks for the update! Yes, I believe Adafruit breaks out the M0's pins a bit differently on the Feather. For example, their voltage divider, which is mapped to A7, doesn't appear to work properly when selecting the Moteino M0 board. Given that Adafruit isn't known for their power efficiency, I was still surprised though to see how much the quiescent current was able to be decreased just by using the Moteino M0 board definitions.

Looking forward to receiving my Moteino M0 order later this week!

Cheers,
Adam

Felix

Would have been nice if someone mentioned the MoteinoM0 power consumption when used with the MoteinoM0 definition, vs other boards with MoteinoM0 definition :)

adam.g

Quote from: Felix on November 08, 2018, 12:17:44 PM
Thanks Adam!
Nice to have a forum watchgdog :)
The answer is already there looks like, essentially there are some pin input initializations that are omitted in the Moteino M0 definition.

Hey Felix,

I was thinking about this more recently. Given that the Moteino M0 board definitions omit the loop that sets the digital pins as inputs (shown below), what does the default state of the pins on the M0 end up being? I couldn't seem to find this in the SAMD21 manual. It does say that unconnected pins should be left in their default state to obtain the lowest power draw, but it doesn't provide any details on what that default state is.

for (uint32_t ul = 0 ; ul < NUM_DIGITAL_PINS ; ul++ )
{
    pinMode( ul, INPUT ) ;
}

Cheers,
Adam


Felix

Look for this version of the datasheet (latest at this moment): DS40001882C
Mouser has it: https://www.mouser.com/datasheet/2/268/SAM-D21-Family-Datasheet-DS40001882C-1381353.pdf

Search for this section: "23.6.1 Principle of Operation"
It has a lot of detail there, and all the possible IO configurations.

adam.g

Quote from: Felix on November 15, 2018, 10:48:59 AM
Look for this version of the datasheet (latest at this moment): DS40001882C
Mouser has it: https://www.mouser.com/datasheet/2/268/SAM-D21-Family-Datasheet-DS40001882C-1381353.pdf

Search for this section: "23.6.1 Principle of Operation"
It has a lot of detail there, and all the possible IO configurations.

Thanks Felix!

According to the manual, "8.3.2 I/O Pins After power-up, the I/O pins are tri-stated." So it looks like the default state of the pins with the lowest current leakage is when they're in this tri-state. Is it actually possible to set the pins of the Moteino M0 to this state manually? For example, after having set them to an INPUT or OUTPUT.

Cheers,
Adam

Felix

From what I can tell there is not a way using standard arduino code.
I may add it myself if it becomes necessary. I have other plans as well to enable the many other features available on the pins, which are omitted in the arduino core.