HELP : Esp32 and 8 bit parallel display ili9341 with TFT_eSPI library

Hi guys, i'm looking for a way to connect and use a parallel 8 bit display, like Mcufriend ili9341 and ESP32, but i can't find a correct library and connection specifics.

i try to use the TFT_eSPI bodmer library ( :slight_smile: great works) with following modifies:

in User_Setup.h i uncomment only:

#define ILI9341_DRIVER
..
#define ESP32_PARALLEL.

the rest is commented.

in User_Setup_Select.h i uncomment only :

#include <User_Setup.h>

#include <User_Setups/Setup14_ILI9341_Parallel.h>

i had connected the esp32 to the lcd like this:

//#define TFT_CS 33
//#define TFT_DC 15
//#define TFT_RST 32

//#define TFT_WR 4
//#define TFT_RD 2

//#define TFT_D0 12
//#define TFT_D1 13
//#define TFT_D2 26
//#define TFT_D3 25
//#define TFT_D4 17
//#define TFT_D5 16
//#define TFT_D6 27
//#define TFT_D7 14

but the display doesn't Work... where i'm wrong?
someone could help me please??
Thanks

:slight_smile: :slight_smile: :slight_smile:

MCUFRIEND_kbv should work out of the box.
TFT_eSPI should work with User_Setup as described.

First off, I would verify that the Shield works with a Uno.
This involves plugging the Shield into the header sockets.
All the male pins should mate with the corresponding female sockets.

Verify that you actually have an ILI9341 controller.
Use LCD_ID_readreg sketch on the Uno.
Then connect to the ESP32 and run LCD_ID_readreg sketch (with your defines)

David.

Hi David.. thanks a lot for your replay. Now i don't have an UNO, but i used a MEGA2560, and an ESP32 (with my pin definition) with the LCD_ID_readreg.
both board giveme the same resutl.

controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0000) 00 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 93 02 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x000A) 08 08 Get Power Mode
reg(0x000C) 66 66 Get Pixel Format
reg(0x0061) 00 00 RDID1 HX8347-G
reg(0x0062) 00 00 RDID2 HX8347-G
reg(0x0063) 00 00 RDID3 HX8347-G
reg(0x0064) 00 00 RDID1 HX8347-A
reg(0x0065) 00 00 RDID2 HX8347-A
reg(0x0066) 00 00 RDID3 HX8347-A
reg(0x0067) 00 00 RDID Himax HX8347-A
reg(0x0070) 00 00 Panel Himax HX8347-A
reg(0x00A1) 00 FF 00 FF 00 RD_DDB SSD1963
reg(0x00B0) 00 00 RGB Interface Signal Control
reg(0x00B4) 00 00 Inversion Control
reg(0x00B6) 00 00 00 00 00 Display Control
reg(0x00B7) 00 00 Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00 ILI9481, HX8357-B
reg(0x00C0) 00 00 00 00 00 00 00 00 00 Panel Control
reg(0x00C8) 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA
reg(0x00CC) 00 00 Panel Control
reg(0x00D0) 40 40 01 Power Control
reg(0x00D2) 40 40 01 40 40 NVM Read
reg(0x00D3) 00 00 93 02 ILI9341, ILI9488
reg(0x00D4) 41 41 01 41 Novatek ID
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 93 93 RDID2
reg(0x00DC) 02 02 RDID3
reg(0x00E0) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA-P
reg(0x00E1) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA-N
reg(0x00EF) 00 00 00 00 00 00 ILI9327
reg(0x00F2) 00 00 00 00 00 00 00 00 00 00 00 00 Adjust Control 2
reg(0x00F6) 00 00 00 00 Interface Control

Thanks a lot for you big help

You have a 0x9302.

I have no idea who makes it. I do not think it is Ilitek even if I invent "ILI9302" in the how_to file.

I have never seen a 0x9302. I do not have a datasheet. I just treat it as a generic 240x320 MIPI-style controller.
Do all the tests, colours, directions work in graphictest_kbv on the Mega2560 ?

Both I and Bodmer specify using the TTGO R32 board. I have a custom WROOM-32 module with soldered Arduino headers. The WROOM-32 is not as reliable as the proper TTGO board. I would not trust an ESP32 module with flying wires on a breadboard even if the readreg sketch "works".

David.

the graphictest_kbv on the Mega2560 works very fine.
i used this display with :SPFD5408_Adafruit_GFX.h and SPFD5408_Adafruit_TFTLCD. it works fine too.

now i have a Wroom32 board, with male pin, and i have connected it to the display with female-female jumpwire.
i used this configuration with TFT_eSPI and an SPI ili9341 display, and it works great !!

i think the connections shouldn't create problems, becuse the SPI display in this configuration works very well..

