Closed Hans0lo closed 1 year ago
First, you need to ensure that the file system format of your SD card is FAT32. Secondly, in addition to the SPI communication method. There is also a SD_MMC 1bit method. This method only needs to use 3 data lines and has a huge improvement in timing. The method of use is as follows SD_MMC.setPin(x,x,x); SD_MMC.begin("/sdcard",true,true);
Hi @mmMicky & thanks for your help.
my file system already was FAT32, so this was not the issue.
And while I may look into the MMC 1-bit method, I still would like to get the SPI mode working as (for other projects) I also want to use other SPI peripherals with this T-Display-S3 board, not only SD card...
I therefore rephrase my questions:
can I use a second (HSPI) bus with this display?
If yes, can I use this port setup?
thnx a lot for your help!
I found the solution on my own with some help of Google. In the end I only had to add one more line of code to make it work (switching the CS Pin to output...):
pinMode(SD_CS,OUTPUT);
so the complete code-part looks like this:
void setup() {
Serial.begin(9600);
spiSD.begin(SD_CLK, SD_MISO, SD_MOSI, SD_CS); //SCK,MISO,MOSI,cs
pinMode(SD_CS,OUTPUT);
if (!SD.begin(SD_CS, spiSD, SDSPEED)) {
Serial.println("Card Mount Failed!");
return;
} else {
Serial.println("Card Mount Successful!");
}
}
Congrats on finding the right solution and sharing it. This is also required when using SD_MMC. pinMode(cs, output); digitalWrite(cs, 1);
Hi, I try to connect a SD reader via SPI to the T-Display-S3 touch version - sadly without success. From reading other comments/websites it seems I can freely define the pins for a secondary (HSPI) SPI bus. This is what I tried:
in setup I have:
but all I get is "Card Mount failed" - I have multiple reader modules, but I get the same result with all of them, so i assume the issue is with my setup/pins/code...
any help would be highly appreciated - thanks in advance :)