[Solved - I think!] 2.4in tftlcd display shield for Arduino purchased from ebay

Bought couple of Chinese tftlcd displays, advertised as ILI9341 controllers.
(http://www.ebay.ca/itm/264269574983)

When trying to use it with standard libraries, it only produced white screen. After many google searches, I used the MCUFRIEND_kbv library by David Prentice. I am using ver 2.9.9 When I tried the examples, the screen displayed the characters but in reversed image. Looking at many posts about this, I did not find anything that worked. Finally broke down and read some of the data sheet (233 pages!) and found the register that seemed to control the image reversal (control register B4h). I then changed the MCUFRIEND_kbv.cpp file in the library by adding "| INVERT_SS" to the _lcd_capable assignment in the case for 9341. In the examples, I had to explicitly assign 0x9341 to the tft(begin) routine as the display does not appear to provide an identifier - the identifier returns 0x0.

Once I did this, the examples for the display, both aspect_kbv and graphictest_kbv work fine.

Not sure if this screws anything else up, but at least I now have a working display on the Uno. Next step is to try and see if I can get it working on a blue pill as I need more computational power for the application I am going to try. (Analysing a trapezoidal rf waveform to show amplifier linearity).

Hope this helps someone.

First off. Thanks for the link. It shows a red "Mcufriend 2.4 inch Uno Shield"

Install MCUFRIEND_kbv via IDE Library Manager
Most examples should report the ID to the Serial Terminal.

Please post any diagnostic report. Then I can support your display properly.

David.

David, I have the MCFRIEND_kbv installed via the IDE lib manager. If I run the LCD_ID_readreg example, here is the output.

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 E3 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) 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 80 Inversion Control
reg(0x00B6) 00 0A 02 27 00 Display Control
reg(0x00B7) 00 FF 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 0C 1B 00 00 00 00 00 00 00 00 00 00 GAMMA
reg(0x00CC) 00 06 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 E3 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

As you see, the ID value is 0x0000

Let me know if you need anything else.

Tony

reg(0x0004) 00 E3 00 00 Manufacturer ID
reg(0x00DA) 00 E3       RDID1
reg(0x00DB) 00 00       RDID2
reg(0x00DC) 00 00       RDID3

No, I don't recognise this controller. But reg(0xB6) is similar to Ilitek's ILI9341

reg(0x00B6) 00 0A 02 27 00      Display Control

Please run the LCD_ID_readnew example. Edit setup() from

    //    unlock = unlock_1526;

to

        unlock = unlock_1526;

It might reveal a different value in reg(0xBF) or elsewhere.

David.

David,

Here is output from running LCD_ID_readnew with the setup modified to uncomment unlock = 1526;

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)

diagnose any controller
reg(0x0000) 00 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 E3 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(0x0030) 00 00 00 00 00 PTLAR
reg(0x0033) 00 00 00 00 00 00 00 VSCRLDEF
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 2F RGB Interface Signal Control
reg(0x00B3) 00 00 1F 00 00 Frame Memory
reg(0x00B4) 00 80 Frame Mode
reg(0x00B6) 00 0A 02 27 00 Display Control
reg(0x00B7) 00 FF 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(0x00C1) 00 00 00 00 Display Timing
reg(0x00C5) 00 00 Frame Rate
reg(0x00C8) 00 0C 1B 00 00 00 00 00 00 00 00 00 00 GAMMA
reg(0x00CC) 00 06 Panel Control
reg(0x00D0) 00 00 00 00 Power Control
reg(0x00D1) 00 35 36 00 VCOM Control
reg(0x00D2) 00 00 00 Power Normal
reg(0x00D3) 00 00 00 00 ILI9341, ILI9488
reg(0x00D4) 00 00 00 00 Novatek
reg(0x00DA) 00 E3 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

It all appears to be working, but as I mentioned, I had to include the | INVERT_SS in the _lcd_capable assignment at the start of case 9341.

As long as I do not try to use the identifier, but rather explicitly make it for 9341, then all is okay.

Tony