Can't get TFT LCD display to work with UNO/Mega

Hello!
I was using an Arduino Mega2560 in a project which included, among some other sensors and actuators, a 3.5" 16bit 320x480 LCD TFT shield with a ILI9486 driver. That screen, however, got damaged, and a colleague gave me a 3.5" 8bit ILI9488 320x480 shield which he had laying around.
The new one is a UNO shield, which I planned to connect to my Mega using the USE_MEGA_8BIT_SHIELD pinout from MCUFRIEND_kbv. Since I wasn't the one who bought it, I don't know the exact model, but here is a picture:

I have been trying to get this screen to work for the whole week, but aside from the backlight, I get no response from any of the examples I tried (the ones from the MCUFRIEND_kbv library and these ones, which were used in this PDF I found from a similar shield), even when using it as intended on an UNO.

Has anyone worked with a similar shield before? I first thought it might be broken, but had the same problem with an identical one which my colleague also had.

You have a regular "Uno Shield".

You can plug it into a Uno, Leo, MEGA2560, Zero, ... just as Nature intended.

MCUFRIEND_kbv will compile and upload out of the box. i.e. you do not need any USE_SPECIAL define or any special wiring.

If your old display was "USE_MEGA_16BIT_SHIELD" i.e. had 18x2 header you will need to remove the USE_SPECIAL define. Otherwise it will expect to see a MEGA style shield if your IDE is configured for a MEGA2560 Board.

Simple answer is: the library was intended for Uno-style shields.

David.

p.s. your Uno shield will run on the MEGA2560 but it will be slower than on a Uno.

Thanks for the quick response!

That's the thing: even without the USE_SPECIAL, using the standard pinout on a standard Uno, the only thing which works is the backlight:

My final goal is to use it on the Mega, but I'm currently testing it on an Uno for the sake of practicality.

I don't believe you.
Delete any previous MCUFRIEND_kbv from the libraries folder.

  1. Plug the Shield from photo in #1 into the Uno.
  2. Install MCUFRIEND_kbv via the IDE Library Manager.
  3. Run all of the library examples.
  4. Plug the Shield into the MEGA2560.
  5. Run examples.

David.

