Hello, I want to use the display, the touchinterface and the sd slot of a ili9341 Touchdisplay. I use TFT_SPI and a ESP32 S3 Devkitc1. The display and the touchinterface work fine, however i just can't connect to the SD slot. No matter what i try, i get the following error:
#define TFT_MISO 12
#define TFT_MOSI 11
#define TFT_SCLK 13
#define TFT_CS 10 // Chip select control pin
#define TFT_DC 42 // Data Command control pin
#define TOUCH_CS 2
#define TFT_RST 1 // Reset pin (could connect to RST pin)
11, 12, 13 are also the pins where i wired SD_sck, SD_MOSI and SD_MISO.
Here is the relevant code for the sd, nothing to crazy:
#include <lvgl.h>
#include <TFT_eSPI.h>
#include <Arduino.h>
#include <SD.h>
#define SD_CS 7
File myFile;
void setup{
if (!SD.begin(SD_CS)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization sd done.");
// open the file for write at end like the "Native SD library"
myFile = SD.open("test.txt", FILE_WRITE);
myFile = SD.open("test2.txt", FILE_WRITE);
}
Did i do something wrong with the wiring? I also tried using VMISO etc. but it didn't change anything. Or is there some other mistake i made? Pls help me out on this, I'm going crazy.
Thanks in advance
Hello, I want to use the display, the touchinterface and the sd slot of a ili9341 Touchdisplay. I use TFT_SPI and a ESP32 S3 Devkitc1. The display and the touchinterface work fine, however i just can't connect to the SD slot. No matter what i try, i get the following error:
#define TFT_MISO 12
#define TFT_MOSI 11
#define TFT_SCLK 13
#define TFT_CS 10 // Chip select control pin
#define TFT_DC 42 // Data Command control pin
#define TOUCH_CS 2
#define TFT_RST 1 // Reset pin (could connect to RST pin)
11, 12, 13 are also the pins where i wired SD_sck, SD_MOSI and SD_MISO.
Here is the relevant code for the sd, nothing to crazy:
#include <lvgl.h>
#include <TFT_eSPI.h>
#include <Arduino.h>
#include <SD.h>
#define SD_CS 7
File myFile;
void setup{
if (!SD.begin(SD_CS)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization sd done.");
// open the file for write at end like the "Native SD library"
myFile = SD.open("test.txt", FILE_WRITE);
myFile = SD.open("test2.txt", FILE_WRITE);
}
Did i do something wrong with the wiring? I also tried using VMISO etc. but it didn't change anything. Or is there some other mistake i made? Pls help me out on this, I#m working on it for days now and I'm going crazy.
Thanks in advance
Have you checked to see if your display is actually tri-stating the TFT_MISO line when TFT_CS is not asserted? Not all displays do unfortunately, and if that's the case with yours, you'll not be able to communicate with the SD card.
A quick check is to remove the connection to the TFT_MISO line and see if the SD card suddenly starts working. If it does, you have two choices: leave the TFT_MISO line unconnected (you'll still be able to write to the display, but not read from it), or add hardware to properly tri-state the TFT_MISO line.
The jumper when shorted connects the input of the 3.3V regulator to the output, thus bypassing the regulator. You would use it that way when powering with 3.3V because you already have 3.3V, and running it through the regulator might reduce the voltage too much for the SD card to work.
But if you power with 5V, you should open the jumper so the regulator will function properly and put out the 3.3V the card needs.