I have an SD card reader . Purchased from China
I have a working SD card with some files on it.
I cannected it , I think, in a proper way
CS 10
MISI 12
MOSI 11
SCLK 13
And when I run any test program from SD.h library I get error that SD card initialisation failed.
Should I assume the part is faulty or is there anything else I can try
The card I have is a 8GB card .
The SD card reader was never used
Please show your code and connection diagram with all pins
What is your arduino board?
In the CardInfo example in my SD library, it defaults to D4 for CS. You might check the example code and change that to 10 if needed.
If it still doesn't work, post information on how the SD module is powered in your setup.
I did check D4. In a meantime I realised that I can connect SD card reader to Arduino UNO CS=10 and everything works. I have a problem with Arduino Nano only. What can be a problem?
Is any difference between codes and connections on the both boards?
No I take the same code and SPI is forcing you to use CS=10 CLK=13 MOSI=11 MISO=12
I have tried 3 different nano boards and the problem is there every time
CS should be the same for UNO and NANO right?
How the arduino and SD-card reader are powered in both cases?
I generally power it from 5v but I also checked 3v.
As CS can be used any digital pin, it is important only that the pin number in the code will consistent to the pin on the board
It is not an answer to my question.
Please clarify how you powered arduino in both cases (from USB or from external supply, in later case specify which pin power was connected to.
Also for card reader - which power source was used for it/
From USB
SD card reader was powered from 5v arduino pin
Arduino Uno and Nano uses the same controller - Atmega328.
If the code and connections are the same, it should works the same way in both cases.
Probably there is a some problem with your Nano. Is it original or clone? Could you provide a link to the purchase? Are the Nano pins soldered well?
Do you try to load another sketches to Nano?
The nano boards work fin with other projects. I tested 3 nano clones from different manufacturers.
SD cards are 3.3V devices, and the Nano is 5V. You cannot connect them directly, and must use bidirectional logic level converters, or you will damage one or both boards.
Sometimes the SD modules have those converters built in.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.