Arduino MCUFRIEND tft display not working

Hi I hope that you are fine.
I got an issue that seems to be very common on the net, is that the screen of the 2.8 TFT display stays white no matter what libraries are installed. I followed all instructions and did everything, yet my problem isn't solved. Only one code that I found on internet seemed to do something considerable.
I am using an ARDUINO MEGA 2560
The ID that I get is : 0x6051 and it seems to be not supported by any library. The issue is that I'm working on a project with that and submission is after 3 days…

The output using adafruit library is :
TFT LCD test
Using Adafruit 2.8" TFT Breakout Board Pinout
TFT size is 240x320
Unknown LCD driver chip: 0
If using the Adafruit 2.8" TFT Arduino shield, the line:
#define USE_ADAFRUIT_SHIELD_PINOUT
should appear in the library header (Adafruit_TFT.h).
Also if using the breakout, double-check that all wiring matches the tutorial.

with mcufriend library : graphictest example :
Serial took 0ms to start
ID = 0x6051

code that worked : /*********************************************************************
*
* LCD_ID_Reader
*
* This sketch is meant only to attempt to read the driver ID code
* from inexpensive touchscreen LCDs found on eBay without needing to
* load any additional libraries.  The hope is to identify the most 
* common varieties and choose the best library for the screen you have.
*
* This has been successfully tested so far on 992X and 778X variety
* screens.
*
* Usage: 
*
* Compile the sketch and run it on your board with the screen
* attached.  In the serial monitor, you should see a message containing
* the driver code.  The tricky thing is that if it does not work, the
* results may be undetermined.  However, if we can compile a list,
* the difference between working and not may become more evident.
*
* Please visit http://misc.ws/lcd_information for more information.
*
* Version 1.2 - January 29th, 2015
* 
*********************************************************************/



/*********************************************************************
*
* PIN ASSIGNMENTS
*
* You can alter the pin assignments to reflect any configuration you
* wish.  I've provided the default shield configuration, which works
* on both the Arduino UNO and Mega 2560.
* 
*********************************************************************/
//-- Arduino UNO or Mega 2560 Plugged as shield
#define LCD_RST A4
#define LCD_CS A3
#define LCD_RS A2
#define LCD_WR A1
#define LCD_RD A0

#define LCD_D0 8
#define LCD_D1 9
#define LCD_D2 2
#define LCD_D3 3
#define LCD_D4 4
#define LCD_D5 5
#define LCD_D6 6
#define LCD_D7 7



/*********************************************************************
*
* Attempt to initialize and reset LCD, then read its Driver Code
* at register index 0.
* 
*********************************************************************/
void setup() {
  
  char hexString[7];
  uint16_t id;
  
  Serial.begin(9600);
  Serial.println("Initializing LCD...");
  lcdInit();
  lcdReset();
  
  delay(500);
  
  Serial.print("Reading ID...");
  id = lcdReadID();
  sprintf(hexString, "0x%0.4X", id); 
  Serial.println( hexString );
  
  if( id == 0x7783 ) {
    lcdRegister7783();
    lcdFillScreen(0xF800);
    Serial.println("If your screen filled red, then you may be able to use the library at https://github.com/Smoke-And-Wires/TFT-Shield-Example-Code");
  } else if( id == 0x0154 ) {
    lcdRegister0154();
    lcdFillScreen(0xF800);
    Serial.println("If your screen filled red, please report it at http://misc.ws/lcd_information");
    Serial.println("There is currently no known working library.");
  } else {
    lcdRegisterOther();
    lcdFillScreen(0xF800);
    Serial.println("If your screen filled red, you may be able to use the library at http://misc.ws");
  } 
  
  //print_all_regs();
}


void print_all_regs() {
  char str[60];
  uint16_t i, val;

  for(i=0; i < 256; i++ )
  {
    delay(40);
    val = lcdReadRegister(i);
    sprintf(str, "Register 0x%0.2X : 0x%0.4X", i, val);
    Serial.println( str );
  }  
}

void loop() {
  
}

/*********************************************************************
*
*   LCD Functions - Inefficient but should be good enough 
*                   to read the ID.
*
*********************************************************************/
void lcdRegister0154() {
  lcdWriteRegister(0x000C, 0x130); 
  lcdWriteRegister(0x0080, 0x8d);
  lcdWriteRegister(0x0092, 0x10);
  lcdWriteRegister(0x0011, 0x1b);
  lcdWriteRegister(0x0012, 0x3101);
  lcdWriteRegister(0x0013, 0x105f);
  lcdWriteRegister(0x0014, 0x667f);
  lcdWriteRegister(0x0010, 0x800);
  delay(20); 
  lcdWriteRegister(0x0011, 0x11b);
  delay(20); 
  lcdWriteRegister(0x0011, 0x31b);
  delay(20); 
  lcdWriteRegister(0x0011, 0x71b);
  delay(20); 
  lcdWriteRegister(0x0011, 0xf1b);
  delay(20); 
  lcdWriteRegister(0x0011, 0xf3b);
  delay(30); 
  lcdWriteRegister(0x0001, 0x2128);
  lcdWriteRegister(0x0002, 0x100);
  lcdWriteRegister(0x0003, 0x1030);
  lcdWriteRegister(0x0007, 0); 
  lcdWriteRegister(0x0008, 0x808);
  lcdWriteRegister(0x000B, 0x1100);
  lcdWriteRegister(0x000F, 0xf01);
  lcdWriteRegister(0x0015, 0);
  lcdWriteRegister(0x0030, 0);
  lcdWriteRegister(0x0034, 319); 
  lcdWriteRegister(0x0035, 0); 
  lcdWriteRegister(0x0036, 239); 
  lcdWriteRegister(0x0037, 0); 
  lcdWriteRegister(0x0038, 319); 
  lcdWriteRegister(0x0039, 0); 
  lcdWriteRegister(0x0050, 0);
  lcdWriteRegister(0x0051, 0xf00);
  lcdWriteRegister(0x0052, 0xa03);
  lcdWriteRegister(0x0053, 0x300);
  lcdWriteRegister(0x0054, 0xc05);
  lcdWriteRegister(0x0055, 0xf00);
  lcdWriteRegister(0x0056, 0xf00);
  lcdWriteRegister(0x0057, 3);
  lcdWriteRegister(0x0058, 0x1f07);
  lcdWriteRegister(0x0059, 0x71f);
  delay(20);
  lcdWriteRegister(0x0007, 0x12);
  delay(20);
  lcdWriteRegister(0x0007, 0x13);
}

void lcdRegisterOther() {
  Serial.println("Loading LCD registers...");
  lcdWriteRegister(0x00e5,0x8000);
  lcdWriteRegister(0x0000,0x0001);
  lcdWriteRegister(0x0001,0x0100);
  lcdWriteRegister(0x0002,0x0700);
  lcdWriteRegister(0x0003,0x1030);
  lcdWriteRegister(0x0004,0x0000);
  lcdWriteRegister(0x0008,0x0202);
  lcdWriteRegister(0x0009,0x0000);
  lcdWriteRegister(0x000a,0x0000);
  lcdWriteRegister(0x000c,0x0000);
  lcdWriteRegister(0x000d,0x0000);
  lcdWriteRegister(0x000f,0x0000);
  lcdWriteRegister(0x0010,0x0000);
  lcdWriteRegister(0x0011,0x0000);
  lcdWriteRegister(0x0012,0x0000);
  lcdWriteRegister(0x0013,0x0000);
  lcdWriteRegister(0x0010,0x17b0);
  lcdWriteRegister(0x0011,0x0037);
  lcdWriteRegister(0x0012,0x0138);
  lcdWriteRegister(0x0013,0x1700);
  lcdWriteRegister(0x0029,0x000d);
  lcdWriteRegister(0x0020,0x0000);
  lcdWriteRegister(0x0021,0x0000);
  lcdWriteRegister(0x0030,0x0001);
  lcdWriteRegister(0x0031,0x0606);
  lcdWriteRegister(0x0032,0x0304);
  lcdWriteRegister(0x0033,0x0202);
  lcdWriteRegister(0x0034,0x0202);
  lcdWriteRegister(0x0035,0x0103);
  lcdWriteRegister(0x0036,0x011d);
  lcdWriteRegister(0x0037,0x0404);
  lcdWriteRegister(0x0038,0x0404);
  lcdWriteRegister(0x0039,0x0404);
  lcdWriteRegister(0x003c,0x0700);
  lcdWriteRegister(0x003d,0x0a1f);
  lcdWriteRegister(0x0050,0x0000);
  lcdWriteRegister(0x0051,0x00ef);
  lcdWriteRegister(0x0052,0x0000);
  lcdWriteRegister(0x0053,0x013f);
  lcdWriteRegister(0x0060,0x2700);
  lcdWriteRegister(0x0061,0x0001);
  lcdWriteRegister(0x006a,0x0000);
  lcdWriteRegister(0x0090,0x0010);
  lcdWriteRegister(0x0092,0x0000);
  lcdWriteRegister(0x0093,0x0003);
  lcdWriteRegister(0x0095,0x0101);
  lcdWriteRegister(0x0097,0x0000);
  lcdWriteRegister(0x0098,0x0000);
  lcdWriteRegister(0x0007,0x0021);
  lcdWriteRegister(0x0007,0x0031);
  lcdWriteRegister(0x0007,0x0173);
}