what i can do to use this ili9302 with the Wroom32?

thanks a lot

Yes, SPI controllers work very well on ESP8266 and ESP32 boards. e.g. with Bodmer's TFT_eSPI library.

Parallel controllers are more fussy. Too many pins for ESP8266. You need careful wiring for ESP32.

I know nothing about SPFD5408_Adafruit_TFTLCD
I doubt if it would ever work with an 0x9302 controller

What ID is reported by graphictest_kbv on the ESP32 ?
Does it say 0x9302 ?

David.

hi, LCD_ID_readreg sketch , with ESP32 (WROOM32), giveme the same report as the MEGA2560. it identify the ID 0x9302.

to use graphictest_kbv on the ESP32, i must to redefine the pins. i can easly redefine the control pins RST,CD,RS WR, RD, but how i can redefine the data bit D0-D7?

i'm look inside MCUFRIEND_kbv.h, and it is able to recognize my ili9302 and i think will manage it like an ili9329..

case 0x9302:
_lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS;
goto common_9329;

I don't have a 0x9302. So I can not test it.
I do have several other controllers that I could try e.g. 0x9341

But seriously. Why don't you buy a TTGO R32 board and do the hardware mod described by Bodmer?

I did ask what ID was reported by graphictest_kbv.
Please answer.

Incidentally, you can SLOW down the ESP32 via the IDE Tools Menu. Does this make a difference? e.g. when reading the ID.

David.

Hi David, i can't find the TTGO R3 in Europe, but if i connect a WROOM32 breakout like the TTGO R3, to the display, it must work..
buy the way, if i can, i'll do a PCB with Wroom32 with the UNO pinout, like the TTGO R3.

graphictest_kbv on MEGA2560 reported ID 0x9302.

to run the graphictest_kbv, on Wroom32 i must to redefine the pins. how i can do that?

Incidentally, you can SLOW down the ESP32 via the IDE Tools Menu. Does this make a difference? e.g. when reading the ID.

i have to try that..

thanks for you kindly replay

ciko2k:
Hi David.. thanks a lot for your replay. Now i don't have an UNO, but i used a MEGA2560, and an ESP32 (with my pin definition) with the LCD_ID_readreg.
both board giveme the same resutl.

reg(0x00D3) 00 00 93 02	ILI9341, ILI9488

The wiring was correct for LCD_ID_readreg i.e. as specified by Bodmer (and me)

So you simply run graphictest_kbv withou changing the wiring. Observe the ID reported on the Serial Terminal.
If it does not say 0x9302, SLOW down the clock frequency in the IDE.

As I have said repeatedly. Buy a proper TTGO R32 board from Ebay. Do the hardware mod as shown by Bodmer. Everything should work out of the box i.e. just like running the 0x9302 on a Uno, Mega, Zero, Due, Leonardo, ...

David.

thank you David!!! :kissing: :kissing: :kissing:

graphictest_kbv works great!!! ID 9302!!

now i have to implement the SD and Touch..
have you any library to suggest?

Yes, SD and Touch work. You need the hardware mod for the Touch. TouchScreen_kbv works.
If you only have a few pictures, you can use SPIFFS instead of SD.

Why did 0x9302 not work when you first started?
I suspect that Bodmer's TFT_ePar / eSPI will work now. But it might not like the ILI9341 initialisation.

David.

Hi David,
sorry i was very busy in last days.
i haven't try 0x9302 with graphictest_kbv first, I thought I had to change the definition of pins first.

Where i can change de pin definition?

i try Bodmer's TFT_ePar, and it doesn't works. i think that can do the initialization for 0x9302..

Yes, SD and Touch work. You need the hardware mod for the Touch. TouchScreen_kbv works

how i can do this mod? there is an old post, or could you explain it please?

thank a lot

Go on. Bodmer has replied to your other thread. Message #0 in that thread shows the hardware mod.

I strongly advise that you wire the display according to instructions. Then everything should work with my library and with Bodmer's library.

It does not require Sherlock Holmes to see how to change pin definitions. If you can not discover it for yourself, I suggest that you stick to the default wiring.

Wemos / TTGO R32 boards are very cheap. Just buy one. Do the hardware mod. The shield plugs straight in.

David.

Hi David, Sorry but i can't buy a TTGO, i have to wait 30-40 days to have it, because is sold only in china.

About the pin definition, i referred to MCUFRIEND_kbv library. at the end i have found how to change them, and it works!!

About bodmer's library, i'm so sorry, but it doesn't work. i use the same connectiona and hardware like MCUFRIEND_kbv library, but nothing..
i'll wait to do a PCB with short connection like the TTGO32, and i'll retest the TFT_eSPI library.

thanks for all