I bought an OPEN-SMART ILI9329 touchscreen LCD-TFT (3.2" 240X320) together with a (clone) Mega2560.
Issue:
I am trying to get it to work with MCUFRIEND_kbv original library but whatever I do, it does not display. Display stays completely white.
I am using Arduino IDE 1.8.19 (latest as of writing) and I installed the original MCUFRIEND_kbv and Adafruit_GFX libraries through the library manager.
Using the (old) provided libraries from the seller does work. These libraries seem to use a hacked version of an old MCUFRIEND library so I really do not prefer to use them.
The boards were ordered as a set (Mega2560 blue board and the 3.2" LCD touchscreen red board) from here:
https://nl.aliexpress.com/item/32756200704.html
On the board it says it uses driver chip ILI9329.
The pin-out on this board is not the default uno or mega pin-out so I redefined the pin-out in the LCD_ID_readreg.ino to use the following:
LCD_ID_readreg.ino:
#define LCD_RST A4
#define LCD_CS A3
#define LCD_RS A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_D0 8
#define LCD_D1 9
#define LCD_D2 10
#define LCD_D3 11
#define LCD_D4 4
#define LCD_D5 13
#define LCD_D6 6
#define LCD_D7 7
I am unsure as to why they used a non-default pinout. Maybe because the display shield has a SD
card reader and those altered pins are used for that.
This is what is stated in the graphictest.ino that I got with the library from the seller:
//***********************************************//
// If you use OPEN-SMART TFT breakout board //
// Reconmmend you to add 5V-3.3V level converting circuit.
// Of course you can use OPEN-SMART UNO Black version with 5V/3.3V power switch,
// you just need switch to 3.3V.
// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
//----------------------------------------|
// 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
Just to be clear, this display board has a 5V to 3V3 converter.
As can be seen the reset is not connected to A4 but to the arduino reset? I left the A4 reference though in the altered pinout because I did not know how to define it otherwise.
I tried using the original MCUFRIEND_kbv library unaltered except for the pin definitions in LCD_ID_readreg.ino and when that was not working I tried using:
#define USE_SPECIAL (mcufriend_shield.h) together with
#define USE_OPENSMART_SHIELD_PINOUT_MEGA (mcufriend_special.h)
Both configurations do not change the outcome. Still white screen.
Running LCD_ID_readreg.ino with the altered pinout (see above) outputs the following:
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 E3 00 00 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x000A) 00 08 Get Power Mode
reg(0x000C) 00 06 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 02 Inversion Control
reg(0x00B6) 02 0A 82 27 04 Display Control
reg(0x00B7) 00 06 Entry Mode Set
reg(0x00BF) 06 02 02 02 02 02 ILI9481, HX8357-B
reg(0x00C0) 02 1A 16 16 16 16 16 16 16 Panel Control
reg(0x00C8) 16 16 16 16 16 16 16 16 16 16 16 16 16 GAMMA
reg(0x00CC) 16 2D Panel Control
reg(0x00D0) 07 00 00 Power Control
reg(0x00D2) 00 00 00 02 02 NVM Read
reg(0x00D3) 02 00 93 29 ILI9341, ILI9488
reg(0x00D4) 29 29 29 29 Novatek ID
reg(0x00DA) 29 E3 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 RDID3
reg(0x00E0) 00 00 04 0F 04 16 08 37 69 47 47 0C 09 1A 1B 0F GAMMA-P
reg(0x00E1) 00 06 24 28 01 0C 01 38 30 46 02 09 09 32 36 0F GAMMA-N
reg(0x00EF) 00 04 2A 00 00 00 ILI9327
reg(0x00F2) 00 00 00 00 00 00 00 00 00 00 00 00 Adjust Control 2
reg(0x00F6) 00 41 00 00 Interface Control
So it seems from register 0xD3 that 93 29 is indeed being recognized.
But the ID (register 0) gives 00 00 ? Why? I do not understand.
Next I also tried using jumper wiring to wire all lines from the display to the MEGA as original wiring and I put back the original MCUFRIEND pinout. This also did not work with or without the additional use special defines.
When I try to run the example 'Font_simple.ino' and I watch the serial output I see
Without the display attached it says:
found ID = 0xD3D3
With the display attached it gives:
Example: Font_simple
found ID = 0x0
Is this the display ID? Is that maybe the problem? The display ID not being recognized here?
[EDIT] The graphictest.ino from the supplied library also reports the ID but the ID found is:
ID = 0x202
But that ID is subsequently not being used as there is a hardcoded
tft.begin(0x9329);
after.
When I use the library (old) that I got from the seller the display works and I can run the graphictest.ino from that. But I really prefer not to use that as it is old and not maintained. I really would like to use the MCUFRIEND_kbv original library as it is maintained, has more examples and I think might run quicker. I read something about rotating being done in a strange way in the hacked library.
I have the electrical schematic of the display shield. I will try to attach it to this thread.
I can also attach the library that I got from the seller if that helps.
Another very annoying issue with these boards is that I cannot upload sketches with the display attached. This is because the 6 In-Circuit-Serial-Programming ICSP are being connected. As soon as I use jumper wires to connect the display and not wire the 6 ICSP pins I can upload.
If the pins are connected I get a timeout error.
Ultimate goal is to use these boards to make a logging module for my solar panels power converter. logging serial message from the PV converter and being able to display PV solar graphs on the display while saving the data to the SD card on the display. For this I would really much like to use the original maintained MCUFRIEND library as it seems to be well made and well maintained and not the hacked old non-maintained library from the seller.
Any help is very much appreciated.
If I forgot to mention any information please let me know and I'll add it to this thread.
[edit] Just tried to upload the PDF but as I am a new user of this forum I am not allowed.. bummer.
Alwin