void lcdRegister7783() {
    
  lcdWriteRegister(0x0001,0x0100);    
  lcdWriteRegister(0x0002,0x0700);    
  lcdWriteRegister(0x0003,0x1030);    
  lcdWriteRegister(0x0008,0x0302);    
  lcdWriteRegister(0x0009,0x0000);   
  lcdWriteRegister(0x000A,0x0008);    
  lcdWriteRegister(0x0010,0x0790);    
  lcdWriteRegister(0x0011,0x0005);    
  lcdWriteRegister(0x0012,0x0000);   
  lcdWriteRegister(0x0013,0x0000); 
  lcdWriteRegister(0x0010,0x12B0);    
  lcdWriteRegister(0x0011,0x0007);  
  lcdWriteRegister(0x0012,0x008C);   
  lcdWriteRegister(0x0013,0x1700);    
  lcdWriteRegister(0x0029,0x0022);    
  lcdWriteRegister(0x0030,0x0000);    
  lcdWriteRegister(0x0031,0x0505);    
  lcdWriteRegister(0x0032,0x0205);    
  lcdWriteRegister(0x0035,0x0206);    
  lcdWriteRegister(0x0036,0x0408);    
  lcdWriteRegister(0x0037,0x0000);   
  lcdWriteRegister(0x0038,0x0504);
  lcdWriteRegister(0x0039,0x0206);    
  lcdWriteRegister(0x003C,0x0206);   
  lcdWriteRegister(0x003D,0x0408);    
  lcdWriteRegister(0x0050,0x0000);
  lcdWriteRegister(0x0051,0x00EF);   
  lcdWriteRegister(0x0052,0x0000);   
  lcdWriteRegister(0x0053,0x013F);   
  lcdWriteRegister(0x0060,0xA700);   
  lcdWriteRegister(0x0061,0x0001);   
  lcdWriteRegister(0x0090,0x0033); 
  lcdWriteRegister(0x0007,0x0133);
  lcdWriteRegister(0x0001,0x0100);
  lcdWriteRegister(0x0002,0x0700);    
  lcdWriteRegister(0x0003,0x1030);    
  lcdWriteRegister(0x0008,0x0302);    
  lcdWriteRegister(0x0009,0x0000);   
  lcdWriteRegister(0x000A,0x0008);    
  lcdWriteRegister(0x0010,0x0790);    
  lcdWriteRegister(0x0011,0x0005);    
  lcdWriteRegister(0x0012,0x0000);  
  lcdWriteRegister(0x0013,0x0000);    
  lcdWriteRegister(0x0010,0x12B0);    
  lcdWriteRegister(0x0011,0x0007);    
  lcdWriteRegister(0x0012,0x008C);    
  lcdWriteRegister(0x0013,0x1700);    
  lcdWriteRegister(0x0029,0x0022);    
  lcdWriteRegister(0x0030,0x0000);    
  lcdWriteRegister(0x0031,0x0505);    
  lcdWriteRegister(0x0032,0x0205);    
  lcdWriteRegister(0x0035,0x0206);    
  lcdWriteRegister(0x0036,0x0408);   
  lcdWriteRegister(0x0037,0x0000);    
  lcdWriteRegister(0x0038,0x0504);
  lcdWriteRegister(0x0039,0x0206);    
  lcdWriteRegister(0x003C,0x0206);    
  lcdWriteRegister(0x003D,0x0408);   
  lcdWriteRegister(0x0050,0x0000);
  lcdWriteRegister(0x0051,0x00EF);   
  lcdWriteRegister(0x0052,0x0000);   
  lcdWriteRegister(0x0053,0x013F);   
  lcdWriteRegister(0x0060,0xA700);   
  lcdWriteRegister(0x0061,0x0001);   
  lcdWriteRegister(0x0090,0x0033);
  lcdWriteRegister(0x0007,0x0133);
}

void lcdInit() {
  pinMode(LCD_CS, OUTPUT);
  digitalWrite(LCD_CS, HIGH);
  pinMode(LCD_RS, OUTPUT);
  digitalWrite(LCD_RS, HIGH);
  pinMode(LCD_WR, OUTPUT);
  digitalWrite(LCD_WR, HIGH);
  pinMode(LCD_RD, OUTPUT);
  digitalWrite(LCD_RD, HIGH);
  pinMode(LCD_RST, OUTPUT);
  digitalWrite(LCD_RST, HIGH);  
}

void lcdReset() {
  digitalWrite(LCD_RST, LOW);
  delay(2); 
  digitalWrite(LCD_RST, HIGH);
  lcdWriteData(0);
  lcdWriteData(0);
  lcdWriteData(0);
  lcdWriteData(0);
}

void lcdWrite8(uint16_t data) {
  digitalWrite(LCD_D0, data & 1);
  digitalWrite(LCD_D1, (data & 2) >> 1);
  digitalWrite(LCD_D2, (data & 4) >> 2);
  digitalWrite(LCD_D3, (data & 8) >> 3);
  digitalWrite(LCD_D4, (data & 16) >> 4); 
  digitalWrite(LCD_D5, (data & 32) >> 5);
  digitalWrite(LCD_D6, (data & 64) >> 6);
  digitalWrite(LCD_D7, (data & 128) >> 7);  
}

uint16_t lcdRead8() {
  uint16_t result = digitalRead(LCD_D7);
  result <<= 1;
  result |= digitalRead(LCD_D6);
  result <<= 1;
  result |= digitalRead(LCD_D5);
  result <<= 1; 
  result |= digitalRead(LCD_D4); 
  result <<= 1;
  result |= digitalRead(LCD_D3);
  result <<= 1;
  result |= digitalRead(LCD_D2); 
  result <<= 1;
  result |= digitalRead(LCD_D1);
  result <<= 1;
  result |= digitalRead(LCD_D0); 
  
  return result;
}

void lcdSetWriteDir() {
  pinMode(LCD_D0, OUTPUT);
  pinMode(LCD_D1, OUTPUT);
  pinMode(LCD_D2, OUTPUT);
  pinMode(LCD_D3, OUTPUT);  
  pinMode(LCD_D4, OUTPUT);  
  pinMode(LCD_D5, OUTPUT);
  pinMode(LCD_D6, OUTPUT);
  pinMode(LCD_D7, OUTPUT);  
}


void lcdSetReadDir() {
  pinMode(LCD_D0, INPUT);
  pinMode(LCD_D1, INPUT);
  pinMode(LCD_D2, INPUT);
  pinMode(LCD_D3, INPUT);  
  pinMode(LCD_D4, INPUT);  
  pinMode(LCD_D5, INPUT);
  pinMode(LCD_D6, INPUT);
  pinMode(LCD_D7, INPUT);    
}

void lcdWriteData(uint16_t data) {
  
  lcdSetWriteDir();
  digitalWrite(LCD_CS, LOW);
  digitalWrite(LCD_RS, HIGH);
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_WR, HIGH);
  
  lcdWrite8(data >> 8);
  
  digitalWrite(LCD_WR, LOW);
  delayMicroseconds(10);
  digitalWrite(LCD_WR, HIGH);
  
  lcdWrite8(data);
  
  digitalWrite(LCD_WR, LOW);
  delayMicroseconds(10);
  digitalWrite(LCD_WR, HIGH);
  
  digitalWrite(LCD_CS, HIGH);  
}


void lcdWriteCommand(uint16_t command) {
  lcdSetWriteDir(); 
  digitalWrite(LCD_CS, LOW);
  digitalWrite(LCD_RS, LOW);
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_WR, HIGH);  
  lcdWrite8(command >> 8);
  digitalWrite(LCD_WR, LOW);
  delayMicroseconds(10);
  digitalWrite(LCD_WR, HIGH);
  lcdWrite8(command);
  digitalWrite(LCD_WR, LOW);
  delayMicroseconds(10);
  digitalWrite(LCD_WR, HIGH);
  digitalWrite(LCD_CS, HIGH);    
}


int lcdReadData() {
  uint16_t result;
  lcdSetReadDir();
  digitalWrite(LCD_CS, LOW);
  digitalWrite(LCD_RS, HIGH);
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_WR, HIGH);
  
  digitalWrite(LCD_RD, LOW);  
  delayMicroseconds(10);
  result = lcdRead8() << 8;
  digitalWrite(LCD_RD, HIGH);
  
  delayMicroseconds(10);
  
  digitalWrite(LCD_RD, LOW);
  delayMicroseconds(10);
  result |= lcdRead8();
  
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_CS, HIGH);
  
  return result;
}


void lcdWriteRegister(uint16_t addr, uint16_t data) {
  lcdWriteCommand(addr);
  lcdWriteData(data);
}

uint16_t lcdReadRegister(uint16_t reg) {
  lcdWriteCommand(reg);
  return lcdReadData();
}

uint16_t lcdReadID() {
  return lcdReadRegister(0x00);
}


void lcdFillScreen(uint16_t color) {
  
  Serial.println("Filling the screen...");
  
  /*lcdWriteRegister(0x0050, 0);
  lcdWriteRegister(0x0051, 219);  
  lcdWriteRegister(0x0052, 0);
  lcdWriteRegister(0x0053, 319);  
  */
  lcdWriteRegister(0x0020, 0);
  lcdWriteRegister(0x0021, 0);
  lcdWriteCommand(0x0022);
  
  digitalWrite(LCD_CS, LOW);
  digitalWrite(LCD_RS, HIGH);
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_WR, HIGH);
 
  lcdSetWriteDir();
  
  uint32_t i = 320;
  i *=240;

  while( i-- ) {
    lcdWrite8(color >> 8);
    digitalWrite(LCD_WR, LOW);
    delayMicroseconds(10);
    digitalWrite(LCD_WR, HIGH); 
    lcdWrite8(color);
    digitalWrite(LCD_WR, LOW);
    delayMicroseconds(10);
    digitalWrite(LCD_WR, HIGH); 
  }
  
  digitalWrite(LCD_CS, HIGH); 
  Serial.println("Done filling...");
  
}

output :
Initializing LCD...
Reading ID...0x6051
Loading LCD registers...
Filling the screen...
Done filling...
If your screen filled red, you may be able to use the library at http://misc.ws

Please run LCD_ID_readreg.ino from the MCUFRIEND_kbv library examples.

