Hello,
i am trying to conect a pro micro to a micro SD card module.
My connections are as follow:
uSD module ----- Pro micro
Cs pin ------------- Pin 10
SCKpin------------ Pin15
MOSI pin---------- Pin16
MISO pin---------- Pin14
VccPin ------------ RAW
GND---------------- GND
My question is if there is a posibility of using this uSD module with this type of board, and if there is, please explain me why is not working for me.
the code i am trying out is the following. it always stucks on the if(!SD.begin(10)) part.
Thank you
#include <SD.h>
#include<SPI.h>
File myFile;
void setup()
{
Serial.begin(9600);
while(!Serial);
Serial.print("Iniciando SD ...");
if (!SD.begin(10)) {
Serial.println("No se pudo inicializar");
return;
}
Serial.println("inicializacion exitosa");
myFile = SD.open("archivo.txt");//abrimos el archivo
if (myFile) {
Serial.println("archivo.txt:");
while (myFile.available()) {
Serial.write(myFile.read());
}
myFile.close(); //cerramos el archivo
} else {
Serial.println("Error al abrir el archivo");
}
}
void loop()
{
}
Thank you for your response. I tried that and it didnt work.
From another forum i saw that an option was to change the "pins_arduino.h" file in the arduino library so the MISO, MOSI, SCK and SS pin were assigned according to my board. While doing this, i couldn't save my changes as the file was not writable.
I found this file in the following directory in my computer:
Arduino/hardware/arduino/avr/variants/circuitplay32u4
I have the same problem as you and can't get my pro micro to detect the SD card. I have also tried modifying the file "pins_arduino.h" but still no difference.
If you want to give it a go, open notepad in administrator mode and then open the file from the file menu. This should allow you to edit the file.
I was able to get my Arduino to read from sd card. The problem was that I was connecting my Arduino to the breadboard using the row pin headers without soldering the pins to the Arduino board. Maybe that is the problem in your case?
how I connect modules: the module gets a single or double row header. the module end wires are soldered to that header. when the module is proven functional the header and wires are hot glued or RTVed. when you remove, troubleshoot, et cetera, you know one end is golden.
ps1234:
I was able to get my Arduino to read from sd card. The problem was that I was connecting my Arduino to the breadboard using the row pin headers without soldering the pins to the Arduino board. Maybe that is the problem in your case?
My pins are conected to my arduino board. maybe they are badly soldered, but i already tried to change the CS pin and use another one in the board and didnt work.
Can you tell me how did you connect your devices? A photo would help me a lot. Thank you.
I think the problem that i have is either the uSD module or the uSD card. I have try 2 uSD cards uploading the CardInfo example from Arduino. Previous to this test i have formated the cards.
First image is the Serial monitor from using CardInfo with a uSD card formated as exFAT.
The second attachment is the Serial monitor obtained from a uSD card formated as FAT32
This leads me to think that maybe the uSD module is not ok, but i am using the same components as the ones in this video, and it still does not work