Recommendations ILI9488 library (SPI) for esp32

I'm hoping this is the right section for this. I'm currently making a custom driver board for a 3.5 inch Eastrising display;
LCD 3.5" 320x480 IPS TFT Display Module,OPTL Touch Screen w/Breakout Board
Most of my custom boards use the ubiquitous Atmaga328p-au but these displays don't have on board graphics so are quite processor hungry.
I've come across on of these;
Waveshare ESP32-H2 Development Board | The Pi Hut
This has a castellated pcb so will solder nicely to a custom board, now here's the thing, currently my test code is running nicely on a Due board (on a mega / Uno it was painfully slow), sadly this code will not compile for the esp32.
This is the code I'm currently using based on the Adafruit GFX and ILI9488 library;

/* Simple test code to test the function of a 3.5 inch SPI TFT without
 *  a shield. TFT and touch work perfectly on a Due.
 *  So far unable to get the SD card to work
 */
#include "SPI.h"
#include <Adafruit_GFX.h>
#include <ILI9488.h>

#include <Fonts/FreeMono24pt7b.h>
#include <Fonts/FreeSerifBoldItalic24pt7b.h>
#include <Fonts/FreeSansBold24pt7b.h>




#define TFT_CS         10 // due 10     esp 0
#define TFT_DC         8  // due 8      esp 8
#define TFT_LED        7  // due 7
#define TFT_RST        9  //  due 9     esp 9


// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
ILI9488 tft = ILI9488(TFT_CS, TFT_DC, TFT_RST);
// If using the breakout, change pins as desired
//Adafruit_ILI9488 tft = Adafruit_ILI9488(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

void setup() {


  tft.begin();

    tft.setRotation(1);

  tft.invertDisplay(true);



tft.setFont(&FreeMono24pt7b);



  tft.fillScreen(ILI9488_BLACK);

  tft.setCursor(0, 30);
  tft.setTextColor(ILI9488_WHITE);
  tft.setTextSize(1);
  tft.println("FreeMono24pt7b");


tft.setFont(&FreeSerifBoldItalic24pt7b);

  tft.setCursor(0, 75);
  tft.setTextColor(ILI9488_YELLOW);
  tft.setTextSize(1);
  tft.println("Hello");

tft.setFont(&FreeSansBold24pt7b);

  tft.setCursor(0, 120);
  tft.setTextColor(ILI9488_RED);
  tft.setTextSize(1);
  tft.println("world");
  
  tft.setCursor(0, 200);
  tft.setTextColor(ILI9488_GREEN);
  tft.setTextSize(2);
  tft.println("size 2");
}


void loop(void) {

}

This project will require 2 independent can bus channels and a 16 bit A/D converter (all over SPI) and a a few io's mainly for chip selects so the esp32 might not be the best choice, I'd like to use the Due's SAM3X8E but soldering 144 pins is asking for trouble. Realistically a 32 pin package is the finest solder mask that I can cut with a diode laser.

Thanks for your help.

You may want to take a look a this site:

I have found it useful in past projects

Has anyone had any luck with the Bodmer / TFT_eSPI library?

I've got about 1000 lines of compile errors as if I'm missing a library, I downloaded this direct from Github as it didn't seem to be in the library manager.

This is the last few lines of compile errors.

:\Users\Rusty\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32h2/include/soc/esp32h2/register/soc/gpio_struct.h:51:3: note:   no known conversion for argument 1 from 'int' to 'const gpio_out_w1ts_reg_t&'
C:\Users\Rusty\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32h2/include/soc/esp32h2/register/soc/gpio_struct.h:51:3: note: candidate: 'constexpr gpio_out_w1ts_reg_t& gpio_out_w1ts_reg_t::operator=(gpio_out_w1ts_reg_t&&)'
C:\Users\Rusty\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32h2/include/soc/esp32h2/register/soc/gpio_struct.h:51:3: note:   no known conversion for argument 1 from 'int' to 'gpio_out_w1ts_reg_t&&'
exit status 1
Error compiling for board ESP32H2 Dev Module.

I'm not sure if the esp is worth pursuing, I'm going to concentrate on my bigger RA8875 displays, these will easily run from a good old 8 bit processor. Maybe I'm revisit the esp when I have spare time.

Hi @Rusty_Kipper. It looks like the "TFT_eSPI" library doesn't have support for the ESP32-H2:

The ESP32-H2 is one of the newest chips in the ESP32 family, so you are likely to suffer this sort of "early adopter" pain if you chose a board using this chip for your project.

I'm sure it is a very nice chip, and will be a good choice if you are looking for interesting challenges and opportunities to make significant contributions to the Arduino ecosystem. But if you want comprehensive and mature support from the Arduino community then this is not a great choice.

Thanks @ptillisch.

I didn't realise how new the chip was.

I've almost finished the board for the 5 inch display, not bad for a days work :grinning_face:

2 Likes

OK, I have a plan for the smaller 3.5 inch (ILI9488) screen, I'm going to run it in 16 BIT parallel mode so should be much faster, kind of obvious really.

Now, I can use a ATmega2560 chip so the IDE will just treat it as a Mega but this is a bit overkill especially soldering a 100 pin chip, I would like to try and use a ATmega1284. Obviously I would need to re-install my minicore drivers that the esp install seemed to erase. This is a 44 pin version of the ATmega328(P) with the same 0.8mm pad spacing so way easier to solder but gives me some 32 IO pins and a second serial port.

East Rising have a modified version of Henning Karlsens UTFT library that supports the ILI9488 in parralell mode, interestingly I've come across this snippet within the CCP file;

#elif defined(__AVR_ATmega1284P__)
		#include "hardware/avr/HW_ATmega1284P.h"

which kind of makes it look like the ATmega1284 chip is supported, although I'm not sure how to enable this.

Has anyone ever run this TFT / library combination? I figure its wise to ask before I buy the components, start making a prototype board and head off down a dead end street.

I've successfully used the original TFT library with SSD1963 TFT and a full size mega back in the past, it was kind of slow but was a 400 x 800 resolution screen.

I'm guessing I don't need the 'P' version of this chip? It makes programming slightly easier with an ATmega328P as the IDE then treats that as a Uno otherwise I have to use the minicore driver which is no big deal.

Yes , but with ESP32 WROOM DA and ILI9163 TFT display.

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