Copy-Paste from the Serial Terminal to your message,

David.

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

Thanks for the readreg report. It is very unusual. It seems to return 0x6051 everywhere except reg(0x04) and reg(0x09)

Please can you edit setup() line 32 from
// for (uint16_t i = 0; i < 256; i++) readReg(i, 7, "f.k");
to
for (uint16_t i = 0; i < 256; i++) readReg(i, 7, "f.k");

You will get a massive output. Just look for any registers that do not say 0x6051. And report back.

David.

Got it Sir. Thank you so much, I'll do it now.

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) 60 51 60 51 60 51 60	f.k
reg(0x0001) 00 00 00 00 00 00 00	f.k
reg(0x0002) 60 51 60 51 60 51 60	f.k
reg(0x0003) 00 30 00 30 00 30 00	f.k
reg(0x0004) 60 51 60 51 60 51 60	f.k
reg(0x0005) 00 51 00 51 00 51 00	f.k
reg(0x0006) 60 51 60 51 60 51 60	f.k
reg(0x0007) 00 00 00 00 00 00 00	f.k
reg(0x0008) 60 51 60 51 60 51 60	f.k
reg(0x0009) 00 00 00 00 00 00 00	f.k
reg(0x000A) 60 51 60 51 60 51 60	f.k
reg(0x000B) 00 51 00 51 00 51 00	f.k
reg(0x000C) 60 51 60 51 60 51 60	f.k
reg(0x000D) 00 00 00 00 00 00 00	f.k
reg(0x000E) 60 51 60 51 60 51 60	f.k
reg(0x000F) 00 00 00 00 00 00 00	f.k
reg(0x0010) 60 51 60 51 60 51 60	f.k
reg(0x0011) 00 00 00 00 00 00 00	f.k
reg(0x0012) 60 51 60 51 60 51 60	f.k
reg(0x0013) 00 00 00 00 00 00 00	f.k
reg(0x0014) 60 51 60 51 60 51 60	f.k
reg(0x0015) 00 51 00 51 00 51 00	f.k
reg(0x0016) 60 51 60 51 60 51 60	f.k
reg(0x0017) 00 51 00 51 00 51 00	f.k
reg(0x0018) 60 51 60 51 60 51 60	f.k
reg(0x0019) 00 00 00 00 00 00 00	f.k
reg(0x001A) 60 51 60 51 60 51 60	f.k
reg(0x001B) 00 00 00 00 00 00 00	f.k
reg(0x001C) 60 51 60 51 60 51 60	f.k
reg(0x001D) 00 51 00 51 00 51 00	f.k
reg(0x001E) 60 51 60 51 60 51 60	f.k
reg(0x001F) 00 51 00 51 00 51 00	f.k
reg(0x0020) 60 51 60 51 60 51 60	f.k
reg(0x0021) 00 00 00 00 00 00 00	f.k
reg(0x0022) 60 51 60 51 60 51 60	f.k
reg(0x0023) 00 51 00 51 00 51 00	f.k
reg(0x0024) 60 51 60 51 60 51 60	f.k
reg(0x0025) 00 51 00 51 00 51 00	f.k
reg(0x0026) 60 51 60 51 60 51 60	f.k
reg(0x0027) 00 BF 00 BF 00 BF 00	f.k
reg(0x0028) 60 51 60 51 60 51 60	f.k
reg(0x0029) 00 00 00 00 00 00 00	f.k
reg(0x002A) 60 51 60 51 60 51 60	f.k
reg(0x002B) 00 00 00 00 00 00 00	f.k
reg(0x002C) 60 51 60 51 60 51 60	f.k
reg(0x002D) 00 51 00 51 00 51 00	f.k
reg(0x002E) 60 51 60 51 60 51 60	f.k
reg(0x002F) 00 51 00 51 00 51 00	f.k
reg(0x0030) 60 51 60 51 60 51 60	f.k
reg(0x0031) 00 00 00 00 00 00 00	f.k
reg(0x0032) 60 51 60 51 60 51 60	f.k
reg(0x0033) 00 00 00 00 00 00 00	f.k
reg(0x0034) 60 51 60 51 60 51 60	f.k
reg(0x0035) 00 00 00 00 00 00 00	f.k
reg(0x0036) 60 51 60 51 60 51 60	f.k
reg(0x0037) 00 00 00 00 00 00 00	f.k
reg(0x0038) 60 51 60 51 60 51 60	f.k
reg(0x0039) 00 00 00 00 00 00 00	f.k
reg(0x003A) 60 51 60 51 60 51 60	f.k
reg(0x003B) 00 00 00 00 00 00 00	f.k
reg(0x003C) 60 51 60 51 60 51 60	f.k
reg(0x003D) 00 00 00 00 00 00 00	f.k
reg(0x003E) 60 51 60 51 60 51 60	f.k
reg(0x003F) 00 51 00 51 00 51 00	f.k
reg(0x0040) 60 51 60 51 60 51 60	f.k
reg(0x0041) 00 51 00 51 00 51 00	f.k
reg(0x0042) 60 51 60 51 60 51 60	f.k
reg(0x0043) 00 51 00 51 00 51 00	f.k
reg(0x0044) 60 51 60 51 60 51 60	f.k
reg(0x0045) 00 51 00 51 00 51 00	f.k
reg(0x0046) 60 51 60 51 60 51 60	f.k
reg(0x0047) 00 51 00 51 00 51 00	f.k
reg(0x0048) 60 51 60 51 60 51 60	f.k
reg(0x0049) 00 51 00 51 00 51 00	f.k
reg(0x004A) 60 51 60 51 60 51 60	f.k
reg(0x004B) 00 51 00 51 00 51 00	f.k
reg(0x004C) 60 51 60 51 60 51 60	f.k
reg(0x004D) 00 51 00 51 00 51 00	f.k
reg(0x004E) 60 51 60 51 60 51 60	f.k
reg(0x004F) 00 51 00 51 00 51 00	f.k
reg(0x0050) 60 51 60 51 60 51 60	f.k
reg(0x0051) 00 00 00 00 00 00 00	f.k
reg(0x0052) 60 51 60 51 60 51 60	f.k
reg(0x0053) 00 00 00 00 00 00 00	f.k
reg(0x0054) 60 51 60 51 60 51 60	f.k
reg(0x0055) 00 51 00 51 00 51 00	f.k
reg(0x0056) 60 51 60 51 60 51 60	f.k
reg(0x0057) 00 51 00 51 00 51 00	f.k
reg(0x0058) 60 51 60 51 60 51 60	f.k
reg(0x0059) 00 51 00 51 00 51 00	f.k
reg(0x005A) 60 51 60 51 60 51 60	f.k
reg(0x005B) 00 51 00 51 00 51 00	f.k
reg(0x005C) 60 51 60 51 60 51 60	f.k
reg(0x005D) 00 51 00 51 00 51 00	f.k
reg(0x005E) 60 51 60 51 60 51 60	f.k
reg(0x005F) 00 51 00 51 00 51 00	f.k
reg(0x0060) 60 51 60 51 60 51 60	f.k
reg(0x0061) 00 00 00 00 00 00 00	f.k
reg(0x0062) 60 51 60 51 60 51 60	f.k
reg(0x0063) 00 51 00 51 00 51 00	f.k
reg(0x0064) 60 51 60 51 60 51 60	f.k
reg(0x0065) 00 51 00 51 00 51 00	f.k
reg(0x0066) 60 51 60 51 60 51 60	f.k
reg(0x0067) 00 51 00 51 00 51 00	f.k
reg(0x0068) 60 51 60 51 60 51 60	f.k
reg(0x0069) 00 51 00 51 00 51 00	f.k
reg(0x006A) 60 51 60 51 60 51 60	f.k
reg(0x006B) 00 51 00 51 00 51 00	f.k
reg(0x006C) 60 51 60 51 60 51 60	f.k
reg(0x006D) 00 51 00 51 00 51 00	f.k
reg(0x006E) 60 51 60 51 60 51 60	f.k
reg(0x006F) 00 51 00 51 00 51 00	f.k
reg(0x0070) 60 51 60 51 60 51 60	f.k
reg(0x0071) 00 51 00 51 00 51 00	f.k
reg(0x0072) 60 51 60 51 60 51 60	f.k
reg(0x0073) 00 51 00 51 00 51 00	f.k
reg(0x0074) 60 51 60 51 60 51 60	f.k
reg(0x0075) 00 51 00 51 00 51 00	f.k
reg(0x0076) 60 51 60 51 60 51 60	f.k
reg(0x0077) 00 51 00 51 00 51 00	f.k
reg(0x0078) 60 51 60 51 60 51 60	f.k
reg(0x0079) 00 51 00 51 00 51 00	f.k
reg(0x007A) 60 51 60 51 60 51 60	f.k
reg(0x007B) 00 51 00 51 00 51 00	f.k
reg(0x007C) 60 51 60 51 60 51 60	f.k
reg(0x007D) 00 51 00 51 00 51 00	f.k
reg(0x007E) 60 51 60 51 60 51 60	f.k
reg(0x007F) 00 51 00 51 00 51 00	f.k
reg(0x0080) 60 51 60 51 60 51 60	f.k
reg(0x0081) 00 00 00 00 00 00 00	f.k
reg(0x0082) 60 51 60 51 60 51 60	f.k
reg(0x0083) 00 00 00 00 00 00 00	f.k
reg(0x0084) 60 51 60 51 60 51 60	f.k
reg(0x0085) 00 00 00 00 00 00 00	f.k
reg(0x0086) 60 51 60 51 60 51 60	f.k
reg(0x0087) 00 51 00 51 00 51 00	f.k
reg(0x0088) 60 51 60 51 60 51 60	f.k
reg(0x0089) 00 51 00 51 00 51 00	f.k
reg(0x008A) 60 51 60 51 60 51 60	f.k
reg(0x008B) 00 51 00 51 00 51 00	f.k
reg(0x008C) 60 51 60 51 60 51 60	f.k
reg(0x008D) 00 51 00 51 00 51 00	f.k
reg(0x008E) 60 51 60 51 60 51 60	f.k
reg(0x008F) 00 51 00 51 00 51 00	f.k
reg(0x0090) 60 51 60 51 60 51 60	f.k
reg(0x0091) 00 00 00 00 00 00 00	f.k
reg(0x0092) 60 51 60 51 60 51 60	f.k
reg(0x0093) 00 00 00 00 00 00 00	f.k
reg(0x0094) 60 51 60 51 60 51 60	f.k
reg(0x0095) 00 00 00 00 00 00 00	f.k
reg(0x0096) 60 51 60 51 60 51 60	f.k
reg(0x0097) 00 00 00 00 00 00 00	f.k
reg(0x0098) 60 51 60 51 60 51 60	f.k
reg(0x0099) 00 51 00 51 00 51 00	f.k
reg(0x009A) 60 51 60 51 60 51 60	f.k
reg(0x009B) 00 51 00 51 00 51 00	f.k
reg(0x009C) 60 51 60 51 60 51 60	f.k
reg(0x009D) 00 51 00 51 00 51 00	f.k
reg(0x009E) 60 51 60 51 60 51 60	f.k
reg(0x009F) 00 51 00 51 00 51 00	f.k
reg(0x00A0) 60 51 60 51 60 51 60	f.k
reg(0x00A1) 00 00 00 00 00 00 00	f.k
reg(0x00A2) 60 51 60 51 60 51 60	f.k
reg(0x00A3) 00 51 00 51 00 51 00	f.k
reg(0x00A4) 60 51 60 51 60 51 60	f.k
reg(0x00A5) 00 51 00 51 00 51 00	f.k
reg(0x00A6) 60 51 60 51 60 51 60	f.k
reg(0x00A7) 00 51 00 51 00 51 00	f.k
reg(0x00A8) 60 51 60 51 60 51 60	f.k
reg(0x00A9) 00 51 00 51 00 51 00	f.k
reg(0x00AA) 60 51 60 51 60 51 60	f.k
reg(0x00AB) 00 51 00 51 00 51 00	f.k
reg(0x00AC) 60 51 60 51 60 51 60	f.k
reg(0x00AD) 00 51 00 51 00 51 00	f.k
reg(0x00AE) 60 51 60 51 60 51 60	f.k
reg(0x00AF) 00 00 00 00 00 00 00	f.k
reg(0x00B0) 60 51 60 51 60 51 60	f.k
reg(0x00B1) 00 51 00 51 00 51 00	f.k
reg(0x00B2) 60 51 60 51 60 51 60	f.k
reg(0x00B3) 00 51 00 51 00 51 00	f.k
reg(0x00B4) 60 51 60 51 60 51 60	f.k
reg(0x00B5) 00 51 00 51 00 51 00	f.k
reg(0x00B6) 60 51 60 51 60 51 60	f.k
reg(0x00B7) 00 51 00 51 00 51 00	f.k
reg(0x00B8) 60 51 60 51 60 51 60	f.k
reg(0x00B9) 00 51 00 51 00 51 00	f.k
reg(0x00BA) 60 51 60 51 60 51 60	f.k
reg(0x00BB) 00 51 00 51 00 51 00	f.k
reg(0x00BC) 60 51 60 51 60 51 60	f.k
reg(0x00BD) 00 51 00 51 00 51 00	f.k
reg(0x00BE) 60 51 60 51 60 51 60	f.k
reg(0x00BF) 00 51 00 51 00 51 00	f.k
reg(0x00C0) 60 51 60 51 60 51 60	f.k
reg(0x00C1) 00 51 00 51 00 51 00	f.k
reg(0x00C2) 60 51 60 51 60 51 60	f.k
reg(0x00C3) 00 51 00 51 00 51 00	f.k
reg(0x00C4) 60 51 60 51 60 51 60	f.k
reg(0x00C5) 00 51 00 51 00 51 00	f.k
reg(0x00C6) 60 51 60 51 60 51 60	f.k
reg(0x00C7) 00 51 00 51 00 51 00	f.k
reg(0x00C8) 60 51 60 51 60 51 60	f.k
reg(0x00C9) 00 51 00 51 00 51 00	f.k
reg(0x00CA) 60 51 60 51 60 51 60	f.k
reg(0x00CB) 00 51 00 51 00 51 00	f.k
reg(0x00CC) 60 51 60 51 60 51 60	f.k
reg(0x00CD) 00 51 00 51 00 51 00	f.k
reg(0x00CE) 60 51 60 51 60 51 60	f.k
reg(0x00CF) 00 51 00 51 00 51 00	f.k
reg(0x00D0) 60 51 60 51 60 51 60	f.k
reg(0x00D1) 00 51 00 51 00 51 00	f.k
reg(0x00D2) 60 51 60 51 60 51 60	f.k
reg(0x00D3) 00 51 00 51 00 51 00	f.k
reg(0x00D4) 60 51 60 51 60 51 60	f.k
reg(0x00D5) 00 51 00 51 00 51 00	f.k
reg(0x00D6) 60 51 60 51 60 51 60	f.k
reg(0x00D7) 00 51 00 51 00 51 00	f.k
reg(0x00D8) 60 51 60 51 60 51 60	f.k
reg(0x00D9) 00 51 00 51 00 51 00	f.k
reg(0x00DA) 60 51 60 51 60 51 60	f.k
reg(0x00DB) 00 51 00 51 00 51 00	f.k
reg(0x00DC) 60 51 60 51 60 51 60	f.k
reg(0x00DD) 00 51 00 51 00 51 00	f.k
reg(0x00DE) 60 51 60 51 60 51 60	f.k
reg(0x00DF) 00 51 00 51 00 51 00	f.k
reg(0x00E0) 60 51 60 51 60 51 60	f.k
reg(0x00E1) 00 51 00 51 00 51 00	f.k
reg(0x00E2) 60 51 60 51 60 51 60	f.k
reg(0x00E3) 00 51 00 51 00 51 00	f.k
reg(0x00E4) 60 51 60 51 60 51 60	f.k
reg(0x00E5) 00 51 00 51 00 51 00	f.k
reg(0x00E6) 60 51 60 51 60 51 60	f.k
reg(0x00E7) 00 51 00 51 00 51 00	f.k
reg(0x00E8) 60 51 60 51 60 51 60	f.k
reg(0x00E9) 00 51 00 51 00 51 00	f.k
reg(0x00EA) 60 51 60 51 60 51 60	f.k
reg(0x00EB) 00 51 00 51 00 51 00	f.k
reg(0x00EC) 60 51 60 51 60 51 60	f.k
reg(0x00ED) 00 51 00 51 00 51 00	f.k
reg(0x00EE) 60 51 60 51 60 51 60	f.k
reg(0x00EF) 00 51 00 51 00 51 00	f.k
reg(0x00F0) 60 51 60 51 60 51 60	f.k
reg(0x00F1) 00 51 00 51 00 51 00	f.k
reg(0x00F2) 60 51 60 51 60 51 60	f.k
reg(0x00F3) 00 51 00 51 00 51 00	f.k
reg(0x00F4) 60 51 60 51 60 51 60	f.k
reg(0x00F5) 00 51 00 51 00 51 00	f.k
reg(0x00F6) 60 51 60 51 60 51 60	f.k
reg(0x00F7) 00 51 00 51 00 51 00	f.k
reg(0x00F8) 60 51 60 51 60 51 60	f.k
reg(0x00F9) 00 51 00 51 00 51 00	f.k
reg(0x00FA) 60 51 60 51 60 51 60	f.k
reg(0x00FB) 00 51 00 51 00 51 00	f.k
reg(0x00FC) 60 51 60 51 60 51 60	f.k
reg(0x00FD) 00 51 00 51 00 51 00	f.k
reg(0x00FE) 60 51 60 51 60 51 60	f.k
reg(0x00FF) F8 00 F8 00 F8 00 F8	f.k
reg(0x0000) 60 51	ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 60 51 60 51	Manufacturer ID
reg(0x0009) 60 51 60 51 60	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 51	RDID2 HX8347-G
reg(0x0063) 00 51	RDID3 HX8347-G
reg(0x0064) 00 51	RDID1 HX8347-A
reg(0x0065) 00 51	RDID2 HX8347-A
reg(0x0066) 00 51	RDID3 HX8347-A
reg(0x0067) 00 51	RDID Himax HX8347-A
reg(0x0070) 00 51	Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00	RD_DDB SSD1963
reg(0x00B0) 60 51	RGB Interface Signal Control
reg(0x00B4) 60 51	Inversion Control
reg(0x00B6) 60 51 60 51 60	Display Control
reg(0x00B7) 00 51	Entry Mode Set
reg(0x00BF) 00 51 00 51 00 51	ILI9481, HX8357-B
reg(0x00C0) 00 51 00 51 00 51 00 51 00	Panel Control
reg(0x00C8) 60 51 60 51 60 51 60 51 60 51 60 51 60	GAMMA
reg(0x00CC) 00 51	Panel Control
reg(0x00D0) 00 51 00	Power Control
reg(0x00D2) 60 51 60 51 60	NVM Read
reg(0x00D3) 00 51 00 51	ILI9341, ILI9488
reg(0x00D4) 00 51 00 51	Novatek ID
reg(0x00DA) 00 51	RDID1
reg(0x00DB) 00 51	RDID2
reg(0x00DC) 00 51	RDID3
reg(0x00E0) 00 51 00 51 00 51 00 51 00 51 00 51 00 51 00 51	GAMMA-P
reg(0x00E1) 00 51 00 51 00 51 00 51 00 51 00 51 00 51 00 51	GAMMA-N
reg(0x00EF) 00 51 00 51 00 51	ILI9327
reg(0x00F2) 00 51 00 51 00 51 00 51 00 51 00 51	Adjust Control 2
reg(0x00F6) 00 51 00 51	Interface Control

