Hi all,
I purchased a screen from Amazon and am struggling to get it to work on my ESP32-WROOM-32D board. I've had some success with getting the display output working using the TFT_eSPI library however it seems as though the touch functionality is only supported using SPI, which the screen does not support as it is parallel only. The IC driver is the ILI9488 and it has pins D0-7, RST, CS, RS, WR & RD.
I've been trying for hours using various libraries and felt the most confident with a fork of the Adafruit_Touchscreen library GitHub - s60sc/Adafruit_TouchScreen: Arduino library for 4-wire resistive touchscreens, however after altering the TFT_eSPI config, the Adafruit Touchscreen.h file and selecting the correct pins in the Touchscreen object of the ESP32testTouch file, I still only get a working display output with zero touch functionality.
Here is my User_Setup.h file from the TFT_eSPI library:
// See SetupX_Template.h for all options available
#define ESP32_PARALLEL
//#define ILI9486_DRIVER
#define ILI9488_DRIVER
// ESP32 pins used for the parallel interface TFT
#define TFT_CS 27 // Chip select control pin
//#define TOUCH_CS 27
#define TFT_DC 14 // Data Command control pin - must use a pin in the range 0-31
#define TFT_RST 26 // Reset pin
#define TFT_WR 12 // Write strobe control pin - must use a pin in the range 0-31
#define TFT_RD 13
#define TFT_D0 16 // Must use pins in the range 0-31 for the data bus
#define TFT_D1 4 // so a single register write sets/clears all bits
#define TFT_D2 23
#define TFT_D3 22
#define TFT_D4 21
#define TFT_D5 19
#define TFT_D6 18
#define TFT_D7 17
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
Here are the first lines of the Adafruit TouchScreen.h file:
// Touch screen library with X Y and Z (pressure) readings as well
// as oversampling to avoid 'bouncing'
// (c) ladyada / adafruit
// Code under MIT License
#ifndef _ADAFRUIT_TOUCHSCREEN_H_
#define _ADAFRUIT_TOUCHSCREEN_H_
#include <stdint.h>
// ESP32 specific
#define ESP32_WIFI_TOUCH // uncomment to use parallel MCU Friend LCD touchscreen with ESP32 UNO Wifi
#ifdef ESP32
#define ADC_MAX 4095 // maximum value for ESP32 ADC (default 11db, 12 bits)
#define aXM 14 // analog input pin connected to LCD_RS
#define aYP 12 // analog input pin connected to LCD_WR
#else
#define ADC_MAX 1023 // Arduino
#endif
#define NOISE_LEVEL 4 // Allow small amount of measurement noise
and my TouchScreen object:
const int XP = 18, XM = 14, YP = 12, YM = 17;
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
... which I got the values of XP, YP, XM & YM by cross-referencing with this third-party table: here
Could anyone please provide any guidance on how to use a parallel display with a ILI9488/ILI9486 driver on an ESP32? Or any libraries I could try?
If not could anyone recommend any touchscreen suggestions that are easy to get going with my microcontroller?
Many thanks,
Scott.