Go Down

Topic: 2 and more duplicated screen on 2.4 LCD TFT Arduino Uno Shield (Read 1 time) previous topic - next topic

DesironnA

I found someone who solved his issue jusy like mine.
i don't know why my shield doesn't work by 0x1520 ID
here is the link:

Please Click

and here is the comment :
MarioP110
Hi! I've the same problem and after a big number of test I've finally discover the correct driver for my lcd.Take a look to the link: https://forum.arduino.cc/index.php?topic=366304.0
My LCD has an identifier of 0x1520 that isn't not in the other sketch that I've tried.

i am not able to buy a new one. i realy hope that my shield will be ok and running at well with your help.

david_prentice

Please try this sketch.   Copy-Paste the Serial Terminal to your message.

Code: [Select]

#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;

uint16_t ID;

void setup()
{
    Serial.begin(9600);
    Serial.println("Test some TFT registers by changing bits in argument bytes");
    ID = tft.readID();
    Serial.print("readID() = 0x");
    Serial.println(ID, HEX);
    if (ID == 0) ID = 0x9999;     //force magic ID for mystery controller
}

bool test_unlock(uint8_t lockreg, uint8_t key, uint8_t test_reg)
{
    tft.reset();
    tft.begin(0x9329);    //minimal configuration
    uint8_t testval;
    uint16_t newtest;
    uint8_t oldlock = tft.readReg(lockreg, 0) & 0xFF;
    uint16_t oldtest = tft.readReg(test_reg, 0) & 0xFF;
    uint8_t oldval = oldtest;

    testval = oldval ^ 0xFF;
    tft.pushCommand(test_reg, &testval, 1);
    newtest = tft.readReg(test_reg, 0) & 0xFF;
    bool wake = (newtest != oldtest);
    if (wake == true) tft.pushCommand(test_reg, &oldval, 1);

    tft.pushCommand(lockreg, &key, 1);

    testval = oldval ^ 0xFF;
    tft.pushCommand(test_reg, &testval, 1);
    newtest = tft.readReg(test_reg, 0) & 0xFF;
    bool ret = (newtest != oldtest);
    if (ret == true) tft.pushCommand(test_reg, &oldval, 1);

    uint8_t sleepcmd = 0x10;
    tft.pushCommand(sleepcmd, NULL, 0);

    Serial.print(wake ? "Unprotected." : "Protected.");
    Serial.print(" reg(0x");
    Serial.print(lockreg, HEX);
    Serial.print(") = 0x");
    Serial.print(key, HEX);
    Serial.print("  ");
    if (ret) Serial.print("un");
    Serial.print("locks test_reg 0x");
    Serial.print(test_reg, HEX);
    Serial.println("");
    delay(1000);
    return ret;
}

void loop()
{
    uint8_t reg;
    switch (ID) {
        case 0x9999: reg = 0xD7; break;
        case 0x9327: reg = 0xC0; break;
        case 0x9341: reg = 0xB6; break;
        case 0x1520: reg = 0xC0; break;
        case 0x1526: reg = 0xC0; break;
        default:
            Serial.println("ID is unsupported");
            while (1) ;
            break;
    }
    test_unlock(0xB0, 0x3F, reg);
    test_unlock(0xB0, 0x00, reg);
    test_unlock(0xC6, 0x00, reg);
    test_unlock(0xD0, 0x00, reg);
    test_unlock(0xE0, 0x3F, reg);
    test_unlock(0xF0, 0x00, reg);
    while (1);
}


David.

DesironnA

Serial monitor report :
Code: [Select]
Test some TFT registers by changing bits in argument bytes
readID() = 0x0
Protected. reg(0xB0) = 0x3F  locks test_reg 0xD7
Protected. reg(0xB0) = 0x0  locks test_reg 0xD7
Protected. reg(0xC6) = 0x0  locks test_reg 0xD7
Protected. reg(0xD0) = 0x0  locks test_reg 0xD7
Protected. reg(0xE0) = 0x3F  locks test_reg 0xD7
Protected. reg(0xF0) = 0x0  locks test_reg 0xD7