(0x0003)
(0x0027)
(0x00FF)
are different from 0x6051, otherwise only the '60' , '51' , '00' are being repeated

Please try this instead. i.e. it is reading an even number of register bytes.

for (uint16_t i = 0; i < 256; i++) readReg(i, 6, "f.k");

I am guessing that this MEGA2560 and this Shield have been used by many students. I suspect that BAD things have happened to the hardware.

It is worth trying with a different MEGA2560 or perhaps a Uno.

David.

Hi,
I have a similar 2.8, but not labelled mcufriend that also is just backlight.
The LCD_ID register dump is

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) 68 09 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 Power 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 00 00 00 00 00 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) 00 00 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(0x00D4) 00 00 00 00 Novatek ID
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

I found an ID of 6809 worked.

Tom..... :grinning: :+1: :coffee: :australia:
PS.Sorry not best phone camera


The MEGA is my own personal board, because as you have said, I doubted in the school's boards, I got the display new...

waw that 00 00 seemed to be the most hilarious thing to get on the serial monitor, I'm happy that you solved it !
Did you just try different IDs ?

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) 60 51 60 51 60 51	f.k
reg(0x0001) 60 51 60 51 60 51	f.k
reg(0x0002) 60 51 60 51 60 51	f.k
reg(0x0003) 60 51 60 51 60 51	f.k
reg(0x0004) 60 51 60 51 60 51	f.k
reg(0x0005) 60 51 60 51 60 51	f.k
reg(0x0006) 60 51 60 51 60 51	f.k
reg(0x0007) 60 51 60 51 60 51	f.k
reg(0x0008) 60 51 60 51 60 51	f.k
reg(0x0009) 60 51 60 51 60 51	f.k
reg(0x000A) 60 51 60 51 60 51	f.k
reg(0x000B) 60 51 60 51 60 51	f.k
reg(0x000C) 60 51 60 51 60 51	f.k
reg(0x000D) 60 51 60 51 60 51	f.k
reg(0x000E) 60 51 60 51 60 51	f.k
reg(0x000F) 60 51 60 51 60 51	f.k
reg(0x0010) 60 51 60 51 60 51	f.k
reg(0x0011) 60 51 60 51 60 51	f.k
reg(0x0012) 60 51 60 51 60 51	f.k
reg(0x0013) 60 51 60 51 60 51	f.k
reg(0x0014) 60 51 60 51 60 51	f.k
reg(0x0015) 60 51 60 51 60 51	f.k
reg(0x0016) 60 51 60 51 60 51	f.k
reg(0x0017) 60 51 60 51 60 51	f.k
reg(0x0018) 60 51 60 51 60 51	f.k
reg(0x0019) 60 51 60 51 60 51	f.k
reg(0x001A) 60 51 60 51 60 51	f.k
reg(0x001B) 60 51 60 51 60 51	f.k
reg(0x001C) 60 51 60 51 60 51	f.k
reg(0x001D) 60 51 60 51 60 51	f.k
reg(0x001E) 60 51 60 51 60 51	f.k
reg(0x001F) 60 51 60 51 60 51	f.k
reg(0x0020) 60 51 60 51 60 51	f.k
reg(0x0021) 60 51 60 51 60 51	f.k
reg(0x0022) 60 51 60 51 60 51	f.k
reg(0x0023) 60 51 60 51 60 51	f.k
reg(0x0024) 60 51 60 51 60 51	f.k
reg(0x0025) 60 51 60 51 60 51	f.k
reg(0x0026) 60 51 60 51 60 51	f.k
reg(0x0027) 60 51 60 51 60 51	f.k
reg(0x0028) 60 51 60 51 60 51	f.k
reg(0x0029) 60 51 60 51 60 51	f.k
reg(0x002A) 60 51 60 51 60 51	f.k
reg(0x002B) 60 51 60 51 60 51	f.k
reg(0x002C) 60 51 60 51 60 51	f.k
reg(0x002D) 60 51 60 51 60 51	f.k
reg(0x002E) 60 51 60 51 60 51	f.k
reg(0x002F) 60 51 60 51 60 51	f.k
reg(0x0030) 60 51 60 51 60 51	f.k
reg(0x0031) 60 51 60 51 60 51	f.k
reg(0x0032) 60 51 60 51 60 51	f.k
reg(0x0033) 60 51 60 51 60 51	f.k
reg(0x0034) 60 51 60 51 60 51	f.k
reg(0x0035) 60 51 60 51 60 51	f.k
reg(0x0036) 60 51 60 51 60 51	f.k
reg(0x0037) 60 51 60 51 60 51	f.k
reg(0x0038) 60 51 60 51 60 51	f.k
reg(0x0039) 60 51 60 51 60 51	f.k
reg(0x003A) 60 51 60 51 60 51	f.k
reg(0x003B) 60 51 60 51 60 51	f.k
reg(0x003C) 60 51 60 51 60 51	f.k
reg(0x003D) 60 51 60 51 60 51	f.k
reg(0x003E) 60 51 60 51 60 51	f.k
reg(0x003F) 60 51 60 51 60 51	f.k
reg(0x0040) 60 51 60 51 60 51	f.k
reg(0x0041) 60 51 60 51 60 51	f.k
reg(0x0042) 60 51 60 51 60 51	f.k
reg(0x0043) 60 51 60 51 60 51	f.k
reg(0x0044) 60 51 60 51 60 51	f.k
reg(0x0045) 60 51 60 51 60 51	f.k
reg(0x0046) 60 51 60 51 60 51	f.k
reg(0x0047) 60 51 60 51 60 51	f.k
reg(0x0048) 60 51 60 51 60 51	f.k
reg(0x0049) 60 51 60 51 60 51	f.k
reg(0x004A) 60 51 60 51 60 51	f.k
reg(0x004B) 60 51 60 51 60 51	f.k
reg(0x004C) 60 51 60 51 60 51	f.k
reg(0x004D) 60 51 60 51 60 51	f.k
reg(0x004E) 60 51 60 51 60 51	f.k
reg(0x004F) 60 51 60 51 60 51	f.k
reg(0x0050) 60 51 60 51 60 51	f.k
reg(0x0051) 60 51 60 51 60 51	f.k
reg(0x0052) 60 51 60 51 60 51	f.k
reg(0x0053) 60 51 60 51 60 51	f.k
reg(0x0054) 60 51 60 51 60 51	f.k
reg(0x0055) 60 51 60 51 60 51	f.k
reg(0x0056) 60 51 60 51 60 51	f.k
reg(0x0057) 60 51 60 51 60 51	f.k
reg(0x0058) 60 51 60 51 60 51	f.k
reg(0x0059) 60 51 60 51 60 51	f.k
reg(0x005A) 60 51 60 51 60 51	f.k
reg(0x005B) 60 51 60 51 60 51	f.k
reg(0x005C) 60 51 60 51 60 51	f.k
reg(0x005D) 60 51 60 51 60 51	f.k
reg(0x005E) 60 51 60 51 60 51	f.k
reg(0x005F) 60 51 60 51 60 51	f.k
reg(0x0060) 60 51 60 51 60 51	f.k
reg(0x0061) 60 51 60 51 60 51	f.k
reg(0x0062) 60 51 60 51 60 51	f.k
reg(0x0063) 60 51 60 51 60 51	f.k
reg(0x0064) 60 51 60 51 60 51	f.k
reg(0x0065) 60 51 60 51 60 51	f.k
reg(0x0066) 60 51 60 51 60 51	f.k
reg(0x0067) 60 51 60 51 60 51	f.k
reg(0x0068) 60 51 60 51 60 51	f.k
reg(0x0069) 60 51 60 51 60 51	f.k
reg(0x006A) 60 51 60 51 60 51	f.k
reg(0x006B) 60 51 60 51 60 51	f.k
reg(0x006C) 60 51 60 51 60 51	f.k
reg(0x006D) 60 51 60 51 60 51	f.k
reg(0x006E) 60 51 60 51 60 51	f.k
reg(0x006F) 60 51 60 51 60 51	f.k
reg(0x0070) 60 51 60 51 60 51	f.k
reg(0x0071) 60 51 60 51 60 51	f.k
reg(0x0072) 60 51 60 51 60 51	f.k
reg(0x0073) 60 51 60 51 60 51	f.k
reg(0x0074) 60 51 60 51 60 51	f.k
reg(0x0075) 60 51 60 51 60 51	f.k
reg(0x0076) 60 51 60 51 60 51	f.k
reg(0x0077) 60 51 60 51 60 51	f.k
reg(0x0078) 60 51 60 51 60 51	f.k
reg(0x0079) 60 51 60 51 60 51	f.k
reg(0x007A) 60 51 60 51 60 51	f.k
reg(0x007B) 60 51 60 51 60 51	f.k
reg(0x007C) 60 51 60 51 60 51	f.k
reg(0x007D) 60 51 60 51 60 51	f.k
reg(0x007E) 60 51 60 51 60 51	f.k
reg(0x007F) 60 51 60 51 60 51	f.k
reg(0x0080) 60 51 60 51 60 51	f.k
reg(0x0081) 60 51 60 51 60 51	f.k
reg(0x0082) 60 51 60 51 60 51	f.k
reg(0x0083) 60 51 60 51 60 51	f.k
reg(0x0084) 60 51 60 51 60 51	f.k
reg(0x0085) 60 51 60 51 60 51	f.k
reg(0x0086) 60 51 60 51 60 51	f.k
reg(0x0087) 60 51 60 51 60 51	f.k
reg(0x0088) 60 51 60 51 60 51	f.k
reg(0x0089) 60 51 60 51 60 51	f.k
reg(0x008A) 60 51 60 51 60 51	f.k
reg(0x008B) 60 51 60 51 60 51	f.k
reg(0x008C) 60 51 60 51 60 51	f.k
reg(0x008D) 60 51 60 51 60 51	f.k
reg(0x008E) 60 51 60 51 60 51	f.k
reg(0x008F) 60 51 60 51 60 51	f.k
reg(0x0090) 60 51 60 51 60 51	f.k
reg(0x0091) 60 51 60 51 60 51	f.k
reg(0x0092) 60 51 60 51 60 51	f.k
reg(0x0093) 60 51 60 51 60 51	f.k
reg(0x0094) 60 51 60 51 60 51	f.k
reg(0x0095) 60 51 60 51 60 51	f.k
reg(0x0096) 60 51 60 51 60 51	f.k
reg(0x0097) 60 51 60 51 60 51	f.k
reg(0x0098) 60 51 60 51 60 51	f.k
reg(0x0099) 60 51 60 51 60 51	f.k
reg(0x009A) 60 51 60 51 60 51	f.k
reg(0x009B) 60 51 60 51 60 51	f.k
reg(0x009C) 60 51 60 51 60 51	f.k
reg(0x009D) 60 51 60 51 60 51	f.k
reg(0x009E) 60 51 60 51 60 51	f.k
reg(0x009F) 60 51 60 51 60 51	f.k
reg(0x00A0) 60 51 60 51 60 51	f.k
reg(0x00A1) 60 51 60 51 60 51	f.k
reg(0x00A2) 60 51 60 51 60 51	f.k
reg(0x00A3) 60 51 60 51 60 51	f.k
reg(0x00A4) 60 51 60 51 60 51	f.k
reg(0x00A5) 60 51 60 51 60 51	f.k
reg(0x00A6) 60 51 60 51 60 51	f.k
reg(0x00A7) 60 51 60 51 60 51	f.k
reg(0x00A8) 60 51 60 51 60 51	f.k
reg(0x00A9) 60 51 60 51 60 51	f.k
reg(0x00AA) 60 51 60 51 60 51	f.k
reg(0x00AB) 60 51 60 51 60 51	f.k
reg(0x00AC) 60 51 60 51 60 51	f.k
reg(0x00AD) 60 51 60 51 60 51	f.k
reg(0x00AE) 60 51 60 51 60 51	f.k
reg(0x00AF) 60 51 60 51 60 51	f.k
reg(0x00B0) 60 51 60 51 60 51	f.k
reg(0x00B1) 60 51 60 51 60 51	f.k
reg(0x00B2) 60 51 60 51 60 51	f.k
reg(0x00B3) 60 51 60 51 60 51	f.k
reg(0x00B4) 60 51 60 51 60 51	f.k
reg(0x00B5) 60 51 60 51 60 51	f.k
reg(0x00B6) 60 51 60 51 60 51	f.k
reg(0x00B7) 60 51 60 51 60 51	f.k
reg(0x00B8) 60 51 60 51 60 51	f.k
reg(0x00B9) 60 51 60 51 60 51	f.k
reg(0x00BA) 60 51 60 51 60 51	f.k
reg(0x00BB) 60 51 60 51 60 51	f.k
reg(0x00BC) 60 51 60 51 60 51	f.k
reg(0x00BD) 60 51 60 51 60 51	f.k
reg(0x00BE) 60 51 60 51 60 51	f.k
reg(0x00BF) 60 51 60 51 60 51	f.k
reg(0x00C0) 60 51 60 51 60 51	f.k
reg(0x00C1) 60 51 60 51 60 51	f.k
reg(0x00C2) 60 51 60 51 60 51	f.k
reg(0x00C3) 60 51 60 51 60 51	f.k
reg(0x00C4) 60 51 60 51 60 51	f.k
reg(0x00C5) 60 51 60 51 60 51	f.k
reg(0x00C6) 60 51 60 51 60 51	f.k
reg(0x00C7) 60 51 60 51 60 51	f.k
reg(0x00C8) 60 51 60 51 60 51	f.k
reg(0x00C9) 60 51 60 51 60 51	f.k
reg(0x00CA) 60 51 60 51 60 51	f.k
reg(0x00CB) 60 51 60 51 60 51	f.k
reg(0x00CC) 60 51 60 51 60 51	f.k
reg(0x00CD) 60 51 60 51 60 51	f.k
reg(0x00CE) 60 51 60 51 60 51	f.k
reg(0x00CF) 60 51 60 51 60 51	f.k
reg(0x00D0) 60 51 60 51 60 51	f.k
reg(0x00D1) 60 51 60 51 60 51	f.k
reg(0x00D2) 60 51 60 51 60 51	f.k
reg(0x00D3) 60 51 60 51 60 51	f.k
reg(0x00D4) 60 51 60 51 60 51	f.k
reg(0x00D5) 60 51 60 51 60 51	f.k
reg(0x00D6) 60 51 60 51 60 51	f.k
reg(0x00D7) 60 51 60 51 60 51	f.k
reg(0x00D8) 60 51 60 51 60 51	f.k
reg(0x00D9) 60 51 60 51 60 51	f.k
reg(0x00DA) 60 51 60 51 60 51	f.k
reg(0x00DB) 60 51 60 51 60 51	f.k
reg(0x00DC) 60 51 60 51 60 51	f.k
reg(0x00DD) 60 51 60 51 60 51	f.k
reg(0x00DE) 60 51 60 51 60 51	f.k
reg(0x00DF) 60 51 60 51 60 51	f.k
reg(0x00E0) 60 51 60 51 60 51	f.k
reg(0x00E1) 60 51 60 51 60 51	f.k
reg(0x00E2) 60 51 60 51 60 51	f.k
reg(0x00E3) 60 51 60 51 60 51	f.k
reg(0x00E4) 60 51 60 51 60 51	f.k
reg(0x00E5) 60 51 60 51 60 51	f.k
reg(0x00E6) 60 51 60 51 60 51	f.k
reg(0x00E7) 60 51 60 51 60 51	f.k
reg(0x00E8) 60 51 60 51 60 51	f.k
reg(0x00E9) 60 51 60 51 60 51	f.k
reg(0x00EA) 60 51 60 51 60 51	f.k
reg(0x00EB) 60 51 60 51 60 51	f.k
reg(0x00EC) 60 51 60 51 60 51	f.k
reg(0x00ED) 60 51 60 51 60 51	f.k
reg(0x00EE) 60 51 60 51 60 51	f.k
reg(0x00EF) 60 51 60 51 60 51	f.k
reg(0x00F0) 60 51 60 51 60 51	f.k
reg(0x00F1) 60 51 60 51 60 51	f.k
reg(0x00F2) 60 51 60 51 60 51	f.k
reg(0x00F3) 60 51 60 51 60 51	f.k
reg(0x00F4) 60 51 60 51 60 51	f.k
reg(0x00F5) 60 51 60 51 60 51	f.k
reg(0x00F6) 60 51 60 51 60 51	f.k
reg(0x00F7) 60 51 60 51 60 51	f.k
reg(0x00F8) 60 51 60 51 60 51	f.k
reg(0x00F9) 60 51 60 51 60 51	f.k
reg(0x00FA) 60 51 60 51 60 51	f.k
reg(0x00FB) 60 51 60 51 60 51	f.k
reg(0x00FC) 60 51 60 51 60 51	f.k
reg(0x00FD) 60 51 60 51 60 51	f.k
reg(0x00FE) 60 51 60 51 60 51	f.k
reg(0x00FF) 60 51 60 51 60 51	f.k
reg(0x0000) 60 51	ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 60 51 60 51	Manufacturer ID
reg(0x0009) 60 51 60 51 60	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 51	RDID2 HX8347-G
reg(0x0063) 00 51	RDID3 HX8347-G
reg(0x0064) 00 51	RDID1 HX8347-A
reg(0x0065) 00 51	RDID2 HX8347-A
reg(0x0066) 00 51	RDID3 HX8347-A
reg(0x0067) 00 51	RDID Himax HX8347-A
reg(0x0070) 00 51	Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00	RD_DDB SSD1963
reg(0x00B0) 60 51	RGB Interface Signal Control
reg(0x00B4) 60 51	Inversion Control
reg(0x00B6) 60 51 60 51 60	Display Control
reg(0x00B7) 00 51	Entry Mode Set
reg(0x00BF) 00 51 00 51 00 51	ILI9481, HX8357-B
reg(0x00C0) 00 51 00 51 00 51 00 51 00	Panel Control
reg(0x00C8) 60 51 60 51 60 51 60 51 60 51 60 51 60	GAMMA
reg(0x00CC) 00 51	Panel Control
reg(0x00D0) 00 51 00	Power Control
reg(0x00D2) 60 51 60 51 60	NVM Read
reg(0x00D3) 00 51 00 51	ILI9341, ILI9488
reg(0x00D4) 00 51 00 51	Novatek ID
reg(0x00DA) 00 51	RDID1
reg(0x00DB) 00 51	RDID2
reg(0x00DC) 00 51	RDID3
reg(0x00E0) 00 51 00 51 00 51 00 51 00 51 00 51 00 51 00 51	GAMMA-P
reg(0x00E1) 00 51 00 51 00 51 00 51 00 51 00 51 00 51 00 51	GAMMA-N
reg(0x00EF) 00 51 00 51 00 51	ILI9327
reg(0x00F2) 00 51 00 51 00 51 00 51 00 51 00 51	Adjust Control 2
reg(0x00F6) 00 51 00 51	Interface Control

