Pages: [1]   Go Down
Author Topic: Help needed to get the SD card reader working  (Read 575 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I'm trying to get the SD card reader that follows with the itead studio 2.8" display to work but I'm failing . I'm using the ITDB02 arduino MEGA shield 2.1 to connect the display to the arduino due.  The display and touch functions are working ok, but any attempt to initialize the sd card in the sd-reader fails!!
I had tried the sdfat examples with all of the possible outputs but still i'm unable to get the sd-card initialized. I tried with 2 different sd cards (formated as FAT and FAT32) that I know are ok.

the code i'm using looks like this:

pinMode(sd_cs, OUTPUT);
digitalWrite(sd_cs, LOW);
if ( !SD.begin(sd_cs) )
       Serial.println("SD card initialization failed");

I'm using the latest version of the sdFat library and the 1.5.3 IDE

I guess I'm missing some very basic here (because a lot of people are using sd cards without any problems) but I have no idea what it can be, so, please, is there any one with a similar configuration that can point out what the problem may be?
Logged

Venezuela
Offline Offline
Sr. Member
****
Karma: 12
Posts: 428
Ground.......ground........always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello pepito11,
Have you tried as follows:

Code:
pinMode(sd_cs, OUTPUT);
//digitalWrite(sd_cs, LOW);
if ( !SD.begin(sd_cs) )
       Serial.println("SD card initialization failed");

Regards.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I had tried that but no differences in the result: the initialization is failing!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

try this and use IDE 1.5:

void setup()
{
 
    Serial.begin(9600);       // for debugging
   
    // initialize SD card
    Serial.println("Initializing SD card...");
    if (!SD.begin(4)) {
        Serial.println("ERROR - SD card initialization failed!");
        return;    // init failed
    }
    Serial.println("SUCCESS - SD card initialized.");
}
Logged

Pages: [1]   Go Up
Jump to: