Go Down

Topic: 2.4 inch LCD TFT Display Shield only shows white! (Read 49124 times) previous topic - next topic

Ludvig

Yesterday when I arrived home, I remember I had another Arduino Uno in a sort of lego rover I once manage to make. So I decided to give it a try...

To my surprise, it did work! Now it is detecting it as 0x9325 and all the tests run flawlessly. Even if I set it as 0x9328 it works (haven't tried all the features yet).

I'm a bit embarrased to find out that the problem was in my board (that I have used for several tests and projects, it's now a matter of finding out what is wrong with it) but I hope my experience and info helps someone else.

Let me know if I can provide more info, for the records and thanks specially to david for your help!

david_prentice

The Arduino MUST have a good 3.3V pin for these Shields.

Most sketches and shields never use the 3.3V pin.

David.

pauldusa

Try adding these lib.

#include <TFTConsole.h>
#include <Adafruit_TFTLCD.h>
#include <Adafruit_GFX.h>
 
if you are just getting white

my 2.4 address is Ox9325

there is a 0x9341 one too

mind was white until I added in the TFTConsole, at github

pauldusa

// Works Fine as a test

// Uno & 2.4 TFT Lcd Adafruit shield

// Change Address in setup for your shield

#include <TFTConsole.h>
#include <Adafruit_TFTLCD.h>
#include <Adafruit_GFX.h>   
//#include <TouchScreen.h>


#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4

#define TS_MINX 204
#define TS_MINY 195
#define TS_MAXX 948
#define TS_MAXY 910

#define YP A2  // must be an analog pin, use "An" notation!
#define XM A3  // must be an analog pin, use "An" notation!
#define YM 8   // can be a digital pin
#define XP 9   // can be a digital pin

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
//TouchScreen ts = TouchScreen(XP, YP, XM, YM, 200);

void setup() {
  Serial.begin(9600);
  Serial.print("Starting...");

   tft.reset();


// --------- Change Below for your Board's Address ----------
 
   tft.begin(0x9325);
 
 //tft.begin(0x9341);
 
 // ect.

//--------------------------------------------------------------

 
  tft.setRotation(1);

 tft.fillScreen(BLACK);

  //Print "PPM CO" Text
  tft.setCursor(80,30);
  tft.setTextColor(RED);
  tft.setTextSize(5);
  tft.print("Hello");

  delay(1000);
}

void loop() {
 
 
  tft.setCursor(40,100);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("No more white screen");

    tft.setCursor(40,150);
  tft.setTextColor(BLUE);
  tft.setTextSize(5);
  tft.print("Have Fun");

}

moeburn

#124
Jun 24, 2017, 11:21 pm Last Edit: Jun 25, 2017, 12:02 am by moeburn
Hello folks, I have a similar 2.4" TFT, but mine has the R1/R2 jumpers like some others have mentioned:

http://i.imgur.com/spZqPN8.jpg

I have managed to get all the graphics demos working, I just can't get any response from the touchscreen demos.  I bought it from these guys:

https://www.creatroninc.com/product/24-tft-lcd-touch-shield/

But it's just ever so slightly different from the picture they have on their website.  Have I been duped, does this particular one not do touchscreen?

EDIT:  Nevermind I've got it all figured out.  If you have the 2.4" TFT shield like mine with the R1 and R2 resistor jumpers on the bottom, use this guy's library:

https://github.com/JoaoLopesF/SPFD5408

The graphics should work.  To get the touchscreen working, in TFTpaint change the 4 #define YP etc lines to these pins:

Code: [Select]
#define YP A3  // must be an analog pin, use "An" notation!
#define XM A2  // must be an analog pin, use "An" notation!
#define YM 9   // can be a digital pin
#define XP 8   // can be a digital pin


That'll get the touchscreen working, to get the inversion correct open up SPFD5408_TouchScreen.cpp and change "//return TSPoint(x, 1023 - y, z);" to this:

Code: [Select]
return TSPoint(1023 - x, 1023 - y, z);

Hope this helps any future googlers

mirycia

hi goltermc good function


i change the parameters

 if(identifier == 0x9325) {
    Serial.println(F("Found ILI9325 LCD driver"));
  } else if(identifier == 0x9328) {
    Serial.println(F("Found ILI9328 LCD driver"));
  } else if(identifier == 0x7575) {
    Serial.println(F("Found HX8347G LCD driver"));
  } else if(identifier == 0x9341) {
    Serial.println(F("Found ILI9341 LCD driver"));
  } else if(identifier == 0x8357) {
    Serial.println(F("Found HX8357D LCD driver"));
  } else {
    Serial.print(F("Unknown LCD driver chip: "));
    Serial.println(identifier, HEX);
    Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:"));
    Serial.println(F("  #define USE_ADAFRUIT_SHIELD_PINOUT"));
    Serial.println(F("should appear in the library header (Adafruit_TFT.h)."));
    Serial.println(F("If using the breakout board, it should NOT be #defined!"));
    Serial.println(F("Also if using the breakout, double-check that all wiring"));
    Serial.println(F("matches the tutorial."));
    //return;
    identifier = 0x9341;
  }


vey nice thanks


isaquearddev

Your display is fake, not original.
Download this library for fake display : https://github.com/JoaoLopesF/SPFD5408

goldiee36

Try adding these lib.

#include <TFTConsole.h>
#include <Adafruit_TFTLCD.h>
#include <Adafruit_GFX.h>
 
if you are just getting white

my 2.4 address is Ox9325

there is a 0x9341 one too

mind was white until I added in the TFTConsole, at github
Thank you so much! I was trying to fix this for hours now!! Even if the output is mirrored on my TFT shield, at least there is no more white screen!! :)))

milintron

#128
Today at 12:51 pm Last Edit: Today at 01:07 pm by milintron
Hello, my TFT LCD is



Diaoutput from the Serial Terminal
to a message in Displays topic on Arduino Forum
or to Issues on GitHub
ples/
Copy-Paste the output from the Serial Terminal
to a message in Displays topic on Arduino Forum
or to Issues on GitHub
Diagnose whether this controller is supported
There are FAQs in extras/mcufriend_how_to.txt

tft.readID() finds: ID = 0x4532


This ID is not supported
look up ID in extras/mcufriend_how_to.txt
you may need to edit MCUFRIEND_kbv.cpp
to enable support for this ID
e.g. #define SUPPORT_8347D

New controllers appear on Ebay often
If your ID is not supported
run LCD_ID_readreg.ino from examples/
Copy-Paste the output from the Serial Terminal
to a message in Displays topic on Arduino Forum
or to Issues on GitHub
-----------------------------------------------------------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) 45 32   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 Powsr 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 01 00 01 00 01   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) 01 01   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(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

david_prentice

Did you try enabling the #define SUPPORT_4532  statement in the library .CPP file?

milintron

0x4535 working on half screen, with 0x4532 show white screen, not working.

milintron


david_prentice

Please explain.    You have a LGDP4532 controller.

Enabling the #define SUPPORT_4532 statement should work.
I do not own a LGDP4532 controller.   I rely on user feedback.

David.

Go Up