MCUfriend 2.8 TFT LCD Shield not working (with any libraries Ive found).

Using an Uno clone with an mcufriend 2.8" TFT LCD Shield. Tried a variety of different libraries (different ones people had modified as well as adafruits) with no success. Can anyone tell me what Im missing? Screen powers on with my uno, but just displays a white screen.

The back

Front

You have a regular Blue 2.8" Mcufriend Uno Shield.

Install/Update the MCUFRIEND_kbv library with the Library Manager.

Run the new "diagnose_TFT_support" sketch from the examples. Copy-paste the Serial Terminal to your next message.

David.

Sorry, I ran the program but not sure what the serial terminal is or what to copy-paste. It successfully uploaded but the display is still white (as i imagine it should be), and no errors came up, but all the lower window says is

Sketch uses 15334 bytes (47%) of program storage space. Maximum is 32256 bytes.
Global variables use 1549 bytes (75%) of dynamic memory, leaving 499 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

And (sorry for being excessive) but the code in the top window says

#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;

// Assign human-readable names to some common 16-bit color values:
#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF
#define GRAY    0x8410

void setup()
{
    Serial.begin(9600);
    if (!Serial) delay(5000);           //allow some time for Leonardo
    uint16_t ID = tft.readID(); //
    Serial.println("Diagnose whether this controller is supported");
    Serial.println("There are FAQs in extras/mcufriend_how_to.txt");
    Serial.println("");
    Serial.print("tft.readID() finds: ID = 0x");
    Serial.println(ID, HEX);
    Serial.println("");
    if (ID == 0x0404) {
        Serial.println("Probably a write-only Mega2560 Shield");
        Serial.println("#define USE_SPECIAL in mcufriend_shield.h");
        Serial.println("#define appropriate SPECIAL in mcufriend_special.h");
        Serial.println("e.g. USE_MEGA_16BIT_SHIELD");
        Serial.println("e.g. USE_MEGA_8BIT_SHIELD");
        Serial.println("Hint.  A Mega2560 Shield has a 18x2 male header");
        Serial.println("Often a row of resistor-packs near the 18x2");
        Serial.println("RP1-RP7 implies 16-bit but it might be 8-bit");
        Serial.println("RP1-RP4 or RP1-RP5 can only be 8-bit");
    }
    if (ID == 0xD3D3) {
        uint16_t guess_ID = 0x9481; // write-only shield
        Serial.println("Probably a write-only Mega2560 Shield");
        Serial.print("Try to force ID = 0x");
        Serial.println(guess_ID, HEX);
        tft.begin(guess_ID);
    }
    else tft.begin(ID);
    Serial.println("");
    if (tft.width() == 0) {
        Serial.println("This ID is not supported");
        Serial.println("look up ID in extras/mcufriend_how_to.txt");
        Serial.println("you may need to edit MCUFRIEND_kbv.cpp");
        Serial.println("to enable support for this ID");
        Serial.println("e.g. #define SUPPORT_8347D");
        Serial.println("");
        Serial.println("New controllers appear on Ebay often");
        Serial.println("If your ID is not supported");
        Serial.println("run LCD_ID_readreg.ino from examples/");
        Serial.println("Copy-Paste the output from the Serial Terminal");
        Serial.println("to a message in Displays topic on Arduino Forum");
        Serial.println("or to Issues on GitHub");
        while (1);    //just die
    } else {
        Serial.print("PORTRAIT is ");
        Serial.print(tft.width());
        Serial.print(" x ");
        Serial.println(tft.height());
        Serial.println("");
        Serial.println("Run the examples/graphictest_kbv sketch");
        Serial.println("All colours, text, directions, rotations, scrolls");
        Serial.println("should work.  If there is a problem,  make notes on paper");
        Serial.println("Post accurate description of problem to Forum");
        Serial.println("Or post a link to a video (or photos)");
        Serial.println("");
        Serial.println("I rely on good information from remote users");
    }
}