that's what I get Sir

@TomGeorge,

You have a Raydium RM68090 controller.

I can't read your "testcard" photo. But it should say ID 0x6809

It should also do all the library functions with the exception of "Band Scroll"

David.

Hi,
Yes, that is correct... 6809.
It only scroll vertically, not hroizontally.

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

/*********************************************************************
*
* LCD_ID_Reader
*
* This sketch is meant only to attempt to read the driver ID code
* from inexpensive touchscreen LCDs found on eBay without needing to
* load any additional libraries.  The hope is to identify the most 
* common varieties and choose the best library for the screen you have.
*
* This has been successfully tested so far on 992X and 778X variety
* screens.
*
* Usage: 
*
* Compile the sketch and run it on your board with the screen
* attached.  In the serial monitor, you should see a message containing
* the driver code.  The tricky thing is that if it does not work, the
* results may be undetermined.  However, if we can compile a list,
* the difference between working and not may become more evident.
*
* Please visit http://misc.ws/lcd_information for more information.
*
* Version 1.2 - January 29th, 2015
* 
*********************************************************************/



/*********************************************************************
*
* PIN ASSIGNMENTS
*
* You can alter the pin assignments to reflect any configuration you
* wish.  I've provided the default shield configuration, which works
* on both the Arduino UNO and Mega 2560.
* 
*********************************************************************/
//-- Arduino UNO or Mega 2560 Plugged as shield
#define LCD_RST A4
#define LCD_CS A3
#define LCD_RS A2
#define LCD_WR A1
#define LCD_RD A0

