XIAO SAMD21 fails to initialise microSD cards

Hi

I’m having troubles initialising micro SD card using the XIAO SAMD21.

I’m wiring the controller board to a SparkFun MicroSD breakout.

Running the following code prints “initialisation Failed”.

#include <SPI.h>                                  // Serial Peripheral Interface
#include <SD.h>                                   // SD card

#define SD_Card_CS A3                              // Chip Select Pin

void setup() {

  Serial.begin(115200);
  while (!Serial){
    delay(10);
  }

  Serial.print("Initializing SD card...");

  if (!SD.begin(SD_Card_CS)){
    Serial.println("Initialisation Failed!");
    while(1);
  }

  Serial.println("initialization done.");

}

I’ve tried other pins but none of them worked. Could I get some help on this?

Try connecting the VCC pin of the SD to the 3V3 pin of the XIAO.

1 Like

Hi there,
Looks like in the picture it’s connected to the 5V, :grin: :ok_hand:
Nice eyeball, :ninja:
GL :slight_smile: PJ