void loop()
{
    static uint8_t aspect = 0;
    const char *aspectname[] = {
        "PORTRAIT", "LANDSCAPE", "PORTRAIT_REV", "LANDSCAPE_REV"
    };
    const char *colorname[] = { "BLUE", "GREEN", "RED", "GRAY" };
    uint16_t colormask[] = { BLUE, GREEN, RED, GRAY };
    uint16_t ID = tft.readID(); //
    tft.setRotation(aspect);
    int width = tft.width();
    int height = tft.height();
    tft.fillScreen(colormask[aspect]);
    tft.drawRect(0, 0, width, height, WHITE);
    tft.drawRect(32, 32, width - 64, height - 64, WHITE);
    tft.setTextSize(2);
    tft.setTextColor(BLACK);
    tft.setCursor(40, 40);
    tft.print("ID=0x");
    tft.print(ID, HEX);
    if (ID == 0xD3D3) tft.print(" w/o");
    tft.setCursor(40, 70);
    tft.print(aspectname[aspect]);
    tft.setCursor(40, 100);
    tft.print(width);
    tft.print(" x ");
    tft.print(height);
    tft.setTextColor(WHITE);
    tft.setCursor(40, 130);
    tft.print(colorname[aspect]);
    if (++aspect > 3) aspect = 0;
    delay(5000);
}

In your Arduino IDE Window there is an icon at the top right of the icons below the Menu bar.
Click it. A Serial Terminal opens. Make sure that it is running at 9600 baud. (bottom right of the the Terminal Window)

Most Arduino programs will send information to the Serial Terminal. You can select the whole output with ctl-A. Copy it with ctl-C. Paste it to your Forum message with ctl-V

David.

Oh awesome, thanks! Hmm. Says

Diagnose whether this controller is supported
There are FAQs in extras/mcufriend_how_to.txt

tft.readID() finds: ID = 0x4747


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

and when i run the LCD_ID_readreg it says

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) 47 47   ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 3F 3F 3F 3F 3F  Status Register
reg(0x000A) 00 00   Get Power Mode
reg(0x000C) 01 01   Get Pixel Format
reg(0x0061) 00 00   RDID1 HX8347-G
reg(0x0062) 80 80   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) 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 GAMMA-P
reg(0x00E1) 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 GAMMA-N
reg(0x00EF) 49 49 49 49 49 49   ILI9327
reg(0x00F2) 10 10 10 10 10 10 10 10 10 10 10 10 Adjust Control 2
reg(0x00F6) 00 00 00 00 Interface Control

So you have a Himax HX8347-D controller.

Follow the advice in the screen message. i.e. read the how_to file

As it happens, your controller requires the exact SUPPORT_xxxx macro that is given as an example.

You just need to remove the two slash characters to turn a comment into a real statement.

David.

Oh great, thanks!

Hmm, i found the support id in the help file, then went on to try running the graphics test with no luck. Tried running the touchscreen calibration as well (because it was the next thing mentioned in the help file) and the serial monitor came back with this

TouchScreen.h GFX Calibration
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

Testing : (A1, D7) = 31
BROKEN TOUCHSCREEN
ID = 0x707

And diagnos touch pins:

Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

Testing : (A1, D7) = 32

I thought that you had a HX8347-D

So the ID should be reported as 0x4747

Since you have a broken Touch Panel, there is no point in trying to calibrate it. Can you see a crack in the glass?

Or perhaps one of the electrodes is not connecting to the resistive panel.

David.

Sorry, just a dumb mistake, one side of the pins just wasnt in all the way. But got the graphics test working now no problem. Thanks a lot!

I have bought “MCUFRIEND” 2.8 tft touch lcd and controller printed on it shows “ILI9338”. Example given in this library are not working except for the basic one and it don’t even work with touch examples. After searching on google found out that “MCUFRIEND_kbv” library for debug. When i run “diagnose_tft_support” it shows following output. Also added “Read reg” after first output. Please Help !!!

