OpenSmart TFT 3.2" ILI9327 with ESP32

Hello all,

I'm trying to use my OpenSmart 3.2" TFT (240*400) with my ESP32 board but it's a little difficult for me.

I try this TFT with a 2560 board and all is OK, for this I use the MCUFRIEND_kbv.

But I want to use an ESP32 for increase the display speed !

The driver is an ILI9327, the board is :

Somebody could help me for wiring the screen and use the good lib ? Because I don't know how I can change the pinout in the lib...

Your title says ILI9327
Your photo shows HX8352B

If you want to go faster than the MEGA2560, why not use a Uno ?

David.

Hello,

I take the picture on a website, but this is exactly this board with an ILI9327;

I want to use the hardware on my side, so I don't want to buy another screen or Arduino :slight_smile:

BR

In which case, you should explain any "differences" between your board and photo.

MCUFRIEND_kbv supports ESP32 e.g. Mcufriend shields on TTGO/Wemos R32 Uno-style board.

There is a small hardware mod for R32 boards.

OpenSmart pinout is slightly different to the Mcufriend pinout. But pins on your pcb are clearly marked.
If you are using trailing wires to small ESP32 module, just use the Mcufriend wiring.

David.

I uploaded the ESP32 and Screen :


In the MCU example, there are these pinouts (default I think):
// TFT Breakout -- Arduino UNO / Mega2560 / OPEN-SMART UNO Black
// GND -- GND
// 3V3 -- 3.3V
// CS -- A3
// RS -- A2
// WR -- A1
// RD -- A0
// RST -- RESET
// LED -- GND
// DB0 -- 8
// DB1 -- 9
// DB2 -- 10
// DB3 -- 11
// DB4 -- 4
// DB5 -- 13
// DB6 -- 6
// DB7 -- 7

How can I modify these pinout ?

Re David,

I tested the sketch LCD_ID_REG, with the below pinout :
#define LCD_RST 32
#define LCD_CS 33
#define LCD_RS 15
#define LCD_WR 4
#define LCD_RD 2

#define LCD_D0 12
#define LCD_D1 13
#define LCD_D2 26
#define LCD_D3 25
#define LCD_D4 17
#define LCD_D5 16
#define LCD_D6 27
#define LCD_D7 14

I checked my iring and all is OK.
But the result is :

Read Registers on MCUFRIEND UNO shield
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 00 00 Manufacturer ID
reg(0x0009) 00 00 00 00 00 Status Register
reg(0x000A) 00 00 Get Power Mode
reg(0x000C) 00 00 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 00 00 00 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) 00 00 00 Power Control
reg(0x00D2) 00 00 00 00 00 NVM Read
reg(0x00D3) 00 00 00 00 ILI9341, ILI9488
reg(0x00D4) 00 00 00 00 Novatek ID
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 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

Could you help me please ? :slight_smile:

Only you can check your wiring.

Clearly you have not connected correctly.

I suggest that you print your #defines onto paper.
Then check each wire in sequence. Tick each line as you progress through the list.

If you post a clear photo, readers might compare the photo with your defines.
Hint different coloured wires. Pull the wires straight.

David.

I rewiring and re-tested, but same result.

I attached pictures, but it is a little difficult to show all wires with pinout attached !





I don't understand :confused: I retested the screen on my 2560 and all is OK.
The only "problem" is that I have no RESET pin on this shield screen. So I used the pin below LCD_CS because it is the defined pin in the OPENSMART lib (A04 on the 2560 board).

Surely you could show a photo with coloured wires on the Shield.
And a photo with coloured wires on the ESP32

Even better. Add the wire colour to each define e.g.

#define LCD_RST 32
#define LCD_CS 33
#define LCD_RS 15
#define LCD_WR 4
#define LCD_RD 2

#define LCD_D0 12  //violet
#define LCD_D1 13  //orange
#define LCD_D2 26  //...
#define LCD_D3 25
#define LCD_D4 17
#define LCD_D5 16
#define LCD_D6 27
#define LCD_D7 14

This will make your checklist easier to follow.
And possibly more likely for a reader to assist.

There is no LCD_RST pin on your shield. Just define as any unused pin.

When your wiring is correct the readreg sketch will report the correct values.

David.

Yes :slight_smile:

Corresponding to the pictures in my previous post, colors are :

#define LCD_RST 32 //brown
#define LCD_CS 33 //red
#define LCD_RS 15 //white
#define LCD_WR 4 //yellow
#define LCD_RD 2 //purple

#define LCD_D0 12 //purple
#define LCD_D1 13 //orange
#define LCD_D2 26 //yellow
#define LCD_D3 25 //orange
#define LCD_D4 17 //grey
#define LCD_D5 16 //blue
#define LCD_D6 27 //green
#define LCD_D7 14 //blue

Nothing in Arduino IDE could be the root of the issue ? Maybe a bad configuration... I selected the ESP32 DevKit board, and change nothing in the config menu (flash mode, speed etc..)

