SD Library fails to connect

syntesys

Member
Hi all,

I'm trying to use SD Library with a Catalex SD Card Adaptor but I have problems with SD.begin().
When the sketch runs the SD.begin(), it fails everytime with original library; if I modify the begin() method using SPI_QUARTER_SPEED, it works.

Now, could you add another constructor that can have in input the pin and the SPI Speed?

This is the snippet that fails:

Code:
#include <SD.h>

int chip_select = 10;

void setup() 
{
  pinMode(chip_select, OUTPUT);
  Serial.begin(9600);
  while(!Serial);
  if (SD.begin(chip_select) == false) 
    Serial.println("SD.begin() fails");
  else
    Serial.println("OK");
}

void loop() {}

... and this is how I imagine the new constructor:

Code:
#include <SD.h>

int chip_select = 10;

void setup() 
{
  pinMode(chip_select, OUTPUT);
  Serial.begin(9600);
  while(!Serial);
  if (SD.begin(chip_select, SPI_QUARTER_SPEED) == false) 
    Serial.println("SD.begin() fails");
  else
    Serial.println("OK");
}

void loop() {}

Thank you.
 
Hm i think its better to use good adapters, instead.

You're right, but I've bought this for some tests and after the tests it's fine for the project I'm building.
The new constructor will allow the people to set also SPI_FULL_SPEED.
 
Back
Top