SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By kirash4
#153912
I can't get this breakout to work ... kinda. I'm talking about the BOB-00544. Here's what I've done and how it's connected. Because one shouldn't feed it high voltage, I have a level converter (BOB-08745) to translate the signals. So here goes the pin layout:

SD Breakout:
CD -> NC
DO -> TXI (CH1) on LV side -> from TXO (CH1) on HV side to MISO on Uno
GND -> GND
SCK -> RXO (CH1) on LV side -> from RXI (CH1) on HV side to SCK on Uno
VCC -> 3.3V on Uno
DI -> RXO (CH2) on LV side -> from RXI (CH2) on HV side to MOSI on Uno
CS -> TXI (CH2) on LV side -> from RXO (CH2) on HV side to pin 4 on Uno

Not sure I needed to pass the chipSelect and SCK pins through the lever converter but hey, it couldn't hurt. I did also try it by connecting those two directly to the Uno.

The level converter is powered on the LV side with 3.3V and on the HV side with 5V. And a common GND with 5V (and the Uno.)

The sketch I'm using is the CardInfo sample. It correctly sets the chipSelect to pin 4. When I open the serial monitor, I get this:
Code: Select all
Initializing SD card...Wiring is correct and a card is present.

Card type: SD2
Could not find FAT16/FAT32 partition.
Make sure you've formatted the card
This happens with any card I put in. They're all formatted FAT16 with default block side. I also tried FAT32. No dice.

So what am I missing? It's worth pointing out that none of the other sample sketches work. It immediately fails with the SD.begin() line. Whether it's set to the hardware SS (pin 10) and I connect the card's CS pin to that, or whether I set it to pin 4. It never seems to get past that line.
Last edited by kirash4 on Mon Jan 07, 2013 11:25 am, edited 1 time in total.
By kirash4
#153930
Figured it out. Someone suggested it's communicating too fast. In the example CardInfo sketch, there's a line that reads:
Code: Select all
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Changing that to SPI_QUARTER_SPEED and everything works as expected.

The same applies for the other example sketches. They all seem to ball SD.begin(csPin), which in turn calls .init(SPI_HALF_SPEED, chipSelect) ... the problem is, that's hardcoded in the SD.cpp file. So either one has to write their code by using .init(SPI_QUARTER_SPEED, chipSelect) or edit the SD.cpp file and change it there and simply use SD.begin(csPin) in their code.