david_prentice

Ah-ha.   None of my guesses work.   I am running out of ideas.

Please can you edit the sketch that I posted in #20 for verbose output.
Code: [Select]


uint16_t ID;
uint8_t read_xx = 0;     //first read is a dummy
uint8_t verbose = 1;     // MAKE a LOT OF OUTPUT



Please run the modified sketch and copy-paste the Serial Terminal output to your message.

Have you asked the Vendor for help?   After all,  they took your money.

David.

DesironnA

Code: [Select]
TFT ID = 0x0

org 0009: xx 00 71
~   0009: xx FF 8E
=   0009: xx 00 71
^   0009: xx 00 00 [2] read only
org 000A: xx 08
~   000A: xx F7
=   000A: xx 08
^   000A: xx 00 [1] read only
org 000C: xx 77
~   000C: xx 88
=   000C: xx 77
^   000C: xx 00 [1] read only
org 002E: xx
~   002E: xx
=   002E: xx
^   002E: xx [0] read only
org 00B0: xx 00 00 00 00 00 00 00
~   00B0: xx FF FF FF FF FF FF FF
=   00B0: xx F0 F0 F0 F0 F0 F0 F0
^   00B0: xx F0 F0 F0 F0 F0 F0 F0 [7]
org 00C6: xx 03
~   00C6: xx FC
=   00C6: xx 80
^   00C6: xx 83 [1]
org 00D6: xx 00 80 B2
~   00D6: xx FF 7F 4D
=   00D6: xx 00 80 B2
^   00D6: xx 00 00 00 [3] read only
org 00D7: xx 20 80 31 80
~   00D7: xx DF 7F CE 7F
=   00D7: xx 20 80 31 80
^   00D7: xx 00 00 00 00 [4] read only
org 00D8: xx 00 2A 0C 80
~   00D8: xx FF D5 F3 7F
=   00D8: xx 00 2A 0C 80
^   00D8: xx 00 00 00 00 [4] read only
org 00D9: xx 07 00 00
~   00D9: xx F8 FF FF
=   00D9: xx FF FF F8
^   00D9: xx F8 FF F8 [3]
org 00E0: xx 00
~   00E0: xx FF
=   00E0: xx 02
^   00E0: xx 02 [1]
org 00E1: xx 00 00
~   00E1: xx FF FF
=   00E1: xx FF FC
^   00E1: xx FF FC [2]
org 00F0: xx 04
~   00F0: xx FB
=   00F0: xx FB
^   00F0: xx FF [1]
org 00F1: xx 04
~   00F1: xx FB
=   00F1: xx FB
^   00F1: xx FF [1]
org 00F2: xx 16 16 03 08 08 08 08 10 00 16 16
~   00F2: xx E9 E9 FC F7 F7 F7 F7 EF FF E9 E9
=   00F2: xx 09 09 0C F7 F7 F7 F7 6F 07 09 09
^   00F2: xx 1F 1F 0F FF FF FF FF 7F 07 1F 1F [11]
org 00F3: xx 80 2A 2A 01 22 00 00 2C
~   00F3: xx 7F D5 D5 FE DD FF FF D3
=   00F3: xx 7F 15 15 0E 55 7F 7F 03
^   00F3: xx FF 3F 3F 0F 77 7F 7F 2F [8]
org 00F4: xx 00 00 00 00 44
~   00F4: xx FF FF FF FF BB
=   00F4: xx 7F 7F FF 7F 33
^   00F4: xx 7F 7F FF 7F 77 [5]
org 00F5: xx 10 00 03 F0 00 1F
~   00F5: xx EF FF FC 0F FF E0
=   00F5: xx 03 77 0C 0F 7F 00
^   00F5: xx 13 77 0F FF 7F 1F [6]
org 00F6: xx 00 80 10 10
~   00F6: xx FF 7F EF EF
=   00F6: xx F8 7B EF 2F
^   00F6: xx F8 FB FF 3F [4]
org 00F7: xx 06 03 04 0A 10 1A 22 2C 13 12 1D 11 02 22 22
~   00F7: xx F9 FC FB F5 EF E5 DD D3 EC ED E2 EE FD DD DD
=   00F7: xx F9 3C 3B 35 2F 25 1D 13 2C 2D 22 2E 3D DD DD
^   00F7: xx FF 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F FF FF [15]
org 00F8: xx 06 03 04 0A 10 1A 22 2C 13 12 1D 11 02 22 22
~   00F8: xx F9 FC FB F5 EF E5 DD D3 EC ED E2 EE FD DD DD
=   00F8: xx F9 3C 3B 35 2F 25 1D 13 2C 2D 22 2E 3D DD DD
^   00F8: xx FF 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F FF FF [15]
org 00F9: xx 06 03 04 0A 10 1A 22 2C 13 12 1D 11 02 22 22
~   00F9: xx F9 FC FB F5 EF E5 DD D3 EC ED E2 EE FD DD DD
=   00F9: xx F9 3C 3B 35 2F 25 1D 13 2C 2D 22 2E 3D DD DD
^   00F9: xx FF 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F FF FF [15]
org 00FA: xx 06 03 04 0A 10 1A 22 2C 13 12 1D 11 02 22 22
~   00FA: xx F9 FC FB F5 EF E5 DD D3 EC ED E2 EE FD DD DD
=   00FA: xx F9 3C 3B 35 2F 25 1D 13 2C 2D 22 2E 3D DD DD
^   00FA: xx FF 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F FF FF [15]
org 00FB: xx 06 03 04 0A 10 1A 22 2C 13 12 1D 11 02 22 22
~   00FB: xx F9 FC FB F5 EF E5 DD D3 EC ED E2 EE FD DD DD
=   00FB: xx F9 3C 3B 35 2F 25 1D 13 2C 2D 22 2E 3D DD DD
^   00FB: xx FF 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F FF FF [15]
org 00FC: xx 06 03 04 0A 10 1A 22 2C 13 12 1D 11 02 22 22
~   00FC: xx F9 FC FB F5 EF E5 DD D3 EC ED E2 EE FD DD DD
=   00FC: xx F9 3C 3B 35 2F 25 1D 13 2C 2D 22 2E 3D DD DD
^   00FC: xx FF 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F FF FF [15]
org 00FD: xx 11 00 35
~   00FD: xx EE FF CA
=   00FD: xx 66 03 0A
^   00FD: xx 77 03 3F [3]


