2.4" TFT LCD Display (0x4532) for NodeMCU

Hello Im trying to interface 8 bit parallel TFT w/ NodeMCU. This is the module I have
IMG_20180515_113323

I have tried david_prentice's MCUFRIEND_kbv Library with some hacks to no avail. I tried to hack the library for ESP8266 (updated write_8 and read_8 functions in mcufriend_sheild.h and defined SUPPORT_4532) - using these connections
LCD_RST <=> RST
LCD_CS <=> GND
LCD_RS <=> GPIO15
LCD_WR <=> GPIO14
LCD_RD <=> 3V

LCD_D0 <=> GPIO0
LCD_D1 <=> GPIO1
LCD_D2 <=> GPIO2
LCD_D3 <=> GPIO3
LCD_D4 <=> GPIO4
LCD_D5 <=> GPIO5
LCD_D6 <=> GPIO12
LCD_D7 <=> GPIO13
Not sure if LCD_RST, LCD_CS and LCD_RD shortcuts are allowed by the library software.

This person ( (146) ESP8266 and 2.4" 8-bit parallel ST7781 TFT Uno Shield - YouTube) got the same display working w/ nodeMCU (albeit their module is 5V one and has hack on the LDO).

The Bodmer/TFT_eSPI: Arduino and PlatformIO IDE compatible TFT library optimised for the Raspberry Pi Pico (RP2040), STM32, ESP8266 and ESP32 that supports different driver chips (github.com) library says 8 bit parallel is not possible w/ ESP8266 because of shortage of GPIOs - but ESP8266 has 16 GPIOs (out of which 4 are SPI). I don't plan on using touch or SD card functionality anyways. The LCD requires 8(data) + 4 (Control) + 1 = 13 pins, which should fit in the 16 provided by ESP8266 ? Please let me know if I am missing anything.

Anyways - the first question at hand would be - is it possible to run 8 bit parallel tft w/ ESP8266, followed by - which library can do the job if possible.

cbm80amiga has some very impressive videos.

It is reasonable to hard-wire LCD_RD high. And to connect LCD_RST pin to the MCU Reset.
However, I really don't like hard-wiring LCD_CS low.

Hey-ho. I don't think it is worth the bother to use ESP8266. Especially when the ESP32 has more pins, two cores, more SRAM, faster, ...

I don't think that Bodmer supports the LGDP4532 or any non-MIPI controllers. You will have quite a bit of work to adapt TFT_eSPI library.

Yes, MCUFRIEND_kbv supports LGDP4532. You just need to adapt the control pins and the write_8() macro.

Or just adapt cbm80amiga's library code. LGDP4532 operation is fairly similar to ST7781 but register addresses are organised differently.

Life is much simpler with STM32 or ESP32

David.

Hello @david_prentice . Thanks for the reply.

I was able to get it working with the following changes.
LCD_RST <=> RST
LCD_CS <=> GPIO16
LCD_RS <=> GPIO15
LCD_WR <=> GPIO14
LCD_RD <=> 3V

LCD_D0 <=> GPIO0
LCD_D1 <=> GPIO1
LCD_D2 <=> GPIO2
LCD_D3 <=> GPIO3
LCD_D4 <=> GPIO4
LCD_D5 <=> GPIO5
LCD_D6 <=> GPIO12
LCD_D7 <=> GPIO13

Plus, in the graphictest_kbv example I had to

  • hardcode the ID (0x9341) instead of reading it from the module as we have pulled LCD_RD to high.
  • Comment out serial comm parts as I am using TX and RX pins for data

After this I faced one issue - ESP8266 kept resetting during the test. Turns out the watchdog wasn't being fed periodically. Maybe some esp8266 guru or @david_prentice can suggest the right place for yeild(); function for WDT within the library. For now i went ahead and disabled the WDT (I know that's not a very intelligent thing to do - but for POC it works now). For now i disabled it via

ESP.wdtDisable();
*((volatile uint32_t*) 0x60000900) &= ~(1);

Btw the graphictest_kbv test completes in 24.06 seconds

The title says that you have an 0x4532 e.g. LGDP4532 controller.
There is NO WAY that a LGDP4532 will respond to 0x9341 commands.

Seriously. cbm80amiga has shown that you can use a ST7781 with NodeMcu if you forgo LCD_RD, and Serial comms. You just need to use LGDP4532 registers and commands if you have an LGDP4532.

But since an ESP32 has got more pins and it is almost as cheap as the ESP8266 it seems a false economy.

ESP8266 or ESP32 should complete the Adafruit Tests in about 1.0 seconds

I suspect that you are deliberately TROLLING.

David.

I am not trolling, at least not intentionally and I do not mean any disrespect.

This is the board I have and the time I was talking about. Do enlighten me which unit this is, as there is no indication on it.



And btw the topic - I picked from here as I have similar board as in that post :face_with_raised_eyebrow:

From your Adafruit_Report photo, it detects the ID as 0xCFCF which is totally unknown (and unsupported)

Ah-ha. You are using a pin-starved NodeMCU board. Since you have no LCD_RD functionality, the tft.readID() means nothing.

What ID have you used for tft.begin(ID); ?
If you used tft.begin(0x4532); and it worked, you almost certainly have an LGDP4532.
If you used tft.begin(0x9341); and it worked, you probably have an ILI9341.

You can always plug your shield into a proper Uno. Then we can see exactly what you have got by running the regular examples.

David.