Go Down

Topic: Newbie needs help with SD card not initializing with sd.begin (Read 346 times) previous topic - next topic

orbitcoms

I have read a few posts but do not have a clear answer to this. If I follow the SD card info example, the card initializes and displays card info ok, but when I attempt to use the example to read and write (using sd.begin) the program locks up trying to init card. I also tried running SPI half speed for SD.begin but still locks up.

This works...

#include <SPI.h>
#include <SD.h>

Sd2Card card;
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
   Serial.println("card error");
}
else{
  Serial.println("SD card ok");
}

This locks up

#include <SPI.h>
#include <SD.h>

if (!SD.begin(chipSelect)) {
   Serial.println("card error");
}
else{
  Serial.println("SD card ok");
}

Go Up