I am trying to get the above SD Card interface board working with my Arduino UNO. The interface board includes a 5v to 3.3v regulator and appears to have appropriate resistors to cope with 5v signals from the UNO.
The pinout on the board is not directly compatible with the header on the UNO, so I have made up some connectors and I am fairly sure I have made the connections to the SPI correctly:
I/F Board Arduino Pin
CS 10
MOSI 11
SCK 13
MISO 12
I have tried supplying +5v, to derive 3.3v via the I/F card regulator and also supplied +3.3v directly.
My test program fails to find the card and returns "Card Failure", irrespective of whether there is a card present or not.
The card I am using is 2GB, formatted as FAT16 and contains a single file - "test.txt", the contents of which are simply:
test1,test2
I keep checking the card in a reader on my PC and, so far, I don't seem to have damaged it.
I would be grateful for any advice, please.
A fragment of the program is shown below:
//Program by Jeremy Blum
//www.jeremyblum.com
//SD Card Demonstration
//Based on Example by Tom Igoe
//Further adapted simplified by NGK to try and prove my SD Card interface board actually works!!!
#include <SD.h> // This is the standard SD library in version 0023
//These values are used by default in the standard SD Card Library
//MOSI = 11
//MISO = 12
//SCLK = 13
//We need to set the CS Pin - it's 10 for the UNO
int CS_pin = 10;
void setup()
{
Serial.begin(9600);
Serial.println("Initializing Card");
//CS Pin is an output
pinMode(CS_pin, OUTPUT);
if (!SD.begin(CS_pin))
{
Serial.println("Card Failure");
return;
}
Serial.println("Card Ready");
//Now read the File test.txt)
File commandFile = SD.open("test.txt");
if (commandFile)
{
Serial.println("Reading Command File");
while(commandFile.available())
{
char temp = (commandFile.read());
Serial.println(temp);
}
}
else
{
Serial.println("Could not open command file.");
return;
}
}


