I recently acquired an SD card reader/writer for my Arduino but as I made to try the thing with some of the sample code I couldn't get any card to initialize.
I simply need directions on how to get the thing up and running, I've never worked in this area (memory storage) so i'm clueless.
I am using the SD card reader found at: Virtuabotix is under construction
and I have an arduino with the atMega328 if that makes any difrence
also My SD card is a 16 MB (but I have also tried a 4GB) and it doesn't have the two end end pads (it only has 7 pads for connection)
Thank you
since that card seems to be using resistors for level shifting you may have to slow down the SPI speed it uses to talk to it, which library are you using?
Don't try the 16MB card or do you mean 16GB card? 16MB card very likely needs 5V supply. The cheap module has a voltage regulator to take 5V down to 3.3V (I think) so you can safely install a modern day SD/SDHC card. As Osgeld pointed out, there is only resistors to shift logic level so you need to reduce SPI speed to make it work. Otherwise get a different module that has logic level shifter for full speed.
Liudr: Yes the card is 16MB but as I said i tried other SD cards (4GB) but I'll try it with some other SD cards.
Osgeld: I'm Using the SD.h library just as one would expect. If i have to change the speed how would I go about doing that.
KirAsh4: The link I provided had a link to the wiring instructions but just incase you didn't see them, here's a direct link: Virtuabotix is under construction
(Oh and I tried the example at that link, the Read/Write example, and the Card info example with the wiring showed on those)
If you need any more information just ask. thanks.
staressent:
Liudr: Yes the card is 16MB but as I said i tried other SD cards (4GB) but I'll try it with some other SD cards.
Osgeld: I'm Using the SD.h library just as one would expect. If i have to change the speed how would I go about doing that.
KirAsh4: The link I provided had a link to the wiring instructions but just incase you didn't see them, here's a direct link: https://www.virtuabotix.com/reference/index.php?title=SD_Card_Reader_Wiki
(Oh and I tried the example at that link, the Read/Write example, and the Card info example with the wiring showed on those)
If you need any more information just ask. thanks.
Definitely use the 4GB card. Are you using Arduino UNO or MEGA? Their SPI pins are located at different pins. How long are the wires you used? You should minimize the wire length.
I'm using the UNO (R3 with atMega328 as mentioned) and the SPI pins are 13, 12, and 11, right?
as for the wire length i don't get your reasoning, the wires are only about 6 inches (maybe) but since it's actually two wires (one duel male the other duel female) I suppose I can try some other wiring approach but i really doubt that's it.
And yes, I'll give the 4GB a few more tries.
staressent:
KirAsh4: The link I provided had a link to the wiring instructions but just incase you didn't see them, here's a direct link: https://www.virtuabotix.com/reference/index.php?title=SD_Card_Reader_Wiki
(Oh and I tried the example at that link, the Read/Write example, and the Card info example with the wiring showed on those)
If you are absolutely sure that you have all the wires, all EIGHT (yes, there are 8 total connections in that picture), and it doesn't initialize, try slowing down the SPI speed
// assuming you're using the SD library that comes with the Arduino IDE
//
// Using the CardInfo example, change the line that read
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
// to
if (!card.init(2, chipSelect)) {
// If that works, bump it up to 4, if it works, go up to 6 ... keep going till it fails and you've just discovered how fast you can push data.
NOTE: part of that sketch will still fail because the SPI speed is hard coded in the library as well. So don't expect all of it to work.
A better solution is to get the SdFat library and use that as it allows you to set the SPI speed once and it applies across the board.
The best solution however is to get a breakout with the proper level shifter on it, such as this one from Adafruit then you can set the SPI speed to LIGHT_SPEED* and not have to worry about it.
LIGHT_SPEED doesn't exists within that library. The equivalent for it is 'SPI_FULL_SPEED' ...
Well, I gave the SPI speed change a try but it still won't Initialize. Do you know of any way can set it up hardware wise rather than approaching it code wise? I'll keep trying a few more things with the code, but at this point i'm thinking it more of a hardware problem.
Okay scratch that. I just tried a difrent SD card (From any I've used before) and it worked. I don't know how but it worked (both with the cardInfo example and the Read/Write Example)
Thanks for all your help. I guess it's just a matter of SD cards.