hi there...i was search on google to solve this problem,,i was read all solution for it.but i dont know,i think all the solution im still dont understand.
this is schematic project:
but in this project i use micro sd card adapter,and this is pin layout from the sd card adapter:
I've checked every pin I installed is correct.like this image:
why i change input voltage to 5v?,because before the voltage input ive given is 3.3 v but "initialization failed!" in serial monitor.and after i change input power with 5v ,it has done "initialization done." but a new problem appears here that esp32 is not wanting to write to the sd card.i also cheked my sd card into my computer,and there is no file on there..
massage on serial monitor:
#include <SPI.h>
#include <SD.h>
File myFile;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.print("Initializing SD card...");
if (!SD.begin(5)) {
Serial.println("initialization failed!");
while (1);
}
Serial.println("initialization done.");
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
myFile = SD.open("test.txt", FILE_WRITE);
// if the file opened okay, write to it:
if (myFile) {
Serial.print("Writing to test.txt...");
myFile.println("This is a test file :)");
myFile.println("testing 1, 2, 3.");
for (int i = 0; i < 20; i++) {
myFile.println(i);
}
// close the file:
myFile.close();
Serial.println("done.");
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
}
void loop() {
// nothing happens after setup
}
so i have to powering mosi,sck,cs with 3.3v? ive test output voltage on cs=3.2v,sck=0v,mosi=0v. and miso 3.2v. vcc=5v. so ive powering sck and mosi with 3.3vdc ? i know these module have shifter 5v to 3.3v. but it does mean ive powering 0v sck and mosi?
so what is the solution for??...i watching any tutorial on youtube and its work fine,but i try to search on google i dont get the truth answer for those problem..what should i do now?
I'm sorry that you bought the wrong adapter, I have some of those too.
They are nasty, they don't release MISO, even when deselected without hardware modification.
They like to be alone on the SPI bus.