mcufriend 2.4 TFT LCD Screen Always Blank

Hi, I am new to the Arduino, I have an Uno and I bought the above screen for it but I can’t get anything to print to the screen and I am wondering if it is my that is at fault or the screen.

This is the code that I have run:-

#include <Adafruit_GFX.h>    // Core graphics library
#include <MCUFRIEND_kbv.h>   // Hardware-specific library
MCUFRIEND_kbv tft;

#include <Fonts/FreeSans9pt7b.h>
#include <Fonts/FreeSans12pt7b.h>
#include <Fonts/FreeSerif12pt7b.h>

#include <FreeDefaultFonts.h>

#define BLACK   0x0000
#define RED     0xF800
#define GREEN   0x07E0
#define WHITE   0xFFFF
#define GREY    0x8410

void setup(void)
{
    Serial.begin(9600);
    uint16_t ID = tft.readID();
    if (ID == 0xD3) ID = 0x9481;
    tft.begin(ID);
    tft.setRotation(0);
}

void loop(void)
{
    tft.fillScreen(BLACK);
    showmsgXY(20, 10, 1, NULL, "System x1");
    showmsgXY(20, 24, 2, NULL, "System x2");
    showmsgXY(20, 60, 1, &FreeSans9pt7b, "FreeSans9pt7b");
    showmsgXY(20, 80, 1, &FreeSans12pt7b, "FreeSans12pt7b");
    showmsgXY(20, 100, 1, &FreeSerif12pt7b, "FreeSerif12pt7b");
    showmsgXY(20, 120, 1, &FreeSmallFont, "FreeSmallFont");
    showmsgXY(5, 180, 1, &FreeSevenSegNumFont, "01234");
    showmsgXY(5, 190, 1, NULL, "System Font is drawn from topline");
    tft.setTextColor(RED, GREY);
    tft.setTextSize(2);
    tft.setCursor(0, 220);
    tft.print("7x5 can overwrite");
    delay(1000);
    tft.setCursor(0, 220);
    tft.print("if background set");
    delay(1000);
    showmsgXY(5, 260, 1, &FreeSans9pt7b, "Free Fonts from baseline");
    showmsgXY(5, 285, 1, &FreeSans9pt7b, "Free Fonts transparent");
    delay(1000);
    showmsgXY(5, 285, 1, &FreeSans9pt7b, "Free Fonts XXX");
    delay(1000);
    showmsgXY(5, 310, 1, &FreeSans9pt7b, "erase backgnd with fillRect()");
    delay(10000);
}

void showmsgXY(int x, int y, int sz, const GFXfont *f, const char *msg)
{
    int16_t x1, y1;
    uint16_t wid, ht;
    tft.drawFastHLine(0, y, tft.width(), WHITE);
    tft.setFont(f);
    tft.setCursor(x, y);
    tft.setTextColor(GREEN);
    tft.setTextSize(sz);
    tft.print(msg);
    delay(1000);
}

Also here is a picture of the screen with the above code uploaded.

Thanks, Daniel.

Install/Update the MCUFRIEND_kbv and Adafruit_GFX libraries with the Library Manager.

Then run the diagnose_TFT_controller sketch from the Examples. Copy-paste the output from the Serial Terminal.

A photo of a white screen is fairly pointless. A photo of the pcb is far more useful.

David.

Hi David, thanks for the reply to my post.

I updated the libraries you suggested and I looked for the diagnose_TFT_controller sketch but could only find diagnose_TFT_support. I didn’t know if there had been a revision name change but I compiled and uploaded this sketch but the result was the same just a white screen.

Here are a couple if pictures of the board, front and back. Sorry my first photo wasn’t useful, I was not sure how to describe the problem.

The readout from the Serial Terminal is in an attachment because I couldn’t copy the text to add it here.

I do see, however from the output that the screen I have appears to be unsupported at this time. Also the output gave me another sketch to run so I am looking to do that and I will come back here.

Many thanks, Daniel.

Oops. My typo about diagnose_TFT_support.ino

DSC_0488 shows a Mcufriend shield without LDO chip.
screenshot_1 shows that it has an ID = 0x0001

You can copy-paste from the Serial Terminal by using ctrl-A, ctrl-C to copy and ctrl-V to paste

This controller is not supported in the v2.9.8 Release from the Library Manager.

It is supported in the Beta. You must leave IDE, delete directory. Download ZIP from GitHub. Start IDE. Install from ZIP.

David.

No worries David, I really appreciate your help. I was reading some of your old posts where you fixed a similar problem.

I looked for the MCUFRIEND zip file in beta and the only one I could find was the 2.9.3 beta, is this the file you are meaning?

Thanks, Daniel.

Go to GitHub.
At the right of the screen there is a Green button called "Clone or download"
At the left of the screen there is a box called "Branch". (you can select different branches)

The "current Beta" is always called "master".
Select "master" and "download ZIP"

As a general rule, you install a "Release" via the Library Manager.
Only download a ZIP if it has been specifically recommended for you.

If you are a happy GitHub member you would "clone" the project.
Then you can access any Branch, Release, history, ...

David.

Hi David, thank you for that information. I am learning a lot just from your posts.

I did as you suggested and left the sketch to compile and upload. Interestingly once I have looked closely at the screen, I could see that indeed you had fixed the problem and I am very grateful to you for your time on this.

However, the screen was still white and not the black that the sketch had indicated. I read one of you other threads about the colours being inverted on some screens so I am trying that as I type this.

I will come back with results.

Many thanks, Daniel.

I do not have a 0x0001 display.

Please run graphictest_kbv.
Make notes about wrong colours, invert screen, software scroll

