Go Down

Topic: Weird SD card problem!! (Read 920 times) previous topic - next topic

rodrigo moreno

Feb 14, 2012, 09:14 pm Last Edit: Feb 14, 2012, 09:18 pm by rodrigo moreno Reason: 1
Hello everybody,

I am having problems with different SD cards in my project so to be sure, I made a simple test. I use seeedstudio Stalker (http://www.seeedstudio.com/depot/seeeduino-stalker-v2-p-727.html?cPath=80)
and the basic example read write from SD.h library (http://arduino.cc/en/Tutorial/ReadWrite), I only change "SD.begin(4)" to "SD.begin(10)".

Now the problem is that if I use this SD card it works fine:



If I use another 1 Gb micro SD card that I bought in china, doesn´t work. The SD cards work fine in the PC, so I have no idea what's the problem. Both are formatted with FAT 32 and and default unit size.

mmcp42

in what way "doesn't work"?

you sure it's FAT32, I thought only FAT16 worked?
there are only 10 types of people
them that understands binary
and them that doesn't

rodrigo moreno

When it calls the function "SD.begin" it returns 0, so it shows the message "initialization failed!" in the serial monitor.

I tried formatting in FAT (I assume it is FAT 16) with differents unit sizes, and FAT32, also with differents unit sizes. All of of them shows the same error. If I use the Kingston SD card, it works in both, FAT and FAT32. I have no idea what could be the problem.

RuggedCircuits

Two things come to mind. First, the "China" card may not be designed to work in SPI mode since 99.9% of the people buy SD cards to work with things other than Arduinos :)  Yes, the SD spec says all cards must work in SPI mode...but if you can sell cards to 99.9% of your customers without complaint, they get away with it.

Second, it could be hardware differences in the card causing communication problems. Many people have noted that using resistor level shifters with SD cards often causes problems. That's not to say this is the problem in your case: the Stalker is a 3.3V board so there is no level translation. It does, however, highlight that SD cards are sensitive (in general) to the quality of the digital signal. I don't know how the Stalker is routed on the PCB but if the traces are "long" there could be significant ringing or reflections on the SPI lines. The Kingston card tolerates these, the China card may not.

--
The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins

rodrigo moreno

Thanks RuggedCircuit!

I contacted the supplier, to ask if there is a possibility that the SD doesn't support SPI mode.
I will also try FEZ Panda to read the SD, just to try another hardware.

If anybody has any other idea please let me know

Thanks!!

Go Up