Hello,
I've been 2 weeks in the project and i've been stil in the part to connect a esp32_s3-n16R8 to a ili9488 with a XPT2046 touchdriver.
The lib's i'm using are;
bodmer/TFT_eSPI@^2.5.1
paulstoffregen/XPT2046_Touchscreen
and the pins for communication are:
#define TFT_MOSI 11
#define TFT_SCLK 12
#define TFT_CS 5
#define TFT_DC 4
#define TFT_RST -1
#define TFT_MISO 13
#define TOUCH_CS 15
#define TOUCH_IRQ 16
For the code i try to startup as simple as possible in platform.io
//user_setup
#define USER_SETUP_INFO "Custom Setup for ILI9488 on ESP32-S3 with T_IRQ on 14"
#define ILI9488_DRIVER
#define TFT_MOSI 11
#define TFT_SCLK 12
#define TFT_CS 5
#define TFT_DC 4
#define TFT_RST -1
#define TFT_MISO 13
#define TOUCH_CS 15
#define TOUCH_IRQ 16
#define TFT_WIDTH 480
#define TFT_HEIGHT 320
#define SPI_FREQUENCY 20000000 // Reduced from 40000000 for stability
#define SPI_READ_FREQUENCY 0 // Disable reads if not supported
#define SPI_TOUCH_FREQUENCY 2500000
#define LOAD_GLCD
#define LOAD_FONT4
#define USER_SETUP_LOADED 1
//main
#include <Arduino.h>
#include <TFT_eSPI.h>
#include <XPT2046_Touchscreen.h>
TFT_eSPI tft = TFT_eSPI();
#define TOUCH_CS 15
#define TOUCH_IRQ 16
XPT2046_Touchscreen ts(TOUCH_CS, TOUCH_IRQ);
void setup() {
Serial.begin(115200);
delay(500);
Serial.println("Starting setup...");
Serial.println("Before tft.init()");
tft.init();
delay(100); // Add delay after init as suggested
Serial.println("After tft.init()");
tft.setRotation(0);
Serial.println("After setRotation()");
tft.fillScreen(TFT_BLACK);
Serial.println("After fillScreen()");
tft.setTextColor(TFT_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 10);
tft.println("TFT OK");
Serial.println("TFT OK printed");
Serial.println("Before ts.begin()");
ts.begin();
Serial.println("After ts.begin()");
}
void loop() {
if (ts.touched()) {
TS_Point p = ts.getPoint();
Serial.printf("Touch: x=%d y=%d\n", p.x, p.y);
tft.fillCircle(p.x, p.y, 4, TFT_RED);
delay(200);
} else {
delay(50);
}
}
//platform.ini
[env:esp32-s3]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
lib_deps =
bodmer/TFT_eSPI@^2.5.0
paulstoffregen/XPT2046_Touchscreen@^1.3
build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-Wl,-Map=output.map
-DCONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
-DCONFIG_ESP_TASK_WDT_TIMEOUT=10
I comment evry driver out of the user_setup_select file.
The only thing after compiling is this in repeat:
Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x42022c26
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x4bc
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a0c
entry 0x403c98d0
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x42001d51 PS : 0x00060830 A0 : 0x82001f09 A1 : 0x3fcebbd0
A2 : 0x3fc95468 A3 : 0x00000001 A4 : 0x60004000 A5 : 0x00000010
A6 : 0x3fc9690c A7 : 0x00000000 A8 : 0x08000000 A9 : 0x3fcebba0
A10 : 0x3fc9690c A11 : 0x00000001 A12 : 0xffffffff A13 : 0x00000010
A14 : 0x00000000 A15 : 0x3fc93a08 SAR : 0x0000001c EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000010 LBEG : 0x42014000 LEND : 0x42014064 LCOUNT : 0x00000002
Backtrace: 0x42001d4e:0x3fcebbd0 0x42001f06:0x3fcebc00 0x420017b3:0x3fcebc30 0x4200384a:0x3fcebc50
ELF file SHA256: e99c734e52221776
The esp is this one:
Esp32
And the display is this one;
display
Is there a problem to let these 2 products work together?
Kind regards Bas