Hello,
I am relatively new to Arduino and am trying to use an SD Card with my Arduino UNO. I connected my SD card reader to my Arduino UNO as follows:
Gnd - Gnd
3.3v - 3.3v
CS - 4
MOSI - 11
SCK - 13
MISO - 12
Gnd - Gnd
The code successfully uploads, but when I run the program, the SD Card fails every time. I'm not sure as to whether this is a code problem or a wiring problem, and I'm sorry about how much of a noob I am.
Note about Slave Select (SS) pin on AVR based boards
All AVR based boards have an SS pin that is useful when they act as a slave controlled by an external master. Since this library supports only master mode, this pin should be set always as OUTPUT otherwise the SPI interface could be put automatically into slave mode by hardware, rendering the library inoperative.
It is, however, possible to use any pin as the Slave Select (SS) for the devices. For example, the Arduino Ethernet shield uses pin 4 to control the SPI connection to the on-board SD card, and pin 10 to control the connection to the Ethernet controller.
The obvious first step is to determine whether you have a hardware problem or a pin conflict problem.
Run one of the SD examples that does not include TMRpcm.h. If you get past the failure to initialize, then you have a resource conflict. If not, you have a hardware problem.