#define LCD_D0 8
#define LCD_D1 9
#define LCD_D2 2
#define LCD_D3 3
#define LCD_D4 4
#define LCD_D5 5
#define LCD_D6 6
#define LCD_D7 7



/*********************************************************************
*
* Attempt to initialize and reset LCD, then read its Driver Code
* at register index 0.
* 
*********************************************************************/
void setup() {
  
  char hexString[7];
  uint16_t id;
  
  Serial.begin(9600);
  Serial.println("Initializing LCD...");
  lcdInit();
  lcdReset();
  
  delay(500);
  
  Serial.print("Reading ID...");
  id = lcdReadID();
  sprintf(hexString, "0x%0.4X", id); 
  Serial.println( hexString );
  
  if( id == 0x7783 ) {
    lcdRegister7783();
    lcdFillScreen(0xF800);
    Serial.println("If your screen filled red, then you may be able to use the library at https://github.com/Smoke-And-Wires/TFT-Shield-Example-Code");
  } else if( id == 0x0154 ) {
    lcdRegister0154();
    lcdFillScreen(0xF800);
    Serial.println("If your screen filled red, please report it at http://misc.ws/lcd_information");
    Serial.println("There is currently no known working library.");
  } else {
    lcdRegisterOther();
    lcdFillScreen(0xF800);
    Serial.println("If your screen filled red, you may be able to use the library at http://misc.ws");
  } 
  
  //print_all_regs();
}