Yes, your colours match. Now you check that it is the same wire that joins.

Seriously. A paper checklist and a pencil will be a good investment.

Note that Dupont wires can break or become loose.

This is why I recommend a Shield mating with Arduino headers as Nature intended.
The TTGO board is inexpensive.

David.

OK I found the root of the issue....................

I connected the screen VCC to the 3.3V of the ESP32... But he need 5V because there is a voltage regulator on the board, and the input of this regulator must be up to 3.3V ...

Now I see :

reg(0x0000) 00 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 54 00 00 Manufacturer ID
reg(0x0009) 00 00 64 00 00 Status Register
reg(0x000A) 00 20 Get Power Mode
reg(0x000C) 00 06 Get Pixel Format
reg(0x0061) 06 06 RDID1 HX8347-G
reg(0x0062) 06 06 RDID2 HX8347-G
reg(0x0063) 06 06 RDID3 HX8347-G
reg(0x0064) 06 06 RDID1 HX8347-A
reg(0x0065) 06 06 RDID2 HX8347-A
reg(0x0066) 06 06 RDID3 HX8347-A
reg(0x0067) 06 06 RDID Himax HX8347-A
reg(0x0070) 06 06 Panel Himax HX8347-A
reg(0x00A1) 00 00 FF 00 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 35 00 00 01 02 02 02 Panel Control
reg(0x00C8) 02 44 44 44 44 08 10 44 44 44 44 08 10 GAMMA
reg(0x00CC) 10 10 Panel Control
reg(0x00D0) 10 07 04 Power Control
reg(0x00D2) 04 01 44 44 44 NVM Read
reg(0x00D3) 44 01 44 44 ILI9341, ILI9488
reg(0x00D4) 44 01 44 44 Novatek ID
reg(0x00DA) 00 54 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 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 02 04 93 27 FF ILI9327
reg(0x00F2) FF FF FF FF FF FF FF FF FF FF FF FF Adjust Control 2
reg(0x00F6) FF FF FF FF Interface Control

I tested GraphicTest_kbv but the screen stay white. I modify the line :

ID = 0x9327; // force ID

And the serial monitor swho :

Serial took 0ms to start
ID = 0x9327

Is it 9327 supported by MCUFRIEND ?

reg(0x00EF) 00 02 04 93 27 FF ILI9327

Yes, you have an ILI9327.
Yes, ILI9327 is supported.

I have a regular ILI9327. I could plug it into the TTGO board. I am sure it will be fine.

You must connect all the Shield pins. e.g. 3.3V, 5V, GND, ...

David.

I connected all pins.

I checked the schematic, and I think that my issue come from the logic signal voltage...

There are "LCD_xx_5V" signal on the schematic, and 3.3v provided by the ESP32.

White screen come from this issue no ?

Schematic : https://www.naylampmechatronics.com/img/cms/Esquematicos/TFT%20Shield%203-2inch%208352B%20Schematic.pdf

Your shield is quite happy with 3.3V GPIO. The LCD_xx_5V signals can be 2.8V to 5V. They should be fine with your ESP32 3.3V logic.

Yes, the regulator requires 5V to create the 3.3V VCC required by the electronics. The shield does not use the 3.3V pin.

The LM75AD seems to be the only item that expects 5V logic.

David.

Okay, so I don't really no why my screen is white -_-

I plugged the regular ILI9327 shield into the TTGO board. Worked fine.
Then I edited the shield.h to match the OpenSmart Shield and defined SUPPORT_8352B in the CPP

The HX8352B OpenSmart shield ran all the graphictest_kbv tests fine.
It is currently displaying a series of JPEG images from ESP32 PROGMEM memory.

I possess a WROOM-32 module hand soldered to a Protoshield.
It "runs" MCUFRIEND_kbv sketches but is unreliable.
Which is why I only recommend the TTGO board.

I would never have confidence in random Dupont wires.

I strongly suggest that you use SPI displays with ESP32. And the SPI displays will run on the ESP8266 too.

David.

Then I edited the shield.h to match the OpenSmart Shield and defined SUPPORT_8352B in the CPP

Wich lines have you edited in the shield.h ?

I will check later for other screen... But I want to know why this screen does not display something with the ESP !

Thank you :slight_smile:

I expect to use shields. Whatever the target.

Open-Smart shields route LCD_D2, LCD_D3, LCD_D5 from digital# 2, 3, 5 to 10, 11, 13 e.g. for TTGO:

#define LCD_D2 5 //26
#define LCD_D3 23 //25
#define LCD_D5 18 //16

I support the Open-Smart remapping for Uno, Mega, Leo. I do not intend to support other targets.

As I explained. It is unwise (tm) to use Dupont wires. Buy a proper TTGO board.

David.

Okayyyyy now it's OKAY :slight_smile: :slight_smile:

I think taht the issue come from the PIN12, I must remove the wire from PIN12, upload the code, and rewire.

I see this issue on other forum.

Thank you for patience David :slight_smile: