2 and more duplicated screen on 2.4 LCD TFT Arduino Uno Shield

Hi everyone
I bought this lcd shield, and i tried EVERY libraries i found on internet, but same issue..
I uploaded spfd5408_graphictest sketch from SPFD5408_master library, and this is result :

it's seems LCD driver is ILI9341.
test result is :

TFT LCD test
Using Adafruit 2.8" TFT Breakout Board Pinout
Found ILI9341 LCD driver
Benchmark Time (microseconds)
Screen fill 1379556
Text 347752
Lines 3390176
Horiz/Vert Lines 144664
Rectangles (outline) 104264
Rectangles (filled) 3267400
Circles (filled) 1211476
Circles (outline) 1475112
Triangles (outline) 1075592
Triangles (filled) 1719036
Rounded rects (outline) 506436
Rounded rects (filled) 3795232
Done!

you see, in result report says :
"Using Adafruit 2.8" TFT Breakout Board Pinout"
but mine is 2.4"

some where i saw someone could solve this problem by editing driver.
but he didn't expand his solution..

i know that my shield is not broken. so..
is anyone help me fix it ?

Ty
DesironnA

Go on. I bet that your shield has a red pcb and says “mcufriend”

Install MCUFRIEND_kbv library from the Library Manager.

What ID is reported ?

Paste the output from the Serial Terminal to your message.
There are several diagnostic sketches in the Examples.

David.

Hi
I uploaded graphictest_kbv and this is result :

Serial took 0ms to start
ID = 0x0

on diagnose_TFT_support :

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

tft.readID() finds: ID = 0x0

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

on LCD_ID_readreg :

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 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 00 00 71 00 00 Status Register
reg(0x000A) 00 08 Get Power Mode
reg(0x000C) 00 77 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 16 16 03 08 08 08 08 10 00 16 16 Adjust Control 2
reg(0x00F6) 00 00 80 10 Interface Control

and screen is dark in all sketches of this library.

I don’t recognise this controller at all. No, it is not currently supported.

Please edit setup() function in the graphictest_kbv example:

    ...
    ID = 0x1520;                             // force ID
    tft.begin(ID);
}

Let me know what you see. You can also try 0x9329.

You can also edit setup() in the LCD_ID_readreg sketch:

    ...
    lcdInit();
    lcdReset();      //ensures that controller is in default state
    for (uint16_t i = 0; i < 256; i++) readReg(i, 7, "f.k"); 
    readReg(0x00, 2, "ID: ILI9320, ILI9325, ILI9335, ...");
    ...

This will report every register. Most will just say 00 00 00 … If you see anything different, please paste only those interesting lines to your message.

David.

When i edit setup() function in the graphictest_kbv example, screen runs but in 2 duplicated screen. another one is dark.

I had asked for only the interesting lines e.g.

reg(0x00D6) 00 00 80 B2 00 00 00 f.k
reg(0x00D7) 00 20 80 31 80 00 00 f.k
reg(0x00D8) 00 00 2A 0C 80 00 00 f.k

reg(0x00F0) 00 04 00 00 00 00 00 f.k
reg(0x00F1) 00 04 00 00 00 00 00 f.k
reg(0x00F2) 00 16 16 03 08 08 08 f.k
reg(0x00F3) 00 80 2A 2A 01 22 00 f.k
reg(0x00F4) 00 00 00 00 00 44 00 f.k
reg(0x00F5) 00 10 00 03 F0 00 1F f.k
reg(0x00F6) 00 00 80 10 10 00 00 f.k
reg(0x00F7) 00 06 03 04 0A 10 1A f.k
reg(0x00F8) 00 06 03 04 0A 10 1A f.k
reg(0x00F9) 00 06 03 04 0A 10 1A f.k
reg(0x00FA) 00 06 03 04 0A 10 1A f.k
reg(0x00FB) 00 06 03 04 0A 10 1A f.k
reg(0x00FC) 00 06 03 04 0A 10 1A f.k
reg(0x00FD) 00 11 00 35 00 00 00 f.k

Please can you edit / delete the garbage in #4 and #5.

Does tft.begin(0x1520) show anything?
Does tft.begin(0x1526) show anything?
Does tft.begin(0x9329) show anything?

Please give accurate answers.

David.

None of them. just 9341 and screen is 2 duplicated

I don't know if English is your first language.

Please give accurate answers. Then we can probably solve your problems. e.g.

Does tft.begin(0x1520) show anything? Black screen
Does tft.begin(0x1526) show anything? Black screen
Does tft.begin(0x9329) show anything? Black screen

