Problem 3.5" TFT LCD white screen

I have the same problem with this screen, after connecting it displays a white screen.

library :
#include <UTFT.h>

///UTFT myGLCD(R61581,38,39,40,41);

UTFT myGLCD(CTE35IPS,38,39,40,41);

Not work

What else do you expect you need to set up background etc...

Also you will need to set up the backlight input...

Problem 3.5" TFT LCD mcufriend white screen

I have the same problem with this screen, after connecting it displays a white screen.

I also bought 3.5" tft from mcufriend, low cost (10$ incl. shipping) but hard work to make it working...
I have partially good result with UTFT and this init line using UTFT_Demo_320x240, on arduino Mega2560

UTFT myGLCD(ILI9325D_16,38,39,40,41);

It seems then that the controller is ILI9325 connected with 16 bit.
The demo is working 99% correctly, but it is flickering during display update, and some lines appears.

I have one myself, and have the same problems.

Is the TFT LCD shield required to be used between the Arduino ( I am using the Due ) and the screen?

Also, the silkscreen on the back of the LCD says it is an ili9488 chipset.

Thanks!

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) 1C 1C ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 1C 1C 1C 1C Manufacturer ID
reg(0x0009) 1D 1D 1D 1D 1D Status Register
reg(0x000A) 1E 1E Get Powsr Mode
reg(0x000C) 1C 1C Get Pixel Format
reg(0x0061) 75 75 RDID1 HX8347-G
reg(0x0062) 76 76 RDID2 HX8347-G
reg(0x0063) 77 77 RDID3 HX8347-G
reg(0x0064) 74 74 RDID1 HX8347-A
reg(0x0065) 75 75 RDID2 HX8347-A
reg(0x0066) 76 76 RDID3 HX8347-A
reg(0x0067) 77 77 RDID Himax HX8347-A
reg(0x0070) 74 74 Panel Himax HX8347-A
reg(0x00A1) B5 B5 B5 B5 B5 RD_DDB SSD1963
reg(0x00B0) B4 B4 RGB Interface Signal Control
reg(0x00B4) B4 B4 Inversion Control
reg(0x00B6) B6 B6 B6 B6 B6 Display Control
reg(0x00B7) B7 B7 Entry Mode Set
reg(0x00BF) BF BF BF BF BF BF ILI9481, HX8357-B
reg(0x00C0) 5C 5C 5C 5C 5C 5C 5C 5C 5C Panel Control
reg(0x00C8) 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C 5C GAMMA
reg(0x00CC) 5C 5C Panel Control
reg(0x00D0) 5C 5C 5C Power Control
reg(0x00D2) 5E 5E 5E 5E 5E NVM Read
reg(0x00D3) 5F 5F 5F 5F ILI9341, ILI9488
reg(0x00DA) 5E 5E RDID1
reg(0x00DB) 5F 5F RDID2
reg(0x00DC) 5C 5C RDID3
reg(0x00E0) F4 F4 F4 F4 F4 F4 F4 F4 F4 F4 F4 F4 F4 F4 F4 F4 GAMMA-P
reg(0x00E1) F5 F5 F5 F5 F5 F5 F5 F5 F5 F5 F5 F5 F5 F5 F5 F5 GAMMA-N
reg(0x00EF) FF FF FF FF FF FF ILI9327
reg(0x00F2) F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 F6 Adjust Control 2
reg(0x00F6) F6 F6 F6 F6 Interface Control

The previous 4 messages are all about a Mcufriend mega2560 Shield.
The mega2560 shields are write-only. Most of these are 16-bit. Some are 8-bit.

The MCUFRIEND_kbv library is designed for Uno shields which are read-write.
The LCD_ID_readreg sketch can only work with a readable Shield.

The MCUFRIEND_kbv library can be used with write-only Shields. But you have to guess which controller ID to use. And configure for SPECIAL wiring.

None of the 5 messages in this thread have included photos or links to the actual sale item.
If you can verify that your item pcb matches a photo, we can make some inspired guesses.

Configuring MCUFRIEND_kbv to use a 16-bit mega2560 Shield is fiddly. i.e.
#define USE_SPECIAL
#define USE_MEGA_16BIT_SHIELD
tft.begin(0x9488);

Post a photo first. Then we can walk you through the complex process.

David.

Attached is the picture, I hope.

