ESP32-TTGO+ILI9341+TFT_eSPI

I have the following TFT,
2.8" TFT LCD Display Touch Panel SPI Serial 240*320 ILI9341 5V/3.3V STM32.

And I have the next board,
T8-V1-7-TTGO-ESP32-4-mb-PSRAM-TF-3D-WiFi-Bluetooth-ESP32

Attached Pics.
I see that the TFT_eSPI library has three files related to my boards.

  1. Setup22_TTGO_T4.h 2. Setup1_ILI9341.h 3. SetupX_Template.h

In these three files I see different connections between the boards pins.

Do I need to change the pin numbers in the three files that are the same?
Are there any pins recommended for working with my boards?

Edit User_Setup.h file only until you understand how to use different user setup files.

Here are the configuration settings I use:

#define ILI9341_DRIVER

// Display to ESP32 pin connections
// Connect TFT VCC and LED pins to ESP32 5V
// Connect TFT GND pin to ESP32 0V
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS    5
#define TFT_DC    0
#define TFT_RST   4

#define TOUCH_CS 13

#define LOAD_GLCD
#define LOAD_FONT2
#define LOAD_FONT4
#define LOAD_FONT6
#define LOAD_FONT7
#define LOAD_FONT8
#define LOAD_GFXFF

#define SMOOTH_FONT

#define SPI_FREQUENCY  40000000

#define SPI_TOUCH_FREQUENCY  2500000

OK, Many thanks for the help bodmer.

After all these connections, all the Examples will work, touch, pictures?

Thanks.

OK, I connect all pins like you describe, and the graphics works perfect.

But in the example Keypad_240x320.ino

I set Rotation like this tft.setRotation(2);
And can't calibrate,

I should connect the other touch pins on TFT, to ESP32 board?

Yes, you need to connect the touch pins. In your setup the extra connections would be:

T_IRQ - no connection
T_DO connect to ESP32 pin 19 (MISO)
T_DIN connect to ESP32 pin 23 (MOSI)
T_CS connect to ESP32 pin 13
T_CLK connect to ESP32 pin 18 (SCLK)

Run the Test_Touch_Controller example to test the touch controller interface.

Make sure your display actually has a touch screen film fitted and the XPT2046 controller chip fited as well. Note that some displays sold have the XPT2046 fitted but do not have the touch sensitive film fitted to the screen.

bodmer,

Thanks for the reply,

I've included photos of the chip and the film, I hope it's all right, right?

Do I need to add the connections you recorded?
Or do I have to remove the connections that exist for the display, and instead connect them to the touch pins?

Thanks,

The screen you have looks good.

Yes you need to add wires to connect the ESP32 to the touch controller on the TFT, leave the existing connections to the TFT otherwise the screen will not work!

No additions to the User_Setup.h file are needed.