I'm using a generic ST7735R with microSD slot. The microSD is a sandisk 1GB. I have formatted it with sdformat, and created a small, zero byte file "fred.txt" from a PC as a test.
Running Arduino IDE 1.8.1, SD 1.1.1 (included with IDE 1.8.1).
Running cardinfo sample sketch succeeds with MEGA2560, fails with nano.
Successful setup (MEGA2560):
I have succeeded reading the card with a MEGA2560, wiring as follows:
SD -> MEGA2560
CS -> 53
MOSI -> 51
SCLK -> 52
MISO -> 50
Including setting:
const int chipSelect = 53;
... and adding:
Serial.print("\nInitializing SD card...");
- pinMode(chipSelect, OUTPUT);
- digitalWrite(chipSelect, HIGH);
Output from serial monitor:
Initializing SD card...Wiring is correct and a card is present.
Card type: SD2
Volume type is FAT32
Volume size (bytes): 985792512
Volume size (Kbytes): 962688
Volume size (Mbytes): 940
Files found on the card (name, date and size in bytes):
FRED.TXT 2017-02-27 21:38:58 0
Failing setup on the nano:
Same IDE and SD lib as above
SD -> Nano
CS -> D10
MOSI -> D11
SCLK -> D13
MISO -> D12
sketch modified to use pin 10/D10 with:
const int chipSelect = 10;
Serial monitor output:
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
I am at a loss. Everything is identical except for the microcontroller, and the pin connections. What am I missing?
Thanks in advance,
Josh