Diagnose whether this controller is supported
There are FAQs in extras/mcufriend_how_to.txt

tft.readID() finds: ID = 0xC4C4

MCUFRIEND_kbv version: 2.9.8

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

Note that OPEN-SMART boards have diff pinout
Edit the pin defines in LCD_ID_readreg to match
Edit mcufiend_shield.h for USE_SPECIAL
Edit mcufiend_special.h for USE_OPENSMART_SHIELD_PINOUT


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) C0 C0 ID: ILI9320, ILI9325, ILI9335, …
reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x000A) 08 08 Get Power Mode
reg(0x000C) 06 06 Get Pixel Format
reg(0x0061) E1 E5 RDID1 HX8347-G
reg(0x0062) E2 E6 RDID2 HX8347-G
reg(0x0063) E3 E7 RDID3 HX8347-G
reg(0x0064) E4 E4 RDID1 HX8347-A
reg(0x0065) E5 E5 RDID2 HX8347-A
reg(0x0066) E6 E6 RDID3 HX8347-A
reg(0x0067) E7 E7 RDID Himax HX8347-A
reg(0x0070) F0 F0 Panel Himax HX8347-A
reg(0x00A1) E1 E5 E5 E5 E1 RD_DDB SSD1963
reg(0x00B0) F0 F4 RGB Interface Signal Control
reg(0x00B4) F4 F4 Inversion Control
reg(0x00B6) F6 F6 F6 F2 F6 Display Control
reg(0x00B7) F7 F7 Entry Mode Set
reg(0x00BF) FF FB FF FF FB FF ILI9481, HX8357-B
reg(0x00C0) C0 C4 C4 C0 C0 C0 C0 C0 C0 Panel Control
reg(0x00C8) C8 CC CC C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 GAMMA
reg(0x00CC) CC C8 Panel Control
reg(0x00D0) D0 D0 D0 Power Control
reg(0x00D2) D2 D2 D6 D2 D6 NVM Read
reg(0x00D3) D3 D3 D7 D3 ILI9341, ILI9488
reg(0x00D4) D4 D4 D0 D4 Novatek ID
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 RDID3
reg(0x00E0) E0 E0 E4 E0 E0 E0 E0 E0 E0 E0 E4 E0 E0 E0 E0 E0 GAMMA-P
reg(0x00E1) E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 GAMMA-N
reg(0x00EF) EF EB EB EB EB EB ILI9327
reg(0x00F2) F2 F2 F2 F6 F6 F2 F6 F6 F2 F2 F2 F2 Adjust Control 2
reg(0x00F6) F6 F2 F2 F2 Interface Control

reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x000A) 08 08 Get Power Mode
reg(0x000C) 06 06 Get Pixel Format
...
reg(0x00B0) F0 F4 RGB Interface Signal Control
...
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 RDID3

It definitely is NOT an ILI9338. However it does look like a MIPI controller of some form. There do not seem to be any ID bytes in the "usual places"

I suggest that you edit the graphictest_kbv example. Force ID = 0x9329 or 0x9338 i.e.

tft.begin(0x9329);

Where did you buy this shield? e.g. post link to Ebay sale (or post photo of the pcb) Where are you in the world? e.g. UK or Europe.

David.

Thank You Mr.david_prentice,

It worked with both " Force ID = 0x9329 or 0x9338 i.e. tft.begin(0x9329);

I live in india and bought it online from china.

:) :) :)

Ah-ha. It is a regular MIPI controller.

Please can you check all the VERTICAL SCROLL, SOFTWARE SCROLL, INVERT SCREEN colours, directions, ...

I might ask you to do some other tests. e.g. edit LCD_ID_readreg to report every register. Paste to a .txt file. Attach the .txt file.

It is still useful to post a link to the Chinese shop. We can still see the website even if it is in Hindi. It will help readers / buyers from other countries.

