Nano not recognising SD card

Hi Everyone,

I’m currently running a pilot of a batch of wearable prototypes. I’ve recently purchased five nanos from Core (this one) to build out the batch, plugged them into an existing board and uploaded a sketch that was working on a nano from Jaycar (which was built using this).

Everything works except the SD card (from Jaycar) isn’t being recognised. The new nanos all have usb ports with a name of UUT or UUT1, I’m wondering if this is indicative of something.

I’ve tried five different nanos, sd card readers and cards (including two brands). Has anyone experienced issues with SD cards with this board?

Relevant part of my sketch:

 include <SD.h>
// SDCARD SETUP

const int chipSelect = 4;
// set up EEPROM
int addr = 0;
byte fileVer;
byte newFileVer;
void setup() {
    Serial.begin(115200); // we agree to talk fast!
    Serial.println("Initializing SD card");
    if (!SD.begin(chipSelect)) {
        Serial.print("\t");
        Serial.println("Card failed, or not present...");
        // don't do anything more:
        while (1);
    }

    Serial.print("\t");
    Serial.println("SD card initialized");
}

Hi Luke,

Are you seeing in serial “Card failed, or not present…” or “SD card initialized”, or nothing at all?

Hi Graham,

I’m seeing “Card failed, or not present…”

Ok great, so the Nano is certainly writeable then.

It really should work, by default SD cards in that library use a SPI interface which is very straightforward. It’s not likely that 5 Nano’s have problematic SPI peripherals yet are all writeable, so it’s more likely a software configuration issue between the SD card module and the Nano.

I’d start by changing the definitions for some of the optional stuff, such as the CS pin. It would be worth exploring other guides go into more detail / explicit configuration so you can dive into other settings.

http://lab.dejaworks.com/arduino-nano-sd-card-connection/