5
\$\begingroup\$

I got a new microSD shield from LittleBird and am having some troubles with it.

I downloaded the sample library that it said to used, threw in a microSD card and expected it to work... It won't initialise for some reason, and I have done a bit of googling and can't see how to get it working. Everyone just say use this library, use that one.

Hardware

Is the SDHC card part of the problem?

I work off a Mac and even formatted the card on a Windows XP machine to fat 16, but still no luck.

\$\endgroup\$
2
  • \$\begingroup\$ I haven't seen the LBE code, does it give any more information about why it won't initialize? Also, is the hardware list up there complete, or are there any other sensors/whatnot connected? \$\endgroup\$ – Lou Mar 29 '10 at 12:49
  • \$\begingroup\$ related: Arduino Saving Data to SD Memory Module \$\endgroup\$ – davidcary Oct 19 '12 at 16:21
2
\$\begingroup\$

I am adding a microSD card to my new '644 board to make a low-cost data logger. All my boards are 3.3 V, so I won't have the 5 V issues. I have tried three different libraries and none of these initialize the cards :( I have also tried three different SD and SDHC cards from two different manufacturers (all large capacity) and none initialize.

I have my logic analyzer on the board now, and I am reviewing the specification. It looks like the initialization procedure is different for the newer card. I am almost certain that the SDHC is different. There is no response to the initialization routine.

From a lot of googling I have found out the following:

NB: (I have not verified this information, only found it ;)

  • Using the resistor dividers to translate from 5 V to 3.3 V can be problematic due to loss of edge speed due to the series resistance. I am not sure how much edge speed is lost or how sensitive different cards are to this. Since this is not an issue for my 3.3 V board I wasn't worried.

  • If the I/O pins are not at 0 V when power is applied to the card the card may be startup in an unknown state. Unfortunately the datasheet does not mention if there is a software initialization procedure that can be used to reset the card to a known state.

  • In version 2.00 of the SD specification the initialization procedure changed. I am not sure if the libraries support these changes.

  • Some people have reported success changing to low-capacity cards. I was hoping to find a low capacity at the office supply store, but the smallest they had in stock was 2 GB. I am suspecting that it may not be the size of the card, but the age (since most smaller cards are also older cards).

  • SPI support is optional for microSD. I would be surprised if cards didn't support SPI since if is required for the other formats. I was hoping to find a list of cards that were known to support SPI, but I could not find it.

That is where I am at. Unfortunately I probably won't have much time to work on this during the week. My next step is to go through the specification and write a simple initialization function and verify the output on the logic analyzer.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ I have used resistor dividers to bring a 5v signal down to 3v3 without problem on SD devices over SPI and haven't had problems. From what I've seen on the scope, it's not a significant issue at slower speeds. Good thing to point out for anyone running a card at higher speeds! \$\endgroup\$ – Lou Mar 29 '10 at 18:25
  • \$\begingroup\$ Also, I was going to suggest trying a smaller card earlier but I got busy at work. I have not found a card that hasn't worked, but I've heard that if you keep cards to 2GB and lower, your luck is better. For reference, all my SD cards that I've used in projects are leftovers/salvage which are years old. I think the newest one I've tried is around a year old. \$\endgroup\$ – Lou Mar 29 '10 at 18:28
  • \$\begingroup\$ This must be opposite day. I haven't found a card that works ;) If you have any info on the cards that do work (mfg/mfg pn) that would be great. Also what hardware/software are you using? Thanks. \$\endgroup\$ – jluciani Mar 29 '10 at 19:21
2
\$\begingroup\$

Unless the library specifically includes SDHC support, it won't work. SDHC and SD have different addressing modes and a few differences in their initialization routines, and it's enough to keep it from working. Get a 2GB or smaller SD.

\$\endgroup\$
1
  • \$\begingroup\$ I will see if i can get one i think there a bit rare now \$\endgroup\$ – Ashley Hughes Apr 1 '10 at 19:55
1
\$\begingroup\$

I believe I have found my microSD problem! Hopefully this will help someone else.

My main problem was a schematic error :( While looking for the schematic error I found a couple of other potential issues --

  • For SPI operation all the RSV lines (pins 1 and 8) need to have pull-ups even though they are not used (Samsung microSD datasheet pg 14 (version 0.3, Mar 7 2007)). I am not sure if this is a Samsung requirement or a MicroSD requirement. Also recommended are pullups on all the RDAT lines and the RCMD line.

  • At least 8 clock pulses are required before the card will give a response to a command. This wait is labeled NCR in the Samsung DS and has a minumum value of 8 (pulses) and a maximum value of 64 (pulses).

I have tried a Transcend 1GB and SanDisk 2GB uSD card. Both initialize to idle state. I am now going to finish the uSD libraries for my '328 and '644 boards. If I discover any other hardware or software issues I will try to update this post.

\$\endgroup\$
1
\$\begingroup\$

I haven't any of these toys but I saw this requirement for a TFT/LCD module including an SD slot : "You must use a micro SD card that supports the SPI interface, and is 2GB or less. Please note that not all uSD cards support SPI."

http://www.robotshop.com/eu/4d-systems-3-2-qvga-touch-screen-lcd-3.html

\$\endgroup\$
1
\$\begingroup\$

I got one of these, too, from SparkFun, and it only kind of worked. I checked out the comments at the bottom of the product page, and there might be a couple of issues:

  1. The size of your card
  2. 3.3 V -> 5 V incompatibility.

The last comment looks promising. I used SparkFun's diode scheme to connect a 3.3 V pressure sensor to an Arduino, and it worked just fine.

See SparkFun microSD Shield.

\$\endgroup\$
1
  • \$\begingroup\$ I have designed a few boards with SD cards (not micro, but electronically I believe the SPI is the same). I would definitely start with looking at the voltage levels, because I was only able to get reliable results at 3v3. 5v is asking for trouble. \$\endgroup\$ – Lou Mar 29 '10 at 12:50
0
\$\begingroup\$

It is unlikely that this is your problem, but the microSD standard does not list SPI compatibility as compulsory. A while back I had a specific microSD that wasn't talking to my AVR and I could have sworn it was because it was missing an SPI interface.

Perhaps try another card of a different brand?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.