Then report back. Inverted Colours are easy to solve.

David.

So I don't admit to fully understanding the results of running the suggested sketch but when it ran next to nothing was visible on the screen. I then switched the black code for the white code where the colours are defined and the screen came to life. All the main colours on the scrolling screen where fine, they were the colour of the text that was describing them.

However, the screen is still mostly white, infact the background colour of the screen is white but the displays on the screen are visible. If I leave the black and white as they should be in the code the screen background still appears to be white but it is very difficult to read anything at all on the screen.

Thanks, Daniel.

Ah, so I just used tft.invertDisplay(0); and the problem has been resolved. I can now get on with some coding.

Many thanks for your help David.

It sounds as if the backlight is too bright. i.e. it shows through BLACK when it should not show at all.
You can try forcing tft.begin(0x9325) instead of tft.begin(0x0001)

When these shields first appeared they had a AMS1117-3.3 LDO regulator chip to power the backlight.

The current shields omit the LDO chip and power the backlight from the Uno's wimpy 3.3V pin.
This is WRONG. The 3.3V pin is only rated for 50mA.

I am not too worried about the 2.4 inch shields. The backlights probably draw 70mA.
However some of the 3.5 inch shields draw 400mA. Does your screen feel warm? Or hot?

I would expect the Uno or Mega regulator to fail. Mcufriend do not care. Ebay sellers do not care.

David. (who has no connection with Mcufriend.com)

Please give an accurate report.
The "INVERT DISPLAY" screen should show a WHITE background i.e. inverting the Gray LANDSCAPE REV Penguin screen (which has a BLACK background)
The LANDSCAPE Penguin should show a GREEN band.

Yes sure,

The LANDSCAPE Penguin should show a GREEN band.

Yes it does show a GREEN band

The "INVERT DISPLAY" screen should show a WHITE background i.e. inverting the Gray LANDSCAPE REV Penguin screen (which has a BLACK background)

Yes a WHITE background for this part

Thanks a lot, is there any more information I can give here to help others?

Daniel.

I would expect ALL the examples to build and run straight out of the box (with the Beta from GitHub).

You should not need to call different begin() or invertDisplay()

I do not understand your "white" display in #8.

Does your screen feel warm?
Do you own a DMM?

David.

Mmm, thats odd then I guess. If I don't run the invertDisplay(0) then the screen display is virtually illegible.

When I said white, that was the background colour of the screen, white when I was expecting it to be black.

The screen is certainly not warm but I would say room temperature. I do have a multi meter what would you like me to check?

Daniel.

Remove the shield. Connect GND to GND. Connect 3.3V to 3.3V via your DMM. I would expect 30mA - 80mA

The original shields (with AMS1117) connect 5V to 5V via your DMM.

Run the graphictest_kbv fresh out of the box. Observe BLACK background. Observe INVERT_DISPLAY. Observe WHITE background. Next sequence should show BLACK background.

Each complete sequence should be the same i.e. Adafruit Tests, Tests Report screen, Penguin screens, Invert screen.

There should be many graphictest_kbv videos on the internet. Compare with your screen.
Post a link to your video if required.

I have never seen an 0x0001 screen. I rely on your reports.

David.

David, I'm just waiting for my jumper cables to arrive and I'll get straight on it.

Hi David, I got my jumper cables today so did your test. I got 62mA from doing what you asked. That would fit with your window.

Running the graphicstest_kbv showed nothing on screen unless I include the invertdisplay line.

Hope that helps, Daniel.

If you run graphictest_kbv it goes through all the tests, penguins until "INVERT DISPLAY" which should show a GRAY Band with WHITE background

The second pass through the loop() will show all the tests, penguins, with BLACK background until "INVERT DISPLAY" which should show a GRAY Band with WHITE background

Other examples never call invertDisplay(). So you never see anything at all.

Is my guesswork correct ?

You could cure by adding tft.invertDisplay(0) after the tft.begin(0x0001) call in setup().

Please confirm my theory. Then I can correct the next Release.

62mA is not too dangerous. It is above the limit for Uno, Mega. It is fine for boards like Zero or Due.
Personally, I would NEVER buy one of the current Mcufriend Shields that omit the 3.3V LDO regulator chip.

David.

Yes David that is correct, I find that if I just call invert.display(); then the screen operates as you would expect. I guess if you can allow for this in the library file then that would be great for other users.

Thanks, Daniel.

Are you sure that INVERT DISPLAY changes colours properly in graphictest_kbv after the first loop() ?

Please edit the LCD_ID_readnew sketch from the Examples:
in setup()

    //    read_regs("diagnose any controller");
    //    read_xxxx("mystery");
    //    read_5310_P0("NT35310 P0");
    //    read_5310_P1("NT35310 P1");
    //    read_61509("R61509 / ILI9326");
    //    read_61526("R61520 / R61526");
    //    read_8357("HX8357X");
    read_9320("ILI9320");
    //    read_9327("ILI9327");
    //    read_9338("ILI9302 / ILI9329 / ILI9338 / ILI9341");
    //    read_9481("ILI9481 / HX8357-B / R61581");
    //    read_9486("ILI9486 / 1LI9488");

and in read_9320() add these lines

    readReg(0x0060, 2, "Drive Output Control 2");
    readReg(0x0061, 2, "Base Image Display Control");
    readReg(0x006A, 2, "Vertical Scroll Control");

Copy-paste from the Serial Terminal to a Code window in your message.

ID = 0x0001 is an unknown controller. It seems to be similar to ILI9320 or ILI9325. Those controllers have readable registers. Other controllers can only read the ID.

David.