[SOLVED] 2.4 inch tft LCD display shield unknown identifier!

Hello! I've been using a 2.4 inch TFT, but i can't seem to find the right identifier! I tried running the "LCD_ID_readreg.ino" from David's sketch and this is what i got so far:

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 01	ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 01 00 01	Manufacturer ID
reg(0x0009) 00 01 00 01 00	Status Register
reg(0x000A) 00 00	Get Power Mode
reg(0x000C) 00 00	Get Pixel Format
reg(0x0061) 00 00	RDID1 HX8347-G
reg(0x0062) 00 01	RDID2 HX8347-G
reg(0x0063) 00 01	RDID3 HX8347-G
reg(0x0064) 00 01	RDID1 HX8347-A
reg(0x0065) 00 01	RDID2 HX8347-A
reg(0x0066) 00 01	RDID3 HX8347-A
reg(0x0067) 00 01	RDID Himax HX8347-A
reg(0x0070) 00 01	Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00	RD_DDB SSD1963
reg(0x00B0) 00 01	RGB Interface Signal Control
reg(0x00B4) 00 01	Inversion Control
reg(0x00B6) 00 01 00 01 00	Display Control
reg(0x00B7) 00 01	Entry Mode Set
reg(0x00BF) 00 01 00 01 00 01	ILI9481, HX8357-B
reg(0x00C0) F8 00 F8 00 F8 00 F8 00 F8	Panel Control
reg(0x00C8) 00 01 00 01 00 01 00 01 00 01 00 01 00	GAMMA
reg(0x00CC) F8 00	Panel Control
reg(0x00D0) F8 00 F8	Power Control
reg(0x00D2) 00 01 00 01 00	NVM Read
reg(0x00D3) F8 00 F8 00	ILI9341, ILI9488
reg(0x00D4) F8 00 F8 00	Novatek ID
reg(0x00DA) F8 00	RDID1
reg(0x00DB) F8 00	RDID2
reg(0x00DC) F8 00	RDID3
reg(0x00E0) 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01	GAMMA-P
reg(0x00E1) 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01	GAMMA-N
reg(0x00EF) 00 01 00 01 00 01	ILI9327
reg(0x00F2) 00 01 00 01 00 01 00 01 00 01 00 01	Adjust Control 2
reg(0x00F6) 00 01 00 01	Interface Control

I'm new at Arduino and Displays, so i don't know what most of this mean. I tried several identifiers and could only get the display to have 50/50 between glitchy colours and a white screen at most when using 0x9325 / 0x9328.

Any help is appreciated

You have a mystery controller with ID = 0x0001

Either install the Beta from GitHub or edit your existing v2.9.8 Release

MCUFRIEND_kbv.cpp: (hint. search for common_9320 in your editor)

    case 0x0001:
        _lcd_capable = 0 | REV_SCREEN | INVERT_GS; //no RGB bug. thanks Ivo_Deshev
        goto common_9320;
    case 0x5408:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR; //Red 2.4" thanks jorgenv, Ardlab_Gent
//        _lcd_capable = 0 | REV_SCREEN | READ_BGR | INVERT_GS; //Blue 2.8" might be different
        goto common_9320;
    case 0x1505:                //R61505 thanks Ravi_kanchan2004. R61505V, R61505W different
    case 0x9320:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR;
      common_9320:

David.

david_prentice:
You have a mystery controller with ID = 0x0001

Either install the Beta from GitHub or edit your existing v2.9.8 Release

MCUFRIEND_kbv.cpp: (hint. search for common_9320 in your editor)

First of all, thanks for the fast reply! But i have a question. With "the Beta from Github", are you refering to the mcufriend library?

Yes. The "master" branch on GitHub is referred to as Beta. GitHub - prenticedavid/MCUFRIEND_kbv: MCUFRIEND_kbv Library for Uno 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend Shields

As a general rule, always use the Release e.g. v2.9.8

Editing your cpp file is probably the safest way to go. You only add two new lines

David.

I still can't get it to work. This is the code:

#include <MCUFRIEND_kbv.h>    
#include <Adafruit_TFTLCD.h>  //Librerías
#include <TouchScreen.h>


#define YP A3  
#define XM A2  
#define YM 9   
#define XP 8   

/*#define YP A1  
#define XM A2  
#define YM 7  
#define XP 6
*/

#define TS_MINX 140
#define TS_MINY 120  //Touch
#define TS_MAXX 910 
#define TS_MAXY 920

TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

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

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);

int RED = tft.color565(255, 50, 50);
int YELLOW = tft.color565(255, 255, 50);

