SD Card and Sleep or Low Power Mode
Moderators: David Barker, Jerry Messina
SD Card and Sleep or Low Power Mode
This is question is aimed at Steven, but please feel free to chime in if you know the answer. Basically, I am curious if there is a way to either "un-init" the SD card or put the SD card to sleep?
I am trying to adapt the SD GPS Logger code for use in a glacial monitoring system. But I am currently having trouble with a nagging 8mA that is being drawn in sleep mode. Due to some reliability issues I have had to tie the SD card to the 3.3V regulator so that it always has power. I previously had the SD card sitting behind a mosfet, but was having some issues "re-init" the sd card after cycling the power when using the mosfet.
I am trying to adapt the SD GPS Logger code for use in a glacial monitoring system. But I am currently having trouble with a nagging 8mA that is being drawn in sleep mode. Due to some reliability issues I have had to tie the SD card to the 3.3V regulator so that it always has power. I previously had the SD card sitting behind a mosfet, but was having some issues "re-init" the sd card after cycling the power when using the mosfet.
-
- Registered User
- Posts: 37
- Joined: Thu Dec 14, 2006 4:19 pm
- Location: Monkey Island, Oklahoma USA
I use the Mikro Elektronika MMC/SD board shown here
http://www.mikroe.com/en/tools/mmc/
Pin 10 of that board is ground. Instead of going to ground I tie that pin to the FET (BS170) drain, the source is to ground and the gate is to a PIC pin. That's it.
This way I turn off the whole board so that it's 3V power supply doesn't consume any power while off. You should initialize the SD card as if it was cold started, which it was. In software I give the SD card 100msec after I switch on the FET to power up before initializing. That gives the card time to hardware initilize after power is applied.
http://www.mikroe.com/en/tools/mmc/
Pin 10 of that board is ground. Instead of going to ground I tie that pin to the FET (BS170) drain, the source is to ground and the gate is to a PIC pin. That's it.
This way I turn off the whole board so that it's 3V power supply doesn't consume any power while off. You should initialize the SD card as if it was cold started, which it was. In software I give the SD card 100msec after I switch on the FET to power up before initializing. That gives the card time to hardware initilize after power is applied.
MOSFETs
I've been working with a datalogging project that needs to go low power for extended periods of time. I've been using a P-MOSFET as a power gate on the high side (3V3). As I built up the circuit and tested it, everything was fine, but when I added the SD card, my sleep current jumped from 40uA to 6mA! I tracked it down to the card. It seems that even when disconnected from the power line, the card is able to grab enough current through the SPI lines to continue functioning. Do you have this experience?
Now I'm sitting down for some serious re-work, rerouting the GND so that I can send it to an N-MOSFET. I'll post again when the test is done.
Thanks for the help!
Now I'm sitting down for some serious re-work, rerouting the GND so that I can send it to an N-MOSFET. I'll post again when the test is done.
Thanks for the help!
-
- Swordfish Developer
- Posts: 1469
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Very few chips are spec'd such that an input pin can exceed Vcc by more than a few tenths of a volt. Usually there's an input clamp diode on the signal pins to Vcc, so if you shut off Vcc the clamp diode conducts and powers the chip via the input line.
How about tri-stating the SPI signals (or setting them all low) when you turn off power?
How about tri-stating the SPI signals (or setting them all low) when you turn off power?
Yeah, it could very well be the anti-static clamps that are routing power through the SD card. The voltage I get on my meter when the micro is powered down is ~2.4V. Just about right for a diode Vf.
I may be able to set the SPI bus pins as inputs (high Z) before sleep, and that might work... Still in prototype, and if I can fix it in hardware it's still an option.
also, i like the higher currents that the N-MOSFET can provide.
My sand pile has BS250 and BS170 in it.
BS250 = 180mA max
BS170 = 500mA max
I may be able to set the SPI bus pins as inputs (high Z) before sleep, and that might work... Still in prototype, and if I can fix it in hardware it's still an option.
also, i like the higher currents that the N-MOSFET can provide.
My sand pile has BS250 and BS170 in it.
BS250 = 180mA max
BS170 = 500mA max
Hi,
I'm able to shut down the whole board with the P-Channel MOSFET (BS250) now, including the SD card, when I set the SS pin as input before I go into power down sleep mode. I did the old process of elimination test, and turns out MOSI and SCK have no effect. SS is the culprit. For the sake of simplicity in the long run, I may move to an N-MOSFET. The N-Channel has alot more going for it. I'm going to run the N- test soon and post the results.
The FDC6901L seems to be end of life. I've looked at Power Switches like this, but their price is too high for me
I do have to re-initialize after waking up, as you mentioned Tom.
Now I'm happily logging data and only drawing ~6nA during sleep.
I'm able to shut down the whole board with the P-Channel MOSFET (BS250) now, including the SD card, when I set the SS pin as input before I go into power down sleep mode. I did the old process of elimination test, and turns out MOSI and SCK have no effect. SS is the culprit. For the sake of simplicity in the long run, I may move to an N-MOSFET. The N-Channel has alot more going for it. I'm going to run the N- test soon and post the results.
The FDC6901L seems to be end of life. I've looked at Power Switches like this, but their price is too high for me
I do have to re-initialize after waking up, as you mentioned Tom.
Now I'm happily logging data and only drawing ~6nA during sleep.
Circuit
hi, here's a link to the work that I'm doing related to this thread.
http://www.solarduino.net/
Thanks for the help, Swordfish thread!
http://www.solarduino.net/
Thanks for the help, Swordfish thread!