Itead SD Shield 3.0

Good Afternoon,

I recently bought an Itead SD Shield 3.0

https://www.itead.cc/wiki/Stackable_SD_Card_shield_V3.0

I'm new to these boards and I cant figure out what pins do I have to connect.

I have an arduino Mega 2560

I connected:
1 VCC 5V/3V3 - to 5V
2 GND GND - to GND
3 D13/ICSP_SCK SD_SCK - to pin 52
4 D12/ICSP_MISO SD_OUT - to pin 50
5 D11/ICSP_MOSI SD_IN - to pin 51
6 D4 SD_CS - to pin 23, and i initialized pinMode(23, OUTPUT);
7 D0 RX - to RX0
8 D1 TX - to TX0

I used a code I found:
#include <SPI.h>
#include <SD.h>

int CS_pin = 23;

void setup()
{
Serial.begin(9600);

Serial.print("Initializing 'SD card'...");
pinMode(CS_pin, OUTPUT);

// see if the card is present and can be initialized:
if (!SD.begin(CS_pin) {
Serial.println("SD Fail");
return;
}
Serial.println("SD Ok.");
}

It always returns SD Fail.

What Am I doing Wrong?

Thank you,
Best Regards,
Pedro

I cant figure out what pins do I have to connect.

Plug the shield in. It only fits one way, in one place. The pins are then connected automatically, correctly.

The documentation says that pin 4 is the chip select pin. Why are you using 23?

Good Afternoon and Thank you,

I used 23 because 4 was already assigned.

I changed to use number 4 and it continues the same.

What can it be?

Thank you,
Best Regards,
Pedro Oliveira

Good morning,

Any hints?

Thank you,
Best Regards

Good Morning,

I still haven't solved this problem. Anyone can help?

Thank you,
Best Regards,
Pedro Oliveira

Paul S states

Plug the shield in. It only fits one way, in one place. The pins are then connected automatically, correctly.

The module should plug into the female headers of the Mega, and the SPI connections are made automatically through the ICSP pin block of the mega mating with some female headers on the bottom side of the shield.

But, you say

I connected:
1 VCC 5V/3V3 - to 5V
2 GND GND - to GND
3 D13/ICSP_SCK SD_SCK - to pin 52
4 D12/ICSP_MISO SD_OUT - to pin 50
5 D11/ICSP_MOSI SD_IN - to pin 51
6 D4 SD_CS - to pin 23, and i initialized pinMode(23, OUTPUT);
7 D0 RX - to RX0
8 D1 TX - to TX0

You should not have to make any special connections. Can you provide a photograph of how you have the shield hooked up to the mega?

SD Shield can be compatible with many Arduino mainboards and Arduino-derivative boards working under 3V3 or 5V level. When it works with boards of 3V3 logic level, the level switch needs to be slide to 5V. When it works with boards of 3V3 logic level, the level switch needs to be slide to 3V3. For some of the Arduino boards, SPI is on ICSP and D11 ~ D13, while for some main boards, D11 D12 / D13 are not defined as SPI. In order to improve the compatibility, we design an SPI JUMPER to make it compatible with mainboards of the two different types. For details, please find the table below.

Did you disconnect 5V Voltage Switch?

And for this shield pin 4 MUST be CS.

For anyone out there, I have successfully got this shield working with a Teensy 3.2.

You can use any pin you want on your board for CS, as long as you set the correct number in SD.begin() BUT it MUST get connected on the shield's pin 4 in order for it to work.
The other connections are quite straight forward, SCK to shield 13, MISO to shield 12 and MOSI to shield 11.

Of course, you also need common ground between the board and the shield, any GND on your board to one of the GND pins next to the VIN on the shield will do.

Doing that you may be able to access the card information but no be able to read files of the SD card and get a failure at

SD.begin(CS_PIN);

The trick is to set the SPI rate to a lower value, I'm using 4000000 with the Teensy 3.2 so that's SPI_HALF_SPEED in Arduino SD library, but depending on the library it can vary. For example in Teensy's implementation SPI_HALF_SPEED is 24000000.