#define minpressure 5
#define maxpressure 1000
void setup()
{
  tft.reset();
  tft.begin(0x0001);  //9325 ,9328,7575,8347,8357
  //fondo y botones:
  tft.fillScreen(RED);
  tft.fillRect(5, 5, 230, 310, YELLOW);
  tft.fillRect(10, 10, 220, 70, RED);
  //1era fila:
  tft.fillRect(10, 85, 50, 50, RED);
  tft.fillRect(65, 85, 50, 50, RED);
  tft.fillRect(120, 85, 50, 50, RED);
  tft.fillRect(175, 85, 50, 50, RED);
  //2da fila:
  tft.fillRect(10, 140, 50, 50, RED);
  tft.fillRect(65, 140, 50, 50, RED);
  tft.fillRect(120, 140, 50, 50, RED);
  tft.fillRect(175, 140, 50, 50, RED);
  //3ra fila:
  tft.fillRect(10, 195, 50, 50, RED);
  tft.fillRect(65, 195, 50, 50, RED);
  tft.fillRect(120, 195, 50, 50, RED);
  tft.fillRect(175, 195, 50, 50, RED);
  //4ta fila:
  tft.fillRect(10, 250, 50, 50, RED);
  tft.fillRect(65, 250, 50, 50, RED);
  tft.fillRect(120, 250, 50, 50, RED);
  tft.fillRect(175, 250, 50, 50, RED);
  //texto:
  tft.setTextSize(3);
  tft.setTextColor(YELLOW);
  tft.setCursor(30, 40);
  tft.print("Resultado");
  tft.setCursor(30, 100);
  tft.print("1  2  3  +");
  tft.setCursor(30, 155);
  tft.print("4  5  6  -");
  tft.setCursor(30, 210);
  tft.print("7  8  9  x");
  tft.setCursor(30, 265);
  tft.print(".  0  =  %");
}

void loop(){
  
  }

And this is the edit i did to the library (with a bit more text in the ends to show where i pasted it):

    (...) *p16 = 220;
        p16 = (int16_t *) & WIDTH;
        *p16 = 176;
        break;
#endif

// 
     
         case 0x0001:
        _lcd_capable = 0 | REV_SCREEN | INVERT_GS; //no RGB bug. thanks Ivo_Deshev
        goto common_9320;
    case 0x5408:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR; //Red 2.4" thanks jorgenv, Ardlab_Gent
//        _lcd_capable = 0 | REV_SCREEN | READ_BGR | INVERT_GS; //Blue 2.8" might be different
        goto common_9320;
    case 0x1505:                //R61505 thanks Ravi_kanchan2004. R61505V, R61505W different
    case 0x9320:
        _lcd_capable = 0 | REV_SCREEN | READ_BGR;
      common_9320:
        static const uint16_t ILI9320_regValues[] PROGMEM = { (...)

I'm now getting a white screen, have i done something wrong?

Your sketch is using Adafruit_TFTLCD
My library is called MCUFRIEND_kbv

Your .cpp edit looks correct.
Run all the MCUFRIEND_kbv library examples e.g. graphictest_kbv.ino

David.

It works! I tried the graphictest! I was sure i tried it before my last reply, but now that i tried again it worked!

(I mean, sometimes it doesn't but i just have to reset the LCD/arduino)

Thanks, to avoid more problems i will make my project with the setup of the graphictest.

Thank you very much!

All the examples should run.
The Band Scroll does not work with this ILI9320 style controller.

If something does not always run, please give details.

David.

Hi David!
So yeah, i've been testing a bit and i have a little problem only, the one i mentioned yesterday:

BlastoiseN:
(I mean, sometimes it doesn't but i just have to reset the LCD/arduino)

Basically every time i upload a sketch there's a really high chance of getting a white screen. Restarting the Arduino with its button, touching the LCD shield's button or just straight up unplugging and plugging will eventually fix it. It's a really minor problem but it can save me some time if fixed.

The problem is, that's all the information i got about the problem. It just happens, and i don't know why. Coding is the same as i showed before. It also happens with the graphictest and the rest of the examples. It just happens with everything i upload to it.

  1. I have no idea who manufactured the 0x0001 controller

  2. It appears to be similar to ILI9320 style controller

  3. I would assume that the hardware Reset pin will reset the controller in the same way as ILI9320

  4. I have 0% confidence in the current Mcufriend pcb design but it probably works for small 2.4 inch

  5. Some users do not know how to plug a shield into an Arduino

  6. You have never said which Arduino or whether you know how to plug in a shield

  7. If there is something wrong with your Arduino board other sketches would not always start.

  8. Many Due clones do not always start.

  9. If there is something wrong with the Shield, ask the vendor for a refund. Buy a new one.

David.