Go Down

Topic: Can't initialize SD card (Read 5228 times) previous topic - next topic

shiznatix

I am trying to use this SD card reader on an Arduino Mino but I can't seam to get it to work.

When I try to initialize the SD library, it always fails. I have been using this tutorial because it is the only tutorial I can find for this reader. Every time I run the code that is on that page though, I get "initialization failed!". I have tripple checked my wiring and the SD card reader lights up when I power the Arduino but thats all.

Since that tutorial is for the Uno, is there anything special I should know about the Mini (not Pro Mini)? I have never used an SD card reading with an Arduino before so any tips would be appreciated.

spycatcher2k

I need to but branded SD cards to use on my readers, the cheaper ones just won't work. UNO or Mini - no real difference. Take a photo of you wiring, a fresh pair of eyes may see something.
Mrs Drew
-=-
UK Based PCB Manufacturing - PM for details
I will design & code for you, but I will also charge you (PM me)
Use Google or search this site BEFORE asking!

shiznatix

Sadly I dont have a camera but the one thing I don't have wired up is the 3.3v power pin on the SD card reader. Since the Mini doesn't have a 3.3V pin I just wired up the 5V pin (the reader has both 3.3V and 5V pins), would that be an issue?

As for the wiring, I have both Gnd wired and the rest goes:
SCK - pin 13
MISO - pin 12
MOSI - pin 11
SDCS - pin 4

As for the SD card brand, it is a Sony SR-4C4 so I dont think the quality is lacking.

spycatcher2k

Is that not a 4Gb card? The advert states up to 2Gb cards supported.
Mrs Drew
-=-
UK Based PCB Manufacturing - PM for details
I will design & code for you, but I will also charge you (PM me)
Use Google or search this site BEFORE asking!

shiznatix

Whoops, ok, I am trying with a new SD card now (2GB pq1) but the exact same problem still.

spycatcher2k

Maybe it does need 3.3 V connected then
Mrs Drew
-=-
UK Based PCB Manufacturing - PM for details
I will design & code for you, but I will also charge you (PM me)
Use Google or search this site BEFORE asking!

shiznatix

I just tried with a spare Arduino Micro, connected both voltage pins, and the same thing. I also tried a 2nd SD card reader (same type, just have 2 of them) and I get the same results.

spycatcher2k

and you have connected the 2 grounds together?
Mrs Drew
-=-
UK Based PCB Manufacturing - PM for details
I will design & code for you, but I will also charge you (PM me)
Use Google or search this site BEFORE asking!

shiznatix

I have tried with the grounds connected to eachother and with them connected to a seperate Gnd pins on the Arduino, same thing every time.

If it doesn't init, would it be more likely that it is the SD card itself or the reader?

spycatcher2k

Impossible to say! Could be you've been ripped off on DX , an incompatible card, incorrect wiring, or no operational library.
Mrs Drew
-=-
UK Based PCB Manufacturing - PM for details
I will design & code for you, but I will also charge you (PM me)
Use Google or search this site BEFORE asking!

shiznatix

Hummm, so no other ideas? Are there any other libs that I could try? What can cause it to fail, is there any debugging I can turn on for the SD card library to see where it fails to init?

larryd

I never got the one I have like that to work consistently.
These use a proper proper level shifting design. And work all the time for me!
https://www.adafruit.com/products/1141     Also has RTC built in!
https://www.adafruit.com/products/254
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

TommiP

Hey shiznatix, I was wondering, are you using SD-card or are you using micro-SD with SD-adaptor?

I had similar problem with same example code and with same SD-card reader and I couldn't solve the problem except by using SD-card instead of using micro-SD with an adaptor.. I tried everything, but it just didn't work, though.. After I ditched adaptor, it has worked like a dream..  :)

Kinnishian

Make sure to try "sdfatinfo" and "quickstart" in addition to the basic example sketch.  That could tell you a little bit.

Liamthe1st

:)  That could be very useful information for members who are using Uno and Yun with a Raspberry Pi B.
The Model B uses standard size cards and adapters that could explain a great deal.

:D

Hey shiznatix, I was wondering, are you using SD-card or are you using micro-SD with SD-adaptor?

I had similar problem with same example code and with same SD-card reader and I couldn't solve the problem except by using SD-card instead of using micro-SD with an adaptor.. I tried everything, but it just didn't work, though.. After I ditched adaptor, it has worked like a dream..  :)
Communication is not good when it goes wrong.  
But now I have an Apple Mac so no more windows problems.  Good luck with 8, 8.1, 8.1.1 & 9

Go Up