Does tft.begin(0x9341) show anything? non-interlaced (2 duplicated)

With accurate answers I can give you sensible advice.

One clear photo of the graphictest_kbv program that shows your problem would be more useful than a thousand words. e.g. any screen that contains different coloured text.

Please edit #4, #5

David.

I’m sorry i’m 11 years old from iran and my english is not so good.
you said

Please edit setup() function in the graphictest_kbv example:
Code: [Select]


ID = 0x1520; // force ID
tft.begin(ID);
}

i edit setup() function in the graphictest_kbv example.
in id 0x1520 my screen has duplicated again,
in id 0x9329 my screen has duplicated and mirror
you also said

You can also edit setup() in the LCD_ID_readreg sketch:


lcdInit();
lcdReset(); //ensures that controller is in default state
for (uint16_t i = 0; i < 256; i++) readReg(i, 7, “f.k”);
readReg(0x00, 2, “ID: ILI9320, ILI9325, ILI9335, …”);

i did it, and in serial monitor
and difference is

reg(0x00D6) 00 00 80 B2 00 00 00    f.k
reg(0x00D7) 00 20 80 31 80 00 00    f.k
reg(0x00D8) 00 00 2A 0C 80 00 00    f.k
reg(0x00D9) 00 07 00 00 00 00 00    f.k

reg(0x00F0) 00 04 00 00 00 00 00    f.k
reg(0x00F1) 00 04 00 00 00 00 00    f.k
reg(0x00F2) 00 16 16 03 08 08 08    f.k
reg(0x00F3) 00 80 2A 2A 01 22 00    f.k
reg(0x00F4) 00 00 00 00 00 44 00    f.k
reg(0x00F5) 00 10 00 03 F0 00 1F    f.k
reg(0x00F6) 00 00 80 10 10 00 00    f.k
reg(0x00F7) 00 06 03 04 0A 10 1A    f.k
reg(0x00F8) 00 06 03 04 0A 10 1A    f.k
reg(0x00F9) 00 06 03 04 0A 10 1A    f.k
reg(0x00FA) 00 06 03 04 0A 10 1A    f.k
reg(0x00FB) 00 06 03 04 0A 10 1A    f.k
reg(0x00FC) 00 06 03 04 0A 10 1A    f.k
reg(0x00FD) 00 11 00 35 00 00 00    f.k

then you said

Does tft.begin(0x1520) show anything?
Does tft.begin(0x1526) show anything?
Does tft.begin(0x9329) show anything?

then i tried those ids in graphictest_kbv examp;le and
in id 0x1520 i have duplicated screen
in id 0x1526 i have black screen
in id 0x9329 i have duplicated and mirrored screen
and in id 0x9341 i have black screen

sorry if i’m driving you angree :frowning:
is it accurate answer ?

You have excellent English. Especially if it is not your main language.

in id 0x1520 i have duplicated screen
in id 0x1526 i have black screen
in id 0x9329 i have duplicated and mirrored screen
and in id 0x9341 i have black screen

That is very helpful. A photo would be useful.

Was there a paper label with a number on it?
Or any printed messages on the pcb e.g. with a four-digit number?

I am fairly certain that I know the problem. And a possible guess for the solution.

David.

Was there a paper label with a number on it?
Or any printed messages on the pcb e.g. with a four-digit number?

No. just there is a text behind of LCD itself = YXT26DA005-B

That is very helpful. A photo would be useful

ID = 0x1520

ID = 0x1526

ID = 0x9329

ID = 0x9341

but when i upload spdf5408_graphictest sketch from SPDF5408 library, in id0x9341, i have same result like id 0x1520 in graphictest_kbv sketch

is it possible that a similar id has different result in two sketch ?

I wrote MCUFRIEND_kbv library.
I do not know spfd5408 library or the sketch that produced the photo in the first post.
It looks like the shape of a 240x320 display.

Thanks for the feedback.
Your photos in #10 have confirmed that you have got a 240x400 display.
And the SM bit is probably in second byte of register(0x00D7)

I still don't know which make it is.

I will post a guess fix shortly.

David.

Please edit setup() function in the graphictest_kbv example:

    ...
    ID = 0x9327;                             // force ID
    tft.begin(ID);
    uint8_t d[] = { 0x20, 0x80, 0x31, 0x80}; //power-up values.  NL in d[2]
    d[1] = 0x90;  //guessing that SM is bit #4 of d[1] like ILI9341
    tft.pushCommand(0xD7, d, 4);
}

I suspect you will get some odd effects in REV_PORTRAIT and REV_LANDSCAPE.
Vertical scroll will not work.
But I hope that PORTRAIT is fixed.

