Hi all,
I have a TFT LCD shield that only works with MCUFRIEND_kbv library. When I upload the example 'diagnose_TFT_support.ino', the screen displays ID 0x7575 as shown below. Based on that, I can see that my TFT LCD shield is HX8347 or HX8367-A.
I decided to investigate possible compatibility with other libraries so I installed Adafruit_TFTLCD library. From a section of graphicstest.ino, I noticed that identifier code 0x7575 was supported so I presumed that my TFT LCD shield could work with the library.
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// If using the shield, all control and data lines are fixed, and
// a simpler declaration can optionally be used:
// Adafruit_TFTLCD tft;
void setup(void) {
Serial.begin(9600);
Serial.println(F("TFT LCD test"));
#ifdef USE_ADAFRUIT_SHIELD_PINOUT
Serial.println(F("Using Adafruit 2.8\" TFT Arduino Shield Pinout"));
#else
Serial.println(F("Using Adafruit 2.8\" TFT Breakout Board Pinout"));
#endif
Serial.print("TFT size is "); Serial.print(tft.width()); Serial.print("x"); Serial.println(tft.height());
tft.reset();
uint16_t identifier = tft.readID();
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;
}
After I modified the header file to support LCD shields, I uploaded the program to my Arduino Mega 2560 without changing the connections. The output that appeared on the LCD shield is shown below.
At first the serial monitor showed identifier value: 0x0000. After pressing the reset button, I received the message below on the serial monitor. What possible factor could be preventing my LCD shield from working with Adafruit TFTLCD library?
TFT LCD test
Using Adafruit 2.8" TFT Arduino Shield Pinout
TFT size is 240x320
Unknown LCD driver chip: 5100
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).
If using the breakout board, it should NOT be #defined!
Also if using the breakout, double-check that all wiring
matches the tutorial.