Go Down

Topic: Wiring ILI9341 TFT LCD + 74HC595 on ESP32 (Read 920 times) previous topic - next topic


I have this chinese TFT LCD which works in 8-bit parallel very well.
But as I'm using a ESP32 (30GPIO version) my pin count is low, that's why I got a 74HC595.
So, after days searching, I really start to think if it's possible put this 3 components together.
My main difficulty is wiring all the pins on the right way. As I'm not experienced in comm protocols I'm really struggling at that task.

Since this LCD come with CS/RS/WR/RD pins, I'm not sure how to wire ESP32 pins in 74HC595 and this LCD.
ps: data pins is pretty straight forward for me.

As you guys can see I'm using TFT_eSPI from Bodmer.
Here is the code. In my last update I tried to force pins HIGH/LOW as none of the other attempts were successful.
Code: [Select]

#include <SPI.h>  //https://github.com/espressif/arduino-esp32/tree/master/libraries/SPI
#include <TFT_eSPI.h> // https://github.com/Bodmer/TFT_eSPI

#define TFT_MISO 19
#define TFT_MOSI 23 // (SPI DATA)

#define TFT_SCLK 18 // (SPI CLOCK)
#define TFT_CS   5  // Chip select control pin (SPI LATCH)
#define TFT_DC    2  // Data Command control pin

#define T_CS 22
#define TFT_CD 4

#define TFT_W 320
#define TFT_H 240

TFT_eSPI tft = TFT_eSPI();

void setup(void) {
  digitalWrite(TFT_CS,HIGH);// ||
  pinMode(TFT_CD, OUTPUT);
  while (!Serial && (millis() <= 1000));

void loop() {
  digitalWrite(TFT_CD, LOW);
  digitalWrite(TFT_CS, LOW);
  digitalWrite(TFT_CS, HIGH);
  digitalWrite(TFT_CD, HIGH);

I don't know if I'm trying to make a "miracle" by mixing 2 protocols (8-bit + SPI), so let me know if this is impossible.
Buying a HMI LCD or even a SPI LCD from China is not an option, since Nextion LCD is very expensive for my purposes, and my country have an awful delay for chinese imports.

Tell me if you need more info about docs, codes, attempts, etc.
A huge thanks!


Jun 28, 2019, 07:03 pm Last Edit: Jun 28, 2019, 07:06 pm by PaulRB
I suspect that the library you are using was written for displays with either 8-bit parallel interface or native/built-in SPI interface. You are attempting to add on an SPI interface to a display with a parallel interface. The library will probably not have a configuration option for this. Some libraries do have this capability, but they are for use with 16x2 and 20x4 character LCD displays.

The library could be adapted/enhanced to allow this, but only by the library author or someone of equal expertise. I suggest you try to contact the library author to discuss the possible enhancement.


Thank you, PaulRB.
I just post an issue on his github to discuss the possibility.
As soon as I finish my last attempt, I'll post the result here.

Anyway, thank you.

Go Up