Open EvanChristan123 opened 8 months ago
I have the following lines in my code for the sd card pins. _
//define sd card
We actually set SDCARD_CS_PIN to 47 and we assume the board will read the info of the card through this port, but the board just can't read the card. Since the example program doesn't give any hints on using the other three ports, may I ask how to use these 4 pins to operate the SD card with "FS.h" and "SD.h"?
I use this code:
SPI.begin(SD_SCLK_PIN, SD_MISO_PIN, SD_MOSI_PIN, SD_CS_PIN); if (!SD.begin(SD_CS_PIN, SPI)) { Serial.println("Card Mount Failed"); return; } uint8_t cardType = SD.cardType(); if (cardType == CARD_NONE) { Serial.println("No SD card attached"); return; }
Serial.print("SD Card Type: ");
if (cardType == CARD_MMC)
Serial.println("MMC");
else if (cardType == CARD_SD)
Serial.println("SDSC");
else if (cardType == CARD_SDHC)
Serial.println("SDHC");
else
Serial.println("UNKNOWN");
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
Serial.printf("SD Card Size: %lluMB\n", cardSize);
// SD.end();
It works! When I also changed the platform.ini to include the TFT_eSPI instead of ignoring it, the SD can be read perfectly. Thank you so much for your code.
I am doing the project on the T-SIMCAM board and trying to make the board recognize MicroSD card. The MicroSD is formatted into exFAT and uses the example/sketch to test. Unfortunately, the program didn't recognize the MicroSD inserted before the board activated even though the other parts of the program were functioning. I also have tried to redefine the SDCARD_CS_PIN in select_pins.h as follows:
the program still couldn't do anything related to the SD card. Can somebody help me explain how the T-SIMCAM SD card read/write works, please?