Ok, so I've:

  1. Deleted all display-related libraries
  2. Pluged the shield (same from photos #1 and #2 ) into the Uno
  3. Installed MCUFRIEND_kbv via the IDE Library Manager (version 3.0.0)
  4. Installed Adafruit GFX Library and Adafruit BusIO via the IDE Library Manager (version 1.11.3)
  5. Loaded graphictest_kbv exactly as it is in the library.
  6. Still, the result is the same as photo #2. Only backlight works :confused:

I also ran LCD_ID_readreg, and got the following message:

reg(0x0000) 00 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 54 80 46 Manufacturer ID
reg(0x0009) 00 00 41 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 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 0E 0E 0E 0E 0E 0E 0E 0E Panel Control
reg(0x00C8) 00 90 90 90 90 90 90 90 90 90 90 90 90 GAMMA
reg(0x00CC) 00 03 Panel Control
reg(0x00D0) 00 00 00 Power Control
reg(0x00D2) 00 00 00 00 0D NVM Read
reg(0x00D3) 00 00 94 88 ILI9341, ILI9488
reg(0x00D4) 00 97 00 00 Novatek ID
reg(0x00DA) 00 54 RDID1
reg(0x00DB) 00 80 RDID2
reg(0x00DC) 00 46 RDID3
reg(0x00E0) 00 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E 0E GAMMA-P
reg(0x00E1) 00 44 08 08 08 08 08 08 08 08 08 08 08 08 08 08 GAMMA-N
reg(0x00EF) 00 D8 D8 D8 D8 D8 ILI9327
reg(0x00F2) 00 00 00 00 0D 40 00 00 00 00 00 00 Adjust Control 2
reg(0x00F6) 00 00 00 00 Interface Control

You have an ILI9488 controller.

It should work. It has read the ID correctly.
But reg(0xE0) is wrong for an ILI9488

What does the Serial Terminal say ?

David.

In graphictest_kbv, the serial terminal say:

Serial took 0ms to start
ID = 0x9488

And that's it...

Kind of an update:

Still can't get the screen to work, so I've decided to post some more info, in case somebody goes through the same problems. This is a video of me running graphictest_kbv, and these are all the compiler warnings I get after loading:

D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\examples\graphictest_kbv\graphictest_kbv.ino: In function 'void runtests()':
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\examples\graphictest_kbv\graphictest_kbv.ino:268:26: warning: unused variable 'cnt' [-Wunused-variable]
     uint8_t i, len = 24, cnt;
                          ^~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp: In member function 'uint16_t MCUFRIEND_kbv::readReg(uint16_t, int8_t)':
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:165:13: warning: unused variable 'lo' [-Wunused-variable]
     uint8_t lo;
             ^~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp: In member function 'uint16_t MCUFRIEND_kbv::readID()':
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:264:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (ret == 0x1526)          //R61526 [xx 06 15 26] if I have written NVM
     ^~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:266:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  if (ret == 0x89F0)          //ST7735S: [xx 7C 89 F0]
  ^~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:197:19: warning: unused variable 'ret2' [-Wunused-variable]
     uint16_t ret, ret2;
                   ^~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp: In member function 'int16_t MCUFRIEND_kbv::readGRAM(int16_t, int16_t, uint16_t*, int16_t, int16_t)':
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:300:22: warning: unused variable 'tmp' [-Wunused-variable]
     uint8_t r, g, b, tmp;
                      ^~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp: In member function 'virtual void MCUFRIEND_kbv::setRotation(uint8_t)':
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:361:29: warning: unused variable 'REV' [-Wunused-variable]
     uint16_t GS, SS_v, ORG, REV = _lcd_rev, NL;
                             ^~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp: In member function 'void MCUFRIEND_kbv::begin(uint16_t)':
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:1295:30: warning: unused variable 'SSD1963_NHD_50_regValues' [-Wunused-variable]
         static const uint8_t SSD1963_NHD_50_regValues[] PROGMEM = {
                              ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:1310:30: warning: unused variable 'SSD1963_NHD_70_regValues' [-Wunused-variable]
         static const uint8_t SSD1963_NHD_70_regValues[] PROGMEM = {
                              ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:1352:30: warning: unused variable 'SSD1963_800NEW_regValues' [-Wunused-variable]
         static const uint8_t SSD1963_800NEW_regValues[] PROGMEM = {
                              ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:1376:30: warning: unused variable 'SSD1963_800ALT_regValues' [-Wunused-variable]
         static const uint8_t SSD1963_800ALT_regValues[] PROGMEM = {
                              ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:1400:30: warning: unused variable 'SSD1963_480_regValues' [-Wunused-variable]
         static const uint8_t SSD1963_480_regValues[] PROGMEM = {
                              ^~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:1638:31: warning: unused variable 'ST7781_regValues' [-Wunused-variable]
         static const uint16_t ST7781_regValues[] PROGMEM = {
                               ^~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:1738:30: warning: unused variable 'ST7789_regValues_arcain6' [-Wunused-variable]
         static const uint8_t ST7789_regValues_arcain6[] PROGMEM = {
                              ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:2657:30: warning: unused variable 'ILI9341_regValues_ada' [-Wunused-variable]
         static const uint8_t ILI9341_regValues_ada[] PROGMEM = {        // Adafruit_TFTLCD only works with EXTC=0
                              ^~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:2737:30: warning: unused variable 'ILI9481_CPT29_regValues' [-Wunused-variable]
         static const uint8_t ILI9481_CPT29_regValues[] PROGMEM = {    // 320x430
                              ^~~~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:2749:30: warning: unused variable 'ILI9481_PVI35_regValues' [-Wunused-variable]
         static const uint8_t ILI9481_PVI35_regValues[] PROGMEM = {    // 320x480
                              ^~~~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:2761:30: warning: unused variable 'ILI9481_AUO317_regValues' [-Wunused-variable]
         static const uint8_t ILI9481_AUO317_regValues[] PROGMEM = {    // 320x480
                              ^~~~~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:2772:30: warning: unused variable 'ILI9481_CMO35_regValues' [-Wunused-variable]
         static const uint8_t ILI9481_CMO35_regValues[] PROGMEM = {    // 320480
                              ^~~~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:2786:30: warning: unused variable 'ILI9481_RGB_regValues' [-Wunused-variable]
         static const uint8_t ILI9481_RGB_regValues[] PROGMEM = {    // 320x480
                              ^~~~~~~~~~~~~~~~~~~~~
D:\Documentos\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:2878:7: warning: label 'common_9488' defined but not used [-Wunused-label]
       common_9488:
       ^~~~~~~~~~~

Sketch uses 31894bytes (98%) of program storage space. Maximum is 32256 bytes. Global variables use 1713 bytes (83%) of dynamic memory, leaving 335 bytes for local variables.
Low memory available, stability problems may occur.

The serial message is still the same as last time:

Serial took 0ms to start
ID = 0x9488

Any suggestions?

Yes, tft.readID() is returning the correct ID.

The build "warnings" are nothing to worry about.

I would expect a genuine ILI9488 to work out of the box.
Please force the library to use 0x9486 instead. e.g.
tft.begin(0x9486);
Report back.

Did your colleague say whether the shield was working?

The readreg report shows some unusual values for an Ilitek ILI9488.

David.

Thanks again for the quick response.

I just tried forcing the 0x9486 on the tft.begin in graphictest_kbv, but got the same behavior (blank screen with backlight on).

He gave me two of these shields, both still on individual sealed packages (same SKU and appearence). All the tests I've run until now, I ran on both screens. According to him, they were bought some time ago for a different project which never saw the light of day, so he didn't even open the packages. Could this be a problem with the whole batch?

Ah-ha. If they were still in the original sealed bags they are probably ok.

But they might require some more "manufacturer registers" to be initialised.
What is the SKU number on the sealed package ? SKU:UNO3501

Googling UNO3501 shows that other readers have the same Shield. e.g.
https://forum.arduino.cc/t/ili9488-uno-shield/974378

I have never seen this particular pcb. But from the linked Message Thread it appears to have corrected all the normal Mcufriend electrical errors.

David.

Sorry, I don't understand what you mean by "manufacturer registers". I looked at the thread you linked, but if I understand it correctly (English is not my first language), OP got this same shield to work by using your (awesome) library with the standard pin attachment:

Reset -> A4
CS -> A3
RS/DC -> A2
WR -> A1
RD -> A0

Is there another procedure I should've followed in order for it to work?

You don't have to worry about "manufacturer registers".
You don't have to worry about wiring. The Shield always plugs into A0-A4.

I might post something for you to try tomorrow.

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