Also, when talking about the shield, are you referencing the LCD screen itself, or the go-between I have seen that goes between the LCD and the Arduino?

mcufriend3point5inch-tft_ili9488_rear.zip (878 KB)

display_shield.jpg

The photo of the Red shield looks like a regular Mcufriend Shield for mega2560. (I have one very similar)
The photo of the Blue object is unrecognisable. But it certainly is NOT red.

Install MCUFRIEND_kbv from Library Manager in IDE

Configuring MCUFRIEND_kbv to use a 16-bit mega2560 Shield is fiddly. i.e. editing files

mcufriend_shield.h:

#define USE_SPECIAL

mcufriend_special.h

#define USE_MEGA_16BIT_SHIELD

graphictest_kbv.ino sketch setup()

tft.begin(0x9488);    // force the ID for an ILI9488

If you look at most examples, you will see a line like this in setup():

    if (ID == 0xD3D3) ID = 0x8357; // write-only shield

When you have found the "best" 320x480 ID in the library, substitute that ID in place of the 0x8357
Please tell me which ID works for you. e.g. my similar shield has got a RM68140 with ID = 0x6814

David.

Attached is the shield I purchased from ebay.

It is obviously not an Arduino-branded item.

It does not pass any voltage from the arduino to the lcd.

Your JPEGs show a 40-pin Adapter Shield for a Mega for connecting a 3.3V 40-pin dislay.

There are several makes. Some use level-shifter chips. Some use resistors.

40-pin 3.3V displays have a fairly standard pinout. The Adapters tend to route the signals to standard Mega pinout.

David.

I had this tft, and I know that this screen dont use a shild.

I use the library the Rinky-Dink Electronics with the ILI9481 or ILI9486.

@Hizard,

What tft do you have?

The ILI9481 and ILI9486 have very different Manufacturer Registers. And they behave differently.

If your display fits onto your Mega with the male pins mating naturally with the female header sockets, it iis called a "Shield". e.g. displays from #5, #7.

If your display has 40-pins, you need a 40-pin Adapter Shield for Mega (or Due).

David.

I'm happy, I finally got mine to do something!

First, I bought a Mega2560, as it was suggested that using a Due was probably not working due to voltage differences.

I plugged the LCD straight into the Mega and kept on having problems, so I kept fiddling with the library and sketch until I got something to happen, which was the display being off-centered and not full-screen.