void print_all_regs() {
  char str[60];
  uint16_t i, val;

  for(i=0; i < 256; i++ )
  {
    delay(40);
    val = lcdReadRegister(i);
    sprintf(str, "Register 0x%0.2X : 0x%0.4X", i, val);
    Serial.println( str );
  }  
}

void loop() {
  
}

/*********************************************************************
*
*   LCD Functions - Inefficient but should be good enough 
*                   to read the ID.
*
*********************************************************************/
void lcdRegister0154() {
  lcdWriteRegister(0x000C, 0x130); 
  lcdWriteRegister(0x0080, 0x8d);
  lcdWriteRegister(0x0092, 0x10);
  lcdWriteRegister(0x0011, 0x1b);
  lcdWriteRegister(0x0012, 0x3101);
  lcdWriteRegister(0x0013, 0x105f);
  lcdWriteRegister(0x0014, 0x667f);
  lcdWriteRegister(0x0010, 0x800);
  delay(20); 
  lcdWriteRegister(0x0011, 0x11b);
  delay(20); 
  lcdWriteRegister(0x0011, 0x31b);
  delay(20); 
  lcdWriteRegister(0x0011, 0x71b);
  delay(20); 
  lcdWriteRegister(0x0011, 0xf1b);
  delay(20); 
  lcdWriteRegister(0x0011, 0xf3b);
  delay(30); 
  lcdWriteRegister(0x0001, 0x2128);
  lcdWriteRegister(0x0002, 0x100);
  lcdWriteRegister(0x0003, 0x1030);
  lcdWriteRegister(0x0007, 0); 
  lcdWriteRegister(0x0008, 0x808);
  lcdWriteRegister(0x000B, 0x1100);
  lcdWriteRegister(0x000F, 0xf01);
  lcdWriteRegister(0x0015, 0);
  lcdWriteRegister(0x0030, 0);
  lcdWriteRegister(0x0034, 319); 
  lcdWriteRegister(0x0035, 0); 
  lcdWriteRegister(0x0036, 239); 
  lcdWriteRegister(0x0037, 0); 
  lcdWriteRegister(0x0038, 319); 
  lcdWriteRegister(0x0039, 0); 
  lcdWriteRegister(0x0050, 0);
  lcdWriteRegister(0x0051, 0xf00);
  lcdWriteRegister(0x0052, 0xa03);
  lcdWriteRegister(0x0053, 0x300);
  lcdWriteRegister(0x0054, 0xc05);
  lcdWriteRegister(0x0055, 0xf00);
  lcdWriteRegister(0x0056, 0xf00);
  lcdWriteRegister(0x0057, 3);
  lcdWriteRegister(0x0058, 0x1f07);
  lcdWriteRegister(0x0059, 0x71f);
  delay(20);
  lcdWriteRegister(0x0007, 0x12);
  delay(20);
  lcdWriteRegister(0x0007, 0x13);
}

void lcdRegisterOther() {
  Serial.println("Loading LCD registers...");
  lcdWriteRegister(0x00e5,0x8000);
  lcdWriteRegister(0x0000,0x0001);
  lcdWriteRegister(0x0001,0x0100);
  lcdWriteRegister(0x0002,0x0700);
  lcdWriteRegister(0x0003,0x1030);
  lcdWriteRegister(0x0004,0x0000);
  lcdWriteRegister(0x0008,0x0202);
  lcdWriteRegister(0x0009,0x0000);
  lcdWriteRegister(0x000a,0x0000);
  lcdWriteRegister(0x000c,0x0000);
  lcdWriteRegister(0x000d,0x0000);
  lcdWriteRegister(0x000f,0x0000);
  lcdWriteRegister(0x0010,0x0000);
  lcdWriteRegister(0x0011,0x0000);
  lcdWriteRegister(0x0012,0x0000);
  lcdWriteRegister(0x0013,0x0000);
  lcdWriteRegister(0x0010,0x17b0);
  lcdWriteRegister(0x0011,0x0037);
  lcdWriteRegister(0x0012,0x0138);
  lcdWriteRegister(0x0013,0x1700);
  lcdWriteRegister(0x0029,0x000d);
  lcdWriteRegister(0x0020,0x0000);
  lcdWriteRegister(0x0021,0x0000);
  lcdWriteRegister(0x0030,0x0001);
  lcdWriteRegister(0x0031,0x0606);
  lcdWriteRegister(0x0032,0x0304);
  lcdWriteRegister(0x0033,0x0202);
  lcdWriteRegister(0x0034,0x0202);
  lcdWriteRegister(0x0035,0x0103);
  lcdWriteRegister(0x0036,0x011d);
  lcdWriteRegister(0x0037,0x0404);
  lcdWriteRegister(0x0038,0x0404);
  lcdWriteRegister(0x0039,0x0404);
  lcdWriteRegister(0x003c,0x0700);
  lcdWriteRegister(0x003d,0x0a1f);
  lcdWriteRegister(0x0050,0x0000);
  lcdWriteRegister(0x0051,0x00ef);
  lcdWriteRegister(0x0052,0x0000);
  lcdWriteRegister(0x0053,0x013f);
  lcdWriteRegister(0x0060,0x2700);
  lcdWriteRegister(0x0061,0x0001);
  lcdWriteRegister(0x006a,0x0000);
  lcdWriteRegister(0x0090,0x0010);
  lcdWriteRegister(0x0092,0x0000);
  lcdWriteRegister(0x0093,0x0003);
  lcdWriteRegister(0x0095,0x0101);
  lcdWriteRegister(0x0097,0x0000);
  lcdWriteRegister(0x0098,0x0000);
  lcdWriteRegister(0x0007,0x0021);
  lcdWriteRegister(0x0007,0x0031);
  lcdWriteRegister(0x0007,0x0173);
}

