ILI9488 / ST7796SI 3.95" TFT LCD Mega Shield

Hi, I have a ILI9488 / ST7796SI 3.95" TFT LCD Mega Shield and I am using it with a Mega2560 wifi board trying to get mcufriend library to work
I see others have had similar problems and have not found a resolution.
I am also getting the same rebuilt picture from - https://forum.arduino.cc/t/ili9488-st7796s/637427/9
The steps I have taken so far include-:
Re-soldered R4 to R5 for 16-bit buffers;
Installed mcufriend library;
Installed Adafruit GFX;

Uncommented:

in utility/mcufriend_shield.h; #define USE_SPECIAL             //check for custom drivers
in utilitymcufriend_special.h; #define USE_MEGA_16BIT_SHIELD     // 2.14sec Mega2560 Shield 

edit to UTFTGLUE.h

 if (ID == 0x00D3 || ID == 0xD3D3) ID = 0x7796;   //write-only controller ST7796S
// if (ID == 0x00D3 || ID == 0xD3D3) ID = 0x9488;   //write-only

It works with both hex ID but the picture is rearranged

I edited diagnose_tft_controller.ino as follows
uint16_t guess_ID = 0x7796; // write-only shield

which resulted in serial log:

Diagnose whether this controller is supported
There are FAQs in extras/mcufriend_how_to.txt

tft.readID() finds: ID = 0xD3D3

MCUFRIEND_kbv version: 2.9.9

Probably a write-only Mega2560 Shield
Try to force ID = 0x7796

PORTRAIT is 320 x 480

I get the Same result on 0x9488.

I can't find the reference but one thing I have noted is David Prentice suggestion on a similar - "The 16-bit Shield should work with UTFT, TFT_HX8357 and other libraries."
"Use TFT_HX8357 because it supports ILI9486. (configure in User_Setup.h)"
I'm not sure if this is the part I am missing here, I do not understand where or how to configure TFT_HX8357
I would greatly appreciate any advice or assistance and able to provide further detail if required.
Thankyou in advance


...Here is a photo of my hardware

I would expect all "write" operations to work 100% in MCUFRIEND_kbv. i.e. you have configured USE_SPECIAL and USE_MEGA_16BIT_SHIELD

However readID() is always going to return 0xD3D3. Hence you have to force tft.begin(0x7796);

Likewise you need to tell UTFTGLUE.h about 0x7796
e.g. in InitLCD(byte orientation=LANDSCAPE)

         ...
         if (ID == 0xD3D3) ID = 0x7796;   //write-only controller ST7796S
         ...

As far as I know, Bodmer has never supported ST7796 in his TFT_HX8357.h library. Nor does UTFT.h library support ST7796

Although UTFTGLUE.h is useful for "running" legacy UTFT programs, I strongly advise using regular GFX methods in any new project.

What MCUFRIEND_kbv version are you using?
The IDE Library Manager installs v2.9.9-Release

David.

1 Like

Thanks for your timely response David. I'm a complete noob to Arduino and have been struggling to figure out what library to use for this display, mcufriend seemed to be the go to on youtube videos I watched. I am happy to use anything that works, I will do some more research with your advice.
P.S. You do an amazing job in contribution and support I'm very impressed with your work :slight_smile:

P.S. I was using v2.9.9 installed from the IDE. Cheers

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.