ESP32 WROOM & ILI9488: No Touch

Hello
I am trying to get response from a touch on the screen of the ILI9488. I have read many post and the answer given did not resolve my problem.

First I check the the ILI screen I bought have a XPT2036 chip.

I check also the wiring and the confihuration of the User_setup. h for the TFT_eSPI library and I can write text on the screen.

Here is the short code I use to test my ILI9488 touchscreen.

// Testing ILI9488 TouchScreen with ESP32 WROOM
/*****************
Pin Definition:
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS   15  // Chip select control pin
#define TFT_DC    4  // Data Command control pin
#define TFT_RST  -1  // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST

//#define TOUCH_CS 2     // Chip select pin (T_CS) of touch screen
***************/
/**************
Frequencies
#define SPI_FREQUENCY  40000000

// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY  20000000

// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY  2500000
***********************/

#include <TFT_eSPI.h>
#include <XPT2046_Touchscreen.h>

#define CS_PIN 2
XPT2046_Touchscreen ts(CS_PIN);

void setup() {
    Serial.begin(115200);
    ts.begin();
    ts.setRotation(1);
}

void loop() {
  if (ts.touched()) {
    TS_Point p = ts.getPoint();
    Serial.print("Pressure = ");
    Serial.print(p.z);
    Serial.print(", x = ");
    Serial.print(p.x);
    Serial.print(", y = ");
    Serial.print(p.y);
    delay(600);
    Serial.println();
  }
}

With this code I get a constant "Pressure = 4095, x=0, y=0" response whatever I touch the screen or not.

I have tried other code without any success!

So I need your help
Claude

Hey I'm also in the same boat. I have seen other members to try testing with MISO(TFT_SDO) disconnected to see if the touch component works with the serial print.
And surprisingly this worked (but obviously then display doesn't)
I'm guessing this means for the ILI9488 you need to use seperate SPI Channels for the TFT and the Touch. It's a work in progress for me so I'll update if I get any further.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.