kriswiner / Dragonfly

Arduino sketches for use with the Dragonfly (STM32L4)
21 stars 6 forks source link

provide qspi chip select signal for lower power consumption #2

Open 8bitbunny opened 7 years ago

8bitbunny commented 7 years ago

i have a suggestion to reduce power consumption on the dragonfly, namely: use a chip select signal to the qspi flash. as it consumes more power when the chip select is high (which is always the case right now)

kriswiner commented 7 years ago

Hi Ramon,

Yes, this is true but it is pulled up with a 100 K resistor so the current draw is ~30 microAmps when selected (LOW). The #CS is connected to STM32L4 PB11 so it is possible to deselect this by holding this pin either Hi-Z or HIGH and avoid this current.

The 16 MByte Macronix chip we are using has a deep power down mode that consumes 2 microAmp but we have not probed the very low power modes of the Dragonfly yet to confirm this.

We thought a lot about how to keep the overall power usage low on this board which is one of the main features of the STM32L4 line, but we are still in beta testing mode and it's possible we missed an opportunity. I think the QSPI flash design is probably not one of them though.

Thanks for your suggestion, we'll take a closer look in the weeks ahead as testing progresses.

Kris

-----Original Message----- From: Ramon Schepers [mailto:notifications@github.com] Sent: July 18, 2016 1:38 PM To: kriswiner/Dragonfly Subject: [kriswiner/Dragonfly] provide qspi chip select signal for lower power consumption (#2)

i have a suggestion to reduce power consumption on the dragonfly, namely: use a chip select signal to the qspi flash. as it consumes more power when the chip select is high (which is always the case right now)

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/Dragonfly/issues/2 , or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qqv-jrJIgKoiiMXqftjHx rhkA0SVks5qW-QjgaJpZM4JPHaV . https://github.com/notifications/beacon/AGY1qoOWqFjnetAmN4DSKzp51Y8f3kXiks5 qW-QjgaJpZM4JPHaV.gif

kriswiner commented 7 years ago

Interesting thought. I need to check what it is actually doing. There is the QSPI interface, which gets powered down during non-use. Wonder what STM32L4 does, keep the signals at the default, or Hi-Z.

-----Original Message-----

From: Kris Winer onehorse@earthlink.net Sent: Jul 18, 2016 3:18 PM To: 'kriswiner/Dragonfly' reply@reply.github.com Cc: 'Thomas Roell' thomas.roell@earthlink.net Subject: RE: [kriswiner/Dragonfly] provide qspi chip select signal for lower power consumption (#2)

Hi Ramon,

Yes, this is true but it is pulled up with a 100 K resistor so the current draw is ~30 microAmps when selected (LOW). The #CS is connected to STM32L4 PB11 so it is possible to deselect this by holding this pin either Hi-Z or HIGH and avoid this current.

The 16 MByte Macronix chip we are using has a deep power down mode that consumes 2 microAmp but we have not probed the very low power modes of the Dragonfly yet to confirm this.

We thought a lot about how to keep the overall power usage low on this board which is one of the main features of the STM32L4 line, but we are still in beta testing mode and it's possible we missed an opportunity. I think the QSPI flash design is probably not one of them though.

Thanks for your suggestion, we'll take a closer look in the weeks ahead as testing progresses.

Kris

-----Original Message----- From: Ramon Schepers [mailto:notifications@github.com] Sent: July 18, 2016 1:38 PM To: kriswiner/Dragonfly Subject: [kriswiner/Dragonfly] provide qspi chip select signal for lower power consumption (#2)

i have a suggestion to reduce power consumption on the dragonfly, namely: use a chip select signal to the qspi flash. as it consumes more power when the chip select is high (which is always the case right now)

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/Dragonfly/issues/2 , or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qqv-jrJIgKoiiMXqftjHx rhkA0SVks5qW-QjgaJpZM4JPHaV . https://github.com/notifications/beacon/AGY1qoOWqFjnetAmN4DSKzp51Y8f3kXiks5 qW-QjgaJpZM4JPHaV.gif

arthurv commented 6 years ago

Is there a code example using the QSPI port with the Macronix chip (ie. reading and writing)? I've looked through the SPIFlash test examples and they only use SPI.

I'm also exploring the deep power down modes of the Dragonfly, I've so far gotten it down to ~0.9mA. The Ladybug goes to ~0.2mA. Trying to identify how much it is due to the flash chip...

kriswiner commented 6 years ago

The flash chip will consume ~10 uA when idle in normal mode, and ~2 uA in deep power down mode.

Here is an example of how to read and write to/from files on the QSPI chip on Dragonfly:

https://github.com/kriswiner/Dragonfly/blob/master/Dragonfly_Serial_FirmwareUpload.ino

Here is an example of how to run at ultra-low-power using Ladybug. I use STM32.stop(); where the current usage of the Ladybug is ~2 uA. With sensors and flash memory the current is ~50 uA.

Not sure what you are doing but ~1 mA is waaaaay too high.

On Thu, Mar 15, 2018 at 1:12 AM, arthurv notifications@github.com wrote:

Is there a code example using the QSPI port with the Macronix chip (ie. reading and writing)? I've looked through the SPIFlash test examples and they only use SPI.

I'm also exploring the deep power down modes of the Dragonfly, I've so far gotten it down to ~0.9mA. The Ladybug goes to ~0.2mA. Trying to identify how much it is due to the flash chip...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/Dragonfly/issues/2#issuecomment-373294391, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qhvA4hHxsJGuFqZ9DdpyHjlXg353ks5teiJSgaJpZM4JPHaV .

arthurv commented 6 years ago

Thanks!

I realised part of that was due to the power LED being on, disconnecting the solder jumper brought it down to 0.25 mA. (L476RE) The Dragonfly L496 is about 0.3mA in stop mode. Out of the box it was indeed 0.9mA, which matches what manitou48 found during alpha testing (https://github.com/manitou48/STM32L4)

I'll try standby and shutdown modes too but will have to assess the impact of losing SRAM contents on the sketch.

The Ladybug was consuming about 0.3 mA in an "out of the box" condition with STM32.stop(), but cutting the power LED jumper again brought it down to 2uA in stop mode.

I'll write up some user guides as I explore the DOSFS and low power features.