DesironnA

Quote
Have you asked the Vendor for help?   After all,  they took your money
No. i bought it from some persian online store that belong to my country.
and i bet they shipped it directly from china.
i tried to ask them but nobody did answer.
supporting arduino coding is awful in here.
no one tries to help no one. the situration is worse that i am only a child

david_prentice

Thanks for the feedback.

It is my bedtime.   I will think in the morning.

David.

DesironnA


david_prentice

This will be the last attempt to find the command protection register.
Code: [Select]

#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;

uint16_t ID;

void setup()
{
    Serial.begin(9600);
    Serial.println("Test some TFT registers by changing bits in argument bytes");
    ID = tft.readID();
    Serial.print("readID() = 0x");
    Serial.println(ID, HEX);
    if (ID == 0) ID = 0x9999;     //force magic ID for mystery controller
}

bool test_unlock(uint8_t lockreg, uint8_t key, uint8_t test_reg)
{
    tft.reset();
    tft.begin(0x9329);    //minimal configuration
    uint8_t testval;
    uint16_t newtest;
    uint8_t oldlock = tft.readReg(lockreg, 0) & 0xFF;
    uint16_t oldtest = tft.readReg(test_reg, 0) & 0xFF;
    uint8_t oldval = oldtest;

    testval = oldval ^ 0xFF;
    tft.pushCommand(test_reg, &testval, 1);
    newtest = tft.readReg(test_reg, 0) & 0xFF;
    bool wake = (newtest != oldtest);
    if (wake == true) tft.pushCommand(test_reg, &oldval, 1);

    tft.pushCommand(lockreg, &key, 1);

    testval = oldval ^ 0xFF;
    tft.pushCommand(test_reg, &testval, 1);
    newtest = tft.readReg(test_reg, 0) & 0xFF;
    bool ret = (newtest != oldtest);
    if (ret == true) tft.pushCommand(test_reg, &oldval, 1);

    uint8_t sleepcmd = 0x10;
    tft.pushCommand(sleepcmd, NULL, 0);

    Serial.print(wake ? "Unprotected." : "Protected.");
    Serial.print(" reg(0x");
    Serial.print(lockreg, HEX);
    Serial.print(") = 0x");
    Serial.print(key, HEX);
    Serial.print("  ");
    if (ret) Serial.print("un");
    Serial.print("locks test_reg 0x");
    Serial.print(test_reg, HEX);
    Serial.println("");
    delay(1000);
    return ret;
}