I am using the UTFT library ( circa 2012, as the newer version doesn't work, even when using the exact same settings and whatnot ) from Rinky Dink Electronics.

What I did to the sketch was run it with different controllers until something displayed, which is the ILI9327, and then I changed that entry in the library ( the .cpp file ) to match what I thought were the X and Y limits of the LCD, 479 and 319, respectively:

case ILI9327: /* So far, this is the only one that works */
 disp_x_size=319; /* with my mcufriend 3.5" TFT LCD for      */
 disp_y_size=479; /* Arduino Mega2560(ili9488)   */
 display_transfer_mode=16;
 break;

and here is the sketch I am running:

// UTFT_Demo_480x272 (C)2012 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a demo of how to use most of the functions
// of the library with a supported display modules.
//
// This demo was made for modules with a screen resolution 
// of 480x272 pixels.
//
// This program requires the UTFT library.
//

#include <UTFT.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];

// Uncomment the next line for Arduino 2009/Uno
//UTFT myGLCD(ITDB43,19,18,17,16);   // Remember to change the model parameter to suit your display module!

// Uncomment the next line for Arduino Mega
UTFT myGLCD(ILI9327,38,39,40,41);   // Remember to change the model parameter to suit your display module!

void setup()
{
  randomSeed(analogRead(0));
  
// Setup the LCD
  myGLCD.InitLCD();
  myGLCD.setFont(SmallFont);
}

void loop()
{
  int buf[478];
  int x, x2;
  int y, y2;
  int r;

// Clear the screen and draw the frame
  myGLCD.clrScr();

  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRect(0, 0, 479, 13);
  myGLCD.setColor(64, 64, 64);
  myGLCD.fillRect(0, 258, 479, 271);
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.print("* Universal Color TFT Display Library *", CENTER, 1);
  myGLCD.setBackColor(64, 64, 64);
  myGLCD.setColor(255,255,0);
  myGLCD.print("<http://electronics.henningkarlsen.com>", CENTER, 259);

  myGLCD.setColor(0, 0, 255);
  myGLCD.drawRect(0, 14, 479, 257);

// Draw crosshairs
  myGLCD.setColor(0, 0, 255);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.drawLine(239, 15, 239, 256);
  myGLCD.drawLine(1, 135, 478, 135);
  for (int i=9; i<470; i+=10)
    myGLCD.drawLine(i, 133, i, 138);
  for (int i=15; i<256; i+=10)
    myGLCD.drawLine(237, i, 241, i);

// Draw sin-, cos- and tan-lines  
  myGLCD.setColor(0,255,255);
  myGLCD.print("Sin", 5, 15);
  for (int i=1; i<478; i++)
  {
    myGLCD.drawPixel(i,135+(sin(((i*1.13)*3.14)/180)*95));
  }
  
  myGLCD.setColor(255,0,0);
  myGLCD.print("Cos", 5, 27);
  for (int i=1; i<478; i++)
  {
    myGLCD.drawPixel(i,135+(cos(((i*1.13)*3.14)/180)*95));
  }

  myGLCD.setColor(255,255,0);
  myGLCD.print("Tan", 5, 39);
  for (int i=1; i<478; i++)
  {
    myGLCD.drawPixel(i,135+(tan(((i*1.13)*3.14)/180)));
  }

  delay(2000);
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);
  myGLCD.setColor(0, 0, 255);
  myGLCD.setBackColor(0, 0, 0);
  myGLCD.drawLine(239, 15, 239, 256);
  myGLCD.drawLine(1, 135, 478, 135);

// Draw a moving sinewave
  x=1;
  for (int i=1; i<(478*20); i++) 
  {
    x++;
    if (x==479)
      x=1;
    if (i>479)
    {
      if ((x==239)||(buf[x-1]==135))
        myGLCD.setColor(0,0,255);
      else
        myGLCD.setColor(0,0,0);
      myGLCD.drawPixel(x,buf[x-1]);
    }
    myGLCD.setColor(0,255,255);
    y=135+(sin(((i*1.65)*3.14)/180)*(90-(i / 100)));
    myGLCD.drawPixel(x,y);
    buf[x-1]=y;
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);

// Draw some filled rectangles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        myGLCD.setColor(255,0,255);
        break;
      case 2:
        myGLCD.setColor(255,0,0);
        break;
      case 3:
        myGLCD.setColor(0,255,0);
        break;
      case 4:
        myGLCD.setColor(0,0,255);
        break;
      case 5:
        myGLCD.setColor(255,255,0);
        break;
    }
    myGLCD.fillRect(150+(i*20), 46+(i*20), 210+(i*20), 106+(i*20));
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);

// Draw some filled, rounded rectangles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        myGLCD.setColor(255,0,255);
        break;
      case 2:
        myGLCD.setColor(255,0,0);
        break;
      case 3:
        myGLCD.setColor(0,255,0);
        break;
      case 4:
        myGLCD.setColor(0,0,255);
        break;
      case 5:
        myGLCD.setColor(255,255,0);
        break;
    }
    myGLCD.fillRoundRect(330-(i*20), 46+(i*20), 270-(i*20), 106+(i*20));
  }
  
  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);

// Draw some filled circles
  for (int i=1; i<6; i++)
  {
    switch (i)
    {
      case 1:
        myGLCD.setColor(255,0,255);
        break;
      case 2:
        myGLCD.setColor(255,0,0);
        break;
      case 3:
        myGLCD.setColor(0,255,0);
        break;
      case 4:
        myGLCD.setColor(0,0,255);
        break;
      case 5:
        myGLCD.setColor(255,255,0);
        break;
    }
    myGLCD.fillCircle(180+(i*20),75+(i*20), 30);
  }
  
  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);

// Draw some lines in a pattern
  myGLCD.setColor (255,0,0);
  for (int i=15; i<256; i+=5)
  {
    myGLCD.drawLine(1, i, (i*1.88)-10, 256);
  }
  myGLCD.setColor (255,0,0);
  for (int i=256; i>15; i-=5)
  {
    myGLCD.drawLine(478, i, (i*1.88)-11, 15);
  }
  myGLCD.setColor (0,255,255);
  for (int i=256; i>15; i-=5)
  {
    myGLCD.drawLine(1, i, 491-(i*1.88), 15);
  }
  myGLCD.setColor (0,255,255);
  for (int i=15; i<256; i+=5)
  {
    myGLCD.drawLine(478, i, 490-(i*1.88), 256);
  }
  
  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);

