I am using a XIAO ESP32 Seeeduino with an ILI9341 TFT display that is working great. The touch screen is also working well.
The problem is that I have to disconnect the MISO connection every time I power on the ESP32. When I power on the ESP32 the display is blank, but when I disconnect MISO and power back on the ESP32 I do get the image. Then I connect back MISO and it works as it should (the touch doesn't work leaving MISO disconnected). I don't know if it is a hardware or software issue.
Pin cinnections:
VCC -> 5 V
GND -> GND
CS -> GPIO3
RST -> GPIO4
DC -> GPIO5
MOSI -> GPIO10
SCK -> GPIO8
LED -> 5 V
MISO -> GPIO9
T_CLK -> TFT_SCK
T_CS -> GPIO21
T_DIN -> TFT_MOSI
T_DO -> TFT_MISO
Arduino setup:
#include <Adafruit_ILI9341.h>
#include <XPT2046_Touchscreen.h>
#include <SPI.h>
#define CS_PIN 21
#define TFT_CS 3 // TFT CS pin is connected to esp pin 3
#define TFT_RST 4 // TFT RST pin is connected to esp pin 4
#define TFT_DC 5 // TFT DC pin is connected to esp pin 5
#define TFT_MISO 9
XPT2046_Touchscreen ts(CS_PIN);
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);