Getting graphics displays working

I recently purchased a kit from Banggood which included two touch displays and a “fake” UNO. I also have a Redboard UNO and everything works the same with either board so I don’t think the MCU is the problem.

This is the kit: Geekcreit® uno r3 improved version + 2.8tft lcd touch screen + 2.4tft touch screen display module kit geekcreit for arduino - products that work with official arduino boards Sale - Banggood.com

Disclaimer: I am a C newbie, although I have done programing in other languages so I know what a program generally looks like and can follow code.

I have used the “graphictest_kbv.ino” in the Arduino examples to check out the two boards.

The 2.8" board works just fine and does what I would expect of a test program.

The 2.4" board mostly works with two exceptions:

  1. The software thinks it is a 320x4800 display (it is a 240x320 just like the 2.8" display.
  2. In portrait mode the text displays from right to left. Landscape is fine.

I ran the diagnostic tests on both and got the results shown in the attachments. Not sure the attachments attached since they do not show up in the preview…

Any suggestions you can provide to get the 2.4" display working would be greatly appreciated.

2.4 diagnostics.txt (1.41 KB)

2.8 diagnostics.txt (1.35 KB)

Please copy-paste text to your message. You only “attach” text files if they are very big.

from your 2.4 diagnostics.txt :

tft.readID() finds: ID = 0xD3D3

MCUFRIEND_kbv version: 2.9.9

Probably a write-only Mega2560 Shield

It is clearly a Uno shield and not a Mega shield (which has a 18x2 header socket).
Uno shields are always read-write. Obviously v2.9.9 does not find a valid ID.

Please run the LCD_ID_readreg.ino example sketch.
Copy-paste the Serial output to your message.

David.

Thanks for the quick response! Here is the result for LCD_ID_readreg:

Serial took 0ms to start
ID = 0xD3D3

in spec⸮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 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

...
reg(0x0004) 00 00 00 00    Manufacturer ID
...
reg(0x00BF) FF FF FF FF FF FF    ILI9481, HX8357-B
...
reg(0x00DA) 00 00    RDID1
reg(0x00DB) 00 00    RDID2
reg(0x00DC) 00 00    RDID3
...

I don’t recognise your controller. So I suggest a bit of guesswork:

Edit setup() in graphictest_kbv.ino

void setup(void) {
    Serial.begin(9600);
    uint32_t when = millis();
    //    while (!Serial) ;   //hangs a Leonardo until you connect a Serial
    if (!Serial) delay(5000);           //allow some time for Leonardo
    Serial.println("Serial took " + String((millis() - when)) + "ms to start");
    //    tft.reset();                 //hardware reset
    uint16_t ID = tft.readID(); //
    Serial.print("ID = 0x");
    Serial.println(ID, HEX);
    if (ID == 0xD3D3) ID = 0x9481; // write-only shield
    ID = 0x9329;                             // >>>> force ID <<<<
    tft.begin(ID);
}

Please take notes on paper. e.g.

  1. is it White Screen ?
  2. observe directions on Penguin screens
  3. text mirrored ?
  4. scroll directions ?
  5. software scroll ?

Please report back with the errors.

Photos of a Penguin screen might be easier than typing the notes.

David.

Results:

  1. is it White Screen ?
    Not sure what this is asking. If you are asking does it do things the answer is yes. If you mean is the background white instead of black, the answer is also yes.
  2. observe directions on Penguin screens
    the scroll is the direction relative to the display that is printed (in other words, correct)
  3. text mirrored ?
    Yes, both portrait and landscape
  4. scroll directions ?
    Correct relative to the printed info on the screen
  5. software scroll ?
    Not sure what this is referring to. If you mean does the colorband independently scroll within the page, the answer is yes.

It no longer acts like it is 320x480. Everything is on screen and all displays move and clear properly.

The other thing is that the colors are totally wrong. It looks like they are the complementary colors (white is black, yellow is blue, green is magenta, etc.).

Bottom line: Only problem now is reversed text and colors wrong. Which is a big improvement!

I did some more online searching and found info that claims this assembly uses an HX8347-G(T) chip. Whether that is correct or not I don't know.

I confirmed that the colors are reversed by renaming the primary colors in the definitions in the graphics test. However, I obviously will need to be able to change them globally. I assume that can be done via the MCUFriend library??

No, it is certainly NOT HX8347.

Please try ID = 0x9338 which should invert the colours properly.

But make accurate notes. e.g.
Blue PORTRAIT horizontal mirror.
Green LANDSCAPE vertical mirror.
Red PORTRAIT_REV correct
...
SOFTWARE SCROLL: readPixel() error.
...

Make notes with pencil and paper. Run again to check accuracy. ...

Yes, I can adjust most behaviour in a single statement. But I need to get feedback.

David.

Not only are the colors correct now, but everything works as expected! Color band scrolls, text scrolls, etc. So for future programs I should set the default to ID = 0x9338?

Now I have a question about the 2.8" display. The color band does not scroll independently nor does the text scroll independently. Everything else is okay. Is it possible it just can't do that or is it likely it is just being misidentified?

Here is the result of the readreg on that display:

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) 68 09 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 00 00 00 00 00 Status Register
reg(0x000A) 00 00 Get Power Mode
reg(0x000C) 00 00 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 00 00 00 00 00 00 00 00 00 00 00 Adjust Control 2
reg(0x00F6) 00 00 00 00 Interface Control

The RM68090 can NOT scroll a small band. It always scrolls the whole screen. It is an "older" controller.

The real mystery is how "older" controllers appear on the Ebay / BangGood / AliExpress market. I think that they were originally kept as replacement screens for mobile phones.

Those phones are now obsolete. The screens get sold cheaply as surplus.

Does 0x9338 work 100% on the Red 2.4 inch Shield ?
i.e. correct colours. correct vertical (band) scroll. correct software scroll.

David.

Okay on the larger screen. I suspected it might be the case. Everything else seems to work except those two things. Really not a major problem for me.

The smaller screen seems to work100%.

Is what I said earlier the permanent solution - default to 9338?

Thanks a bunch for your help!

Just force ID=0x9338 for the moment.

I might ask you to try some things with LCD_ID_readnew.ino
There is probably a register to unlock.

David.

Ask away!

Thanks for your help!

Dick Tasker

This topic was automatically closed after 51 days. New replies are no longer allowed.