// Draw some random circles
  for (int i=0; i<150; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=32+random(416);
    y=45+random(178);
    r=random(30);
    myGLCD.drawCircle(x, y, r);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);

// Draw some random rectangles
  for (int i=0; i<150; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(476);
    y=16+random(239);
    x2=2+random(476);
    y2=16+random(239);
    myGLCD.drawRect(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);

// Draw some random rounded rectangles
  for (int i=0; i<150; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(476);
    y=16+random(239);
    x2=2+random(476);
    y2=16+random(239);
    myGLCD.drawRoundRect(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);

  for (int i=0; i<150; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    x=2+random(476);
    y=16+random(239);
    x2=2+random(476);
    y2=16+random(239);
    myGLCD.drawLine(x, y, x2, y2);
  }

  delay(2000);
  
  myGLCD.setColor(0,0,0);
  myGLCD.fillRect(1,15,478,257);

  for (int i=0; i<10000; i++)
  {
    myGLCD.setColor(random(255), random(255), random(255));
    myGLCD.drawPixel(2+random(476), 16+random(239));
  }

  delay(2000);

  myGLCD.fillScr(0, 0, 255);
  myGLCD.setColor(255, 0, 0);
  myGLCD.fillRoundRect(160, 70, 319, 169);
  
  myGLCD.setColor(255, 255, 255);
  myGLCD.setBackColor(255, 0, 0);
  myGLCD.print("That's it!", CENTER, 93);
  myGLCD.print("Restarting in a", CENTER, 119);
  myGLCD.print("few seconds...", CENTER, 132);
  
  myGLCD.setColor(0, 255, 0);
  myGLCD.setBackColor(0, 0, 255);
  myGLCD.print("Runtime: (msecs)", CENTER, 243);
  myGLCD.printNumI(millis(), CENTER, 258);
  
  delay (10000);
}

Attached is a picture I took, and a copy of the library I am using.

What I am trying to do now is fiddle with the display to make it more readable, like turning off the backlight; but I don't see a command yet in the library that would let me do that.

Enjoy and good luck!

utft-master.zip (701 KB)

20170310_082114jpg.zip (878 KB)

Your JPEGs in #8 show a 40-pin Adapter Shield that you use with 3.3V 40-pin modules.

Your JPEG in #12 show a Mega2560 Display Shield. i.e. with 18x2 header pins and probably power and Touch pins.

It "looks" like a regular 320x480 Mcufriend mega2560 Shield. Of course, a photo of the pcb would confirm this.

It certainly will NOT be ILI9327 because that controller is 240x400.

David.

I am not using the shield in #8 as it is non-functioning.

I have the LCD plugged straight into the Mega2560.

Attached are the pics of the LCD.

As for the chipset, I am not saying what it is, I am just saying what will make the sketch work.

As for the display size, that is why I modified the .cpp file with the stated numbers.

It works, and it fills the screen appropriately.

My next step is looking at the ili9327 datasheet to figure out how to add backlight control to the library.

There are about 8 backlight commands, but I haven't figured out yet which one does what, and how to tell it to do it. I just want to turn off the backlight for now.

mcufriend3point5inch-tft_ili9488_front2.jpg.zip (732 KB)

mcufriend3point5inch-tft_ili9488_rear.zip (878 KB)

You have a regular 320x480 3.5" Mcufriend mega2560 (ili9488) Shield.
This has a 16-bit parallel interface. (7 resistor packs)

It probably has ILI9488, ILI9486, HX8357-D, R61581, ILI9481, RM68140, ... controller.

It does NOT have ILI9327.

David.

When tinkering with the sketch and UTFT library,

I swapped out the controller identifier in the sketch with the ones listed in the .cpp file, and ili9327 was the only one that worked.

I have an ili9488 datasheet, as well as a library file, but the library file doesn't work, and I do not know how to write my own library yet for me to be able to read the datasheet and make it work.

So until then, I'm just going to stick with what works.

Right now, I am trying to figure out how to pass an argument value to the library, so I can adjust the backlight.

Attached are the library files, and I have commented the addition I have made, backlightControl1(), along with a page from the data sheet for the Backlight Control 1 command.

Any ideas?

Thanks!

backlight_control1.pdf (721 KB)

UTFT.h (6.32 KB)

UTFT.cpp (58.7 KB)