Go Down

Topic: Pullups/Pulldowns for microSD pins? (Read 9907 times) previous topic - next topic

SVFeingold

I have been struggling for some time to get a clear answer on whether pull-ups or pull-downs are necessary on microSD cards used in SPI mode. Or if not necessary, then at least desirable.

So far the best I have been able to come up with from several sources is that they *might* be necessary on the two data lines. The only recommended values I've seen are 50k/100k.
I've also seen sources adding that a pull-down on the clock line can be good to have but no values were given.
I've also seen a couple sources mentioning the unused pins (those labeled NC or simply reserved/command pins not used in SPI mode) should have pull-ups also.

I'm using an Arduino Pro Mini (3.3V) and a standard microSD slot (bought on Sparkfun). I have the Arduino pins connected in the manner suggested in the reference for SPI communication:

CS - Pin 10
MISO - Pin 12
MOSI - Pin 11
CLK - Pin 13

Here is an image of my current microSD connections:


As of now I plan to leave these in just to have the pads available if they do become necessary. All I am using this for is reading small (3kb) monochrome bitmaps to display on an OLED screen. However I want to devise the most robust solution to ensure there will not be any problems as they will result in a service call. I have read stories of some cards not working if you don't pull-up certain pins you would normally ignore (those labeled "NC" for example) and I don't want this to happen. Once the card is installed it is essentially a permanent fixture, so card compatibility is not an issue at that point. But...I don't want any frustration while prototyping either.

Currently the CD1 and CD2 pins are unconnected but I may pull these up as well if that would be wise. As for values I really don't know what to use so for now I may stick with the 50k-100k suggestion I saw on another forum. The microSD component in eagle is taken from the SparkFun library.

Any help would be appreciated! Thanks!

nickgammon

I'm not certain about SD cards, but in principle I think a pull-up would be sensible to ensure that random data isn't clocked into the chip while the main processor is booting and its pins in an uncertain state.

Personally I think I would pull-up CS high (so it is not selected) and SCK low (so it doesn't clock). With those two like that the values on the other pins are probably unimportant.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

CrossRoads

A pullup on anything other than CS is a wasted part.
Using the '328 internal pullups on the card detect pins is sufficient.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

SVFeingold

Funny I had assumed that /CS wouldn't need a pull-up...I suppose if the chip is unselected then it will ignore input on the clock/data lines anyway.

As for the card detect pins, there are no more pins available to connect them to, so the pullup would have to be external.

CrossRoads

I would put a pullup on the CS coming from the ATMega - then when the ATMega pins are inputs after a reset, power cycle, etc. for some undetermined time until your skeetch starts and makes the pin an output and drives it high, the CS line will be ensured to be high by the external pullup resistor and not corrupt the SD card.

"As for the card detect pins, there are no more pins available to connect them to"
Then no pullup is needed. Those are mechanical switches that are opened/closed with card insertion. If you are not going to detect hi/lo on them, you don't need pullups.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

nickgammon


Funny I had assumed that /CS wouldn't need a pull-up...I suppose if the chip is unselected then it will ignore input on the clock/data lines anyway.



I don't understand your logic there. In order to ensure the chip is unselected during the boot sequence /CS is the very one that needs a passive pull-up. That would be my most important one to address.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

SVFeingold

Can't say there was much logic involved in that particular assumption...

For these pullups I already have a number of 10k SMT resistors, will those be acceptable or should I go ahead and order some higher value ones?

nickgammon

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

krs013

FWIW, in the SanDisk SD card spec, they say specifically say "The 'RSV' pins are floating inputs. It is the responsibility of the host designer to connect external pullup resistors to those lines. Otherwise non-expected high current consumption may occur due to the floating inputs."

Go Up