Please let me know.

David.

Ok, my guess was wrong. Please try d[1] = 0x88 and then try 0x00

Please be patient. I do not even know which make it is.

David.

Same result.
i'm patient.

Is this shield broken ? its chipset,..

Here is a diagnostic sketch:

It will show a big WHITE letter F with the default power-up registers.

It will then cycle through the argument bytes, flipping one bit at a time.
These will show a RED letter F with the specific argument byte.

Watch the display. Take notes with pencil and paper.
e.g. does the RED display look exactly like the WHITE display for every argument ?
e.g. does the RED F turn BLUE ?
e.g. do you get a single F or two F ?
e.g. does the F get mirrored vertically?
e.g. does the F get mirrored horizontally?

Write down the argument value that gets a single F

#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;

uint16_t ID;

uint8_t d7[] = { 0x20, 0x80, 0x31, 0x80 };  //mystery
uint8_t b6[] = { 0x0A, 0x82, 0x27, 0x80 };  //ILI9341
uint8_t c0[] = { 0x0A };     //R61520

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

void setup()
{
    ID = tft.readID();
    ID = 0x9327;     //force ID for mystery controller
    tft.begin(ID);
}

void printhex(uint8_t c)
{
    if (c < 0x10) tft.print("0");
    tft.print(c, HEX);
}

void showreg(uint8_t reg, uint8_t d[], uint8_t n, uint8_t idx, uint16_t color)
{
    tft.fillScreen(BLACK);
    tft.setTextColor(color, BLACK);
    tft.setTextSize(10);
    tft.setCursor(0, 0);
    tft.print("F");
    tft.setTextSize(2);
    tft.print(" ID = 0x");
    printhex(ID >> 8);
    printhex(ID & 0xFF);
    tft.pushCommand(reg, d, n);
    tft.setCursor(0, 100);
    tft.println("reg: args ...");
    printhex(reg);
    tft.print(":");
    for (uint8_t i = 0; i < n; i++) {
        tft.setTextColor(color, BLACK);
        tft.print(" ");
        if (i == idx) tft.setTextColor(BLACK, WHITE);
        printhex(d[i]);
    }
    delay(5000);
}

void flipreg(uint8_t reg, uint8_t args[], uint8_t n, uint8_t idx)
{
    uint8_t d[6];
    memcpy(d, args, n);
    showreg(reg, d, n, idx, WHITE);
    for (uint8_t mask = 0x80; mask; mask >>= 1) {
        d[idx] = args[idx];    //default
        d[idx] ^= mask;
        showreg(reg, d, n, idx, RED);
    }
    d[idx] = args[idx];    //default
    showreg(reg, d, n, idx, WHITE);
}

void loop()
{
    switch (ID) {
        case 0x9341:
            flipreg(0xB6, b6, sizeof(b6), 0);
            flipreg(0xB6, b6, sizeof(b6), 1);
            flipreg(0xB6, b6, sizeof(b6), 3);
            break;
        case 0x1520:
        case 0x1526:
            flipreg(0xC0, c0, sizeof(c0), 0);
            break;
        case 0x9327:                    //forced for mystery controller
            flipreg(0xD7, d7, sizeof(d7), 0);
            flipreg(0xD7, d7, sizeof(d7), 1);
            flipreg(0xD7, d7, sizeof(d7), 3);
            break;
        default:
            tft.println("not supported");
            delay(1000);
            break;
    }
}

David.

e.g. does the RED display look exactly like the WHITE display for every argument ?

YES

e.g. does the RED F turn BLUE ?

NO

e.g. do you get a single F or two F ?

Two F

e.g. does the F get mirrored vertically?

NO

e.g. does the F get mirrored horizontally?

NO

Write down the argument value that gets a single F

all F are two (if i undrestand what you mean)

ps: the only colors are red and white
white 20 80 31 80
red A0 80 31 80
red 60 80 31 80
red 00 80 31 80
red 30 80 31 80
red 28 80 31 80
red 24 80 31 80
red 22 80 31 80
red 21 80 31 80
white 20 80 31 80
white 20 80 31 80
red 20 00 31 80
red 20 C0 31 80
red 20 A0 31 80
red 20 90 31 80
red 20 88 31 80
red 20 84 31 80
red 20 82 31 80
red 20 81 31 80
white 20 80 31 80
white 20 80 31 80
red 20 80 31 00
red 20 80 31 C0
red 20 80 31 A0
red 20 80 31 90
red 20 80 31 88
red 20 80 31 84
red 20 80 31 82
red 20 80 31 81
white 20 80 31 80