David.

Hi David, I have seemingly a similar problem that I try to describe the best I can as follows.

I purchase a 2.8" YFY display at:

I attached the photo of the PCB.

The drive is identified on the PCB as: ILI 9338

When running “diagnose_TFT_support.ino”:

"Diagnose whether this controller is supported
There are FAQs in extras/mcufriend_how_to.txt

tft.readID() finds: ID = 0xD3D3

MCUFRIEND_kbv version: 2.9.1

Probably a write-only Mega2560 Shield
Try to force ID = 0x9481

PORTRAIT is 320 x 480

Run the examples/graphictest_kbv sketch
All colours, text, directions, rotations, scrolls
should work. If there is a problem, make notes on paper
Post accurate description of problem to Forum
Or post a link to a video (or photos)

I rely on good information from remote users"

So I suspect the drive ID is NOT ILI9338 but D3D3?

I tried forcing ID to ID = 0x9481 but it did not work. Actually NONE of the MCUFRIEND_kbv example codes work.

I would much appreciate your help and advice.

From memory I did not publish the diagnose TFT Controller example until v2.9.8

You seem to have v2.9.1

Please can you run the LCD_ID_readreg example. Any version, any age should be ok. Copy-Paste from Serial Terminal to a code window in your message. (use </> icon )

I strongly recommend that you use an up to date library e.g. v2.9.8 from the IDE Library Manager.

If you have installed something manually, please leave IDE, delete library directory, restart IDE.

Then you can let the IDE Library Manager do its job properly i.e. install / update / downdate.

There is something strange going on. It is important to solve this. Thanks for posting a link. It helps when I can see which shop has sold the screen.

David.

Just received the same D3D3 screen from Banggood, previously was getting 9341’s when ordering that product link.

https://www.banggood.com/2_8-Inch-TFT-LCD-Shield-Touch-Display-Module-For-Arduino-UNO-p-989697.html

Here’s the LCD_ID_readreg dump

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) C0 C0 ID: ILI9320, ILI9325, ILI9335, …
reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x000A) 00 08 Get Power Mode
reg(0x000C) 00 06 Get Pixel Format
reg(0x0061) E1 E1 RDID1 HX8347-G
reg(0x0062) E2 E2 RDID2 HX8347-G
reg(0x0063) E3 E3 RDID3 HX8347-G
reg(0x0064) E4 E4 RDID1 HX8347-A
reg(0x0065) E5 E5 RDID2 HX8347-A
reg(0x0066) E6 E6 RDID3 HX8347-A
reg(0x0067) E7 E7 RDID Himax HX8347-A
reg(0x0070) F0 F0 Panel Himax HX8347-A
reg(0x00A1) E1 E1 E1 E1 E1 RD_DDB SSD1963
reg(0x00B0) F0 F0 RGB Interface Signal Control
reg(0x00B4) F4 F4 Inversion Control
reg(0x00B6) F6 F6 F6 F6 F6 Display Control
reg(0x00B7) F7 F7 Entry Mode Set
reg(0x00BF) FF FF FF FF FF FF ILI9481, HX8357-B
reg(0x00C0) C0 C0 C0 C0 C0 C0 C0 C0 C0 Panel Control
reg(0x00C8) C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 GAMMA
reg(0x00CC) CC CC Panel Control
reg(0x00D0) D0 D0 D0 Power Control
reg(0x00D2) D2 D2 D2 D2 D2 NVM Read
reg(0x00D3) D3 D3 D3 D3 ILI9341, ILI9488
reg(0x00D4) D4 D4 D4 D4 Novatek ID
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 RDID3
reg(0x00E0) E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 GAMMA-P
reg(0x00E1) E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 GAMMA-N
reg(0x00EF) EF EF EF EF EF EF ILI9327
reg(0x00F2) F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 Adjust Control 2
reg(0x00F6) F6 F6 F6 F6 Interface Control