void loop()
{
    uint8_t reg;
    switch (ID) {
        case 0x9999: reg = 0xD7; break;
        case 0x9327: reg = 0xC0; break;
        case 0x9341: reg = 0xB6; break;
        case 0x1520: reg = 0xC0; break;
        case 0x1526: reg = 0xC0; break;
        default:
            Serial.println("ID is unsupported");
            while (1) ;
            break;
    }
    test_unlock(0xB0, 0xFF, reg);   // [F0] for mystery
    test_unlock(0xB0, 0x00, reg);   
    test_unlock(0xC6, 0x83, reg);   // [83] for mystery
    test_unlock(0xC6, 0x80, reg);
    test_unlock(0xC6, 0x00, reg);
    test_unlock(0xE0, 0x3F, reg);   // [02] for mystery
    test_unlock(0xF0, 0x00, reg);   // [FF] for mystery
    test_unlock(0xF0, 0xFF, reg);
    while (1);
}


David.

DesironnA

Code: [Select]
Test some TFT registers by changing bits in argument bytes
readID() = 0x0
Protected. reg(0xB0) = 0xFF  locks test_reg 0xD7
Protected. reg(0xB0) = 0x0  locks test_reg 0xD7
Protected. reg(0xC6) = 0x83  locks test_reg 0xD7
Protected. reg(0xC6) = 0x80  locks test_reg 0xD7
Protected. reg(0xC6) = 0x0  locks test_reg 0xD7
Protected. reg(0xE0) = 0x3F  locks test_reg 0xD7
Protected. reg(0xF0) = 0x0  locks test_reg 0xD7
Protected. reg(0xF0) = 0xFF  locks test_reg 0xD7


Hi David
This stupid shield is unlockable. thank you so much for all you did for me.

david_prentice

PM me with your postal address.   I will mail you a 240x320 or a 240x400 shield as a gift.

How long does the mail take from the UK to Iran?

David.

DesironnA

NO !! That's very kind of you. but it is so much. this shield is cheap.
This is not worth that you buy and post it to me.
The postage is much higher than the price of this shield.
I'll buy it next two month.
You're very kind. even more than my dad.
Thanks for everything.

david_prentice

I have several shields.   I am happy to mail one to you.   It depends on the mailing time.

There is no point in mailing a packet that takes more than 20 days to arrive.
If I send  a packet to UK, it takes  1-2 days.   From UK to Germany  2-3 days.

I am glad that you have a kind father.   They are the best type.

David.

DesironnA

Hi again
I realized that this LCD was released in 2010.
What if it has a particular and old library or id?

PrinceCharles23

hi!

i just redid all the steps you two guys went trough and can confirm exactly the same results.

i have two displays of the sort lying around here. i contacted the chinese manufaturer (mcufriend) but with no reply so far.

@david_prentice:
i am pretty new to arduino and stuff but i am capable of programming. i see two possible options:
i send you one of my displays and/or you point me to the right resources to analyze/debug further. right now all these magic numbers do not make any sense to me. is there some kind of generalized protocol all controllers use? where can i find the specs to that?

Go Up