Hello everyone, I'm trying to make a small device with a TFT display and a SD card. The TFT I've choose is the ILI 9488 with touch (not in use now) and it's SD card slot.
The board I'm using is an ESP8266 E12 and I've connected the SPI devices as follow:
TFT_MISO D6 // DEFAULT
TFT_MOSI D7 // DEFAULT
TFT_SCLK D5 // DEFAULT
TFT_DC D3 // DEFAULT
TFT_RST D4 // DEFAULT
TFT_CS D8 // DEFAULT
SD_MISO D6
SD_MOSI D7
SD_SCLK D5
SD_CS D2
LED and VCC are under 3.3v (tried also under VIN)
The libraries I'm using are TFT_eSPI.h (from github), SPI.h and SD.h.
The problem is that i can write on the TFT but I cannot read from SD, what's wrong on what I'm doing? It's like the SD.begin(SD_CS) doesn't work at all.
Try removing the connection to the TFT_MISO pin. Some controllers don't properly tri-state that output when not selected, and that prevents the SD card from working.
Try manually switching the TFT_CS & SD_CS to HIGH after use . Most libraries don't actually disable the device they are controlling after operation. So switch TFT_CS HIGH before starting to use the SD card and switch the SD_CS HIGH after that and TFT_CS LOW again.
@ilcoso96
Your TFT or SD module (or both) probably have an incorrect design that doesn't allow it to free the SPI bus.
It was discussed on the forum recently:
The TFT display is an ILI9488 480x320 with embedded SD slot as in the picture. The pinout printed is consistent, no SDA SCL as @b707 mentioned. Unfortunetly I didn't have luck to find the actual schematic.
The project is actually pretty straight forward: I want to make a tiny digital frame with images loaded on the SD with a routine to download from internet via Wi-Fi.
Try connecting the power pins and the SD card pins to the NodeMCU, but leave all the display pins disconnected. Can you read from the SD card like that?
There do not appear to be any level shifters to allow it to be used with a 5V Arduino. These level shifters are often the source of problems when there is a need for two or more devices to be connected to the SPI bus.
In some way not of course. We need the code with which you have attempted to get it working but failed.
Also please include the core version you are using. For the SD card on the ESP8266 it is rather relevant since the SD library is core specific.
The main question before was: Does the SD card work without the TFT connected ?
Ok, I've tried both setting LOW the TFT_CS and SD_CS and disconnecting the TFT_MISO and those are the results:
TFT_CS and SD_CS state switch: not working, the TFT display has the priority over SD
TFT_MISO disconnected: sort of working. At the first start it must be connected to the TFT or it do not inizialize correctly the display (flipped text, no background and so on). After the first boot I can disconnect it
Something is going on here, not quite sure what tho...