void lcdRegister7783() {
    
  lcdWriteRegister(0x0001,0x0100);    
  lcdWriteRegister(0x0002,0x0700);    
  lcdWriteRegister(0x0003,0x1030);    
  lcdWriteRegister(0x0008,0x0302);    
  lcdWriteRegister(0x0009,0x0000);   
  lcdWriteRegister(0x000A,0x0008);    
  lcdWriteRegister(0x0010,0x0790);    
  lcdWriteRegister(0x0011,0x0005);    
  lcdWriteRegister(0x0012,0x0000);   
  lcdWriteRegister(0x0013,0x0000); 
  lcdWriteRegister(0x0010,0x12B0);    
  lcdWriteRegister(0x0011,0x0007);  
  lcdWriteRegister(0x0012,0x008C);   
  lcdWriteRegister(0x0013,0x1700);    
  lcdWriteRegister(0x0029,0x0022);    
  lcdWriteRegister(0x0030,0x0000);    
  lcdWriteRegister(0x0031,0x0505);    
  lcdWriteRegister(0x0032,0x0205);    
  lcdWriteRegister(0x0035,0x0206);    
  lcdWriteRegister(0x0036,0x0408);    
  lcdWriteRegister(0x0037,0x0000);   
  lcdWriteRegister(0x0038,0x0504);
  lcdWriteRegister(0x0039,0x0206);    
  lcdWriteRegister(0x003C,0x0206);   
  lcdWriteRegister(0x003D,0x0408);    
  lcdWriteRegister(0x0050,0x0000);
  lcdWriteRegister(0x0051,0x00EF);   
  lcdWriteRegister(0x0052,0x0000);   
  lcdWriteRegister(0x0053,0x013F);   
  lcdWriteRegister(0x0060,0xA700);   
  lcdWriteRegister(0x0061,0x0001);   
  lcdWriteRegister(0x0090,0x0033); 
  lcdWriteRegister(0x0007,0x0133);
  lcdWriteRegister(0x0001,0x0100);
  lcdWriteRegister(0x0002,0x0700);    
  lcdWriteRegister(0x0003,0x1030);    
  lcdWriteRegister(0x0008,0x0302);    
  lcdWriteRegister(0x0009,0x0000);   
  lcdWriteRegister(0x000A,0x0008);    
  lcdWriteRegister(0x0010,0x0790);    
  lcdWriteRegister(0x0011,0x0005);    
  lcdWriteRegister(0x0012,0x0000);  
  lcdWriteRegister(0x0013,0x0000);    
  lcdWriteRegister(0x0010,0x12B0);    
  lcdWriteRegister(0x0011,0x0007);    
  lcdWriteRegister(0x0012,0x008C);    
  lcdWriteRegister(0x0013,0x1700);    
  lcdWriteRegister(0x0029,0x0022);    
  lcdWriteRegister(0x0030,0x0000);    
  lcdWriteRegister(0x0031,0x0505);    
  lcdWriteRegister(0x0032,0x0205);    
  lcdWriteRegister(0x0035,0x0206);    
  lcdWriteRegister(0x0036,0x0408);   
  lcdWriteRegister(0x0037,0x0000);    
  lcdWriteRegister(0x0038,0x0504);
  lcdWriteRegister(0x0039,0x0206);    
  lcdWriteRegister(0x003C,0x0206);    
  lcdWriteRegister(0x003D,0x0408);   
  lcdWriteRegister(0x0050,0x0000);
  lcdWriteRegister(0x0051,0x00EF);   
  lcdWriteRegister(0x0052,0x0000);   
  lcdWriteRegister(0x0053,0x013F);   
  lcdWriteRegister(0x0060,0xA700);   
  lcdWriteRegister(0x0061,0x0001);   
  lcdWriteRegister(0x0090,0x0033);
  lcdWriteRegister(0x0007,0x0133);
}

void lcdInit() {
  pinMode(LCD_CS, OUTPUT);
  digitalWrite(LCD_CS, HIGH);
  pinMode(LCD_RS, OUTPUT);
  digitalWrite(LCD_RS, HIGH);
  pinMode(LCD_WR, OUTPUT);
  digitalWrite(LCD_WR, HIGH);
  pinMode(LCD_RD, OUTPUT);
  digitalWrite(LCD_RD, HIGH);
  pinMode(LCD_RST, OUTPUT);
  digitalWrite(LCD_RST, HIGH);  
}

void lcdReset() {
  digitalWrite(LCD_RST, LOW);
  delay(2); 
  digitalWrite(LCD_RST, HIGH);
  lcdWriteData(0);
  lcdWriteData(0);
  lcdWriteData(0);
  lcdWriteData(0);
}

void lcdWrite8(uint16_t data) {
  digitalWrite(LCD_D0, data & 1);
  digitalWrite(LCD_D1, (data & 2) >> 1);
  digitalWrite(LCD_D2, (data & 4) >> 2);
  digitalWrite(LCD_D3, (data & 8) >> 3);
  digitalWrite(LCD_D4, (data & 16) >> 4); 
  digitalWrite(LCD_D5, (data & 32) >> 5);
  digitalWrite(LCD_D6, (data & 64) >> 6);
  digitalWrite(LCD_D7, (data & 128) >> 7);  
}

uint16_t lcdRead8() {
  uint16_t result = digitalRead(LCD_D7);
  result <<= 1;
  result |= digitalRead(LCD_D6);
  result <<= 1;
  result |= digitalRead(LCD_D5);
  result <<= 1; 
  result |= digitalRead(LCD_D4); 
  result <<= 1;
  result |= digitalRead(LCD_D3);
  result <<= 1;
  result |= digitalRead(LCD_D2); 
  result <<= 1;
  result |= digitalRead(LCD_D1);
  result <<= 1;
  result |= digitalRead(LCD_D0); 
  
  return result;
}

void lcdSetWriteDir() {
  pinMode(LCD_D0, OUTPUT);
  pinMode(LCD_D1, OUTPUT);
  pinMode(LCD_D2, OUTPUT);
  pinMode(LCD_D3, OUTPUT);  
  pinMode(LCD_D4, OUTPUT);  
  pinMode(LCD_D5, OUTPUT);
  pinMode(LCD_D6, OUTPUT);
  pinMode(LCD_D7, OUTPUT);  
}


void lcdSetReadDir() {
  pinMode(LCD_D0, INPUT);
  pinMode(LCD_D1, INPUT);
  pinMode(LCD_D2, INPUT);
  pinMode(LCD_D3, INPUT);  
  pinMode(LCD_D4, INPUT);  
  pinMode(LCD_D5, INPUT);
  pinMode(LCD_D6, INPUT);
  pinMode(LCD_D7, INPUT);    
}

void lcdWriteData(uint16_t data) {
  
  lcdSetWriteDir();
  digitalWrite(LCD_CS, LOW);
  digitalWrite(LCD_RS, HIGH);
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_WR, HIGH);
  
  lcdWrite8(data >> 8);
  
  digitalWrite(LCD_WR, LOW);
  delayMicroseconds(10);
  digitalWrite(LCD_WR, HIGH);
  
  lcdWrite8(data);
  
  digitalWrite(LCD_WR, LOW);
  delayMicroseconds(10);
  digitalWrite(LCD_WR, HIGH);
  
  digitalWrite(LCD_CS, HIGH);  
}


void lcdWriteCommand(uint16_t command) {
  lcdSetWriteDir(); 
  digitalWrite(LCD_CS, LOW);
  digitalWrite(LCD_RS, LOW);
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_WR, HIGH);  
  lcdWrite8(command >> 8);
  digitalWrite(LCD_WR, LOW);
  delayMicroseconds(10);
  digitalWrite(LCD_WR, HIGH);
  lcdWrite8(command);
  digitalWrite(LCD_WR, LOW);
  delayMicroseconds(10);
  digitalWrite(LCD_WR, HIGH);
  digitalWrite(LCD_CS, HIGH);    
}


int lcdReadData() {
  uint16_t result;
  lcdSetReadDir();
  digitalWrite(LCD_CS, LOW);
  digitalWrite(LCD_RS, HIGH);
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_WR, HIGH);
  
  digitalWrite(LCD_RD, LOW);  
  delayMicroseconds(10);
  result = lcdRead8() << 8;
  digitalWrite(LCD_RD, HIGH);
  
  delayMicroseconds(10);
  
  digitalWrite(LCD_RD, LOW);
  delayMicroseconds(10);
  result |= lcdRead8();
  
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_CS, HIGH);
  
  return result;
}


void lcdWriteRegister(uint16_t addr, uint16_t data) {
  lcdWriteCommand(addr);
  lcdWriteData(data);
}

uint16_t lcdReadRegister(uint16_t reg) {
  lcdWriteCommand(reg);
  return lcdReadData();
}

uint16_t lcdReadID() {
  return lcdReadRegister(0x00);
}


void lcdFillScreen(uint16_t color) {
  
  Serial.println("Filling the screen...");
  
  /*lcdWriteRegister(0x0050, 0);
  lcdWriteRegister(0x0051, 219);  
  lcdWriteRegister(0x0052, 0);
  lcdWriteRegister(0x0053, 319);  
  */
  lcdWriteRegister(0x0020, 0);
  lcdWriteRegister(0x0021, 0);
  lcdWriteCommand(0x0022);
  
  digitalWrite(LCD_CS, LOW);
  digitalWrite(LCD_RS, HIGH);
  digitalWrite(LCD_RD, HIGH);
  digitalWrite(LCD_WR, HIGH);
 
  lcdSetWriteDir();
  
  uint32_t i = 320;
  i *=240;

  while( i-- ) {
    lcdWrite8(color >> 8);
    digitalWrite(LCD_WR, LOW);
    delayMicroseconds(10);
    digitalWrite(LCD_WR, HIGH); 
    lcdWrite8(color);
    digitalWrite(LCD_WR, LOW);
    delayMicroseconds(10);
    digitalWrite(LCD_WR, HIGH); 
  }
  
  digitalWrite(LCD_CS, HIGH); 
  Serial.println("Done filling...");
  
}

This code is working though


So it looks as if it is probably 16-bit ILI9320 style but unreadable.

It is very unlikely that another ID will work but you can try editing setup() in graphictest_kbv.ino alter these lines :

//    ID = 0x9329;                             // force ID
    tft.begin(ID);

to different 240x320 IDs like 0x6809, 0x9320, 0x0154

    ID = 0x9325;                             // force ID
    tft.begin(ID);

Is the Display Shield new ?
Do you know where it came from ? e.g. Ebay, AliExpress, ...

It is worth trying a few different IDs. You will need to enable all the SUPPORT_xxxx macros in MCUFRIEND_kbv.cpp

I suspect that the Shield is faulty. Don't waste too much time.

David.

Yes it's new, and I bought it locally (from an electronics shop)
the SUPPORT_xxxx I uncommented all of them, tried all of them yesterday and the still it doesn't work

I will try forcing different IDs

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