Wrong code or bad board?

I support over 30 different controllers. The whole idea behind this library is that you Plug in the shield, it will identify the correct controller and WORK 100%.

Incidentally, I have noticed some unusual differences with your "0x9340"

reg(0x0004) 00 00 93 40 Manufacturer ID
reg(0x00A1) 00 FF 00 FF 00 RD_DDB SSD1963
reg(0x00B6) 00 00 00 00 00 Display Control
reg(0x00C0) 00 00 00 00 00 00 00 00 00 Panel Control
reg(0x00CC) 00 00 Panel Control
reg(0x00D0) 40 40 01 Power Control
reg(0x00D2) 40 40 01 40 40 NVM Read
reg(0x00DB) 93 93 RDID2
reg(0x00DC) 40 40 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(0x00F6) 00 00 00 00 Interface Control

I suspect that this is not a genuine Ilitek device. I would be 99% confident that a genuine MCUFRIEND_kbv will identify it as 0x9340. And that the Manager installation will run examples correctly.

Yes, I am very interested to hear about your unusual 0x9340 and especially where you bought it.
After all, other members might receive the same Shield. I would like this Shield to work out of the box. i.e. I can put any corrections into the next version Release.

David.

I have just run your sketch on my ILI9340 Shield.
Serial Monitor shows

===testcard_kvb  ID = 0x9329 By TomGeorge 2021===
ID read from the TFTLDC = 0x9340
Working TFT ID = 0x9329

The colours are wrong. There is vertical mirroring.
But your colours are wrong too.

David.

Hi, @david_prentice
SORRY I was mistaking you for @rmurray1620 .
This new forum needs to do a facebook and put author next to thier name.

I didn't recognize you as the programmer responsible for this library.

I believe I got it about 18months ago with a UNO as a package on ebay.

The PCB has written along its edge on the reverse side to the display.

tftlcd for arduino uno (spiflash)

Tom... :grinning: :+1: :coffee: :australia:

I am probably more interested in how you installed the library and where you got it from.

And obviously whether graphictest_kbv.ino example passes every test on your Shield. ( with the current v2.9.9-Release )

Please report back with the ID shown on Serial Terminal.
Study colours, print directions, scroll directions, colour inversion, ...
Report any problems. Simple enough to type in regular English.
If you are unsure how to describe something, some photos tell me almost everything I need. A video link is ideal.

David.

Hi,
I trawlled ebay, this looks like it, with spiflash on it, and the display is mounted just a badly as mine was.
https://www.ebay.com.au/itm/333964308343?hash=item4dc1d2ef77:g:zkAAAOSwp2lge09Y

Your MCU library Ver 2.9.9 I loaded with the IDE library manager.
I will run graphictest_kbv.ino and get back to you.

Tom... :grinning: :+1: :coffee: :australia:

Hi,
It ran, colours and scrolling, BUT text is back to front.
Sorry for the quality, but phone is great except for its camera.


Tom.... :grinning: :+1: :coffee: :australia:

So you bought five Shields! I would want all of them to work properly.

Or are you just saying that your Shield "looks" like those photos ?

David.

Hi,
No I didn't buy a five pack, I bought a display with UNO pack, including USB cable.

The Display is not exactly like those, the text on the back is different.
But the front is the same, including the offset, twisted gluing of the display on the PCB.

The;

tftlcd for arduino uno (spiflash)

Is not on the ones I have cited, but the spiflash reference is printed on it.

The link provided by the OP in post #7 would be more relevant if the info I have posted works on his unit. Just the OP hasn't replied.

Tom... :grinning: :+1: :coffee: :australia:

Both your photos are upside down. i.e. Portrait is switch button at the top. Ribbon at the bottom.

You have horizontal mirror. The ID is correctly detected.
I presume that scroll directions were ok. And SOFTWARE SCROLL worked.

To correct horiz mirror. edit MCUFRIEND_kbv.cpp from

    case 0x9340:                //ILI9340 thanks Ravi_kanchan2004 and valmor_jr
        //_lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | REV_SCREEN; //Ravi
         _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS; //my new shield
        goto common_9341;

to

     case 0x9340:                //ILI9340 thanks Ravi_kanchan2004 and valmor_jr
         //_lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | REV_SCREEN; //Ravi
        _lcd_capable = AUTO_READINC | MIPI_DCS_REV1 | MV_AXIS | READ_24BITS | INVERT_SS; //TomGeorge shield
         goto common_9341;

I will wait to hear from other users. Your readreg report is unusual. If there are many of these unusual controllers I will try to distinguish from the regular ILI9340.

Hi,


Hey I'm in Australia, you are the one upsidedown. lol

Tom... :grinning: :+1: :coffee: :australia: :australia: :australia: :australia: :australia:

Hi,
This video clip shows the code running, the display is the "right" way up.

Hope it helps.
Tom... :grinning: :+1: :coffee: :australia:

Thanks for the video. Every penguin screen is horizontally mirrored. The edit suggested in #29 should correct this.

The readGRAM() is not working. You have a readPixel() error.

I can fix that too. e.g. by adding a READ_BGR to _lcd_capable
And I might have a "better" way to fix the SS direction.

Oh. Australians might be upside down. They are not right-to-left !!

David.

Hi, thanks David.

No its you that is back to front... :joy: :rofl: :joy: :rofl: :joy: :rofl:

Tom.. :grinning: :+1: :coffee: :australia:
PS, I'm left handed..

Many thanks for all the help and guidance. I went back to square 1, and was able to get the test pattern to work! The project I'm trying to build had me jump out the LCD_Reset to the digital pin 10.
Knowing the board works I can focus on building up the code to find the issue. I'm used to Visual Basic, so can somewhat follow along the code and hopefully make the adjustments needed.
I really do appreciate the help given folks :slight_smile:

I am pleased that you have got your Shield working. What ID is detected by MCUFRIEND_kbv examples?
If it is 0x9325, 0x9341 then Adafruit_TFTLCD should work fine.

If it is something less common, please copy-paste the output from LCD_ID_readreg.ino like TomGeorge did in #18.

I strongly advise using a Shield as-is. Do not jump-out pins unless there is no alternative.

David.

The ID is coming up as the 0x9329.
I'll be dissecting the code to figure out if I can accomplish the same thing without jumping the pins.

Thanks again

David.

David,
Here is the output I get:
15:55:06.383 -> Read Registers on MCUFRIEND UNO shield
15:55:06.429 -> controllers either read as single 16-bit
15:55:06.466 -> e.g. the ID is at readReg(0)
15:55:06.496 -> or as a sequence of 8-bit values
15:55:06.532 -> in special locations (first is dummy)
15:55:06.573 ->
15:55:06.573 -> reg(0x0000) C0 C0 ID: ILI9320, ILI9325, ILI9335, ...
15:55:06.631 -> reg(0x0004) C4 C4 C4 C4 Manufacturer ID
15:55:06.672 -> reg(0x0009) C9 C9 C9 C9 C9 Status Register
15:55:06.721 -> reg(0x000A) CA CA Get Power Mode
15:55:06.755 -> reg(0x000C) CC CC Get Pixel Format
15:55:06.790 -> reg(0x0061) E1 E1 RDID1 HX8347-G
15:55:06.827 -> reg(0x0062) E2 E2 RDID2 HX8347-G
15:55:06.863 -> reg(0x0063) E3 E3 RDID3 HX8347-G
15:55:06.897 -> reg(0x0064) E4 E4 RDID1 HX8347-A
15:55:06.934 -> reg(0x0065) E5 E5 RDID2 HX8347-A
15:55:06.967 -> reg(0x0066) E6 E6 RDID3 HX8347-A
15:55:07.004 -> reg(0x0067) E7 E7 RDID Himax HX8347-A
15:55:07.044 -> reg(0x0070) F0 F0 Panel Himax HX8347-A
15:55:07.087 -> reg(0x00A1) E1 E1 E1 E1 E1 RD_DDB SSD1963
15:55:07.130 -> reg(0x00B0) F0 F0 RGB Interface Signal Control
15:55:07.180 -> reg(0x00B4) F4 F4 Inversion Control
15:55:07.220 -> reg(0x00B6) F6 F6 F6 F6 F6 Display Control
15:55:07.266 -> reg(0x00B7) F7 F7 Entry Mode Set
15:55:07.303 -> reg(0x00BF) FF FF FF FF FF FF ILI9481, HX8357-B
15:55:07.354 -> reg(0x00C0) C0 C0 C0 C0 C0 C0 C0 C0 C0 Panel Control
15:55:07.408 -> reg(0x00C8) C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 C8 GAMMA
15:55:07.466 -> reg(0x00CC) CC CC Panel Control
15:55:07.504 -> reg(0x00D0) D0 D0 D0 Power Control
15:55:07.560 -> reg(0x00D2) D2 D2 D2 D2 D2 NVM Read
15:55:07.597 -> reg(0x00D3) D3 D3 D3 D3 ILI9341, ILI9488
15:55:07.623 -> reg(0x00D4) D4 D4 D4 D4 Novatek ID
15:55:07.660 -> reg(0x00DA) DA DA RDID1
15:55:07.683 -> reg(0x00DB) DB DB RDID2
15:55:07.712 -> reg(0x00DC) DC DC RDID3
15:55:07.738 -> reg(0x00E0) E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 GAMMA-P
15:55:07.809 -> reg(0x00E1) E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 GAMMA-N
15:55:07.880 -> reg(0x00EF) EF EF EF EF EF EF ILI9327
15:55:07.923 -> reg(0x00F2) F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 F2 Adjust Control 2
15:55:07.991 -> reg(0x00F6) F6 F6 F6 F6 Interface Control
15:55:08.038 ->

First off. Please disable the timestamp on the Serial Terminal.

Thanks for posting the readreg report. Unfortunately not a single register is readable. When a register is "unreadable" it returns the register address e.g. reg(0xD3) returns D3 D3 D3 ...
This applies to other registers too. e.g. reg(0x04) would return 04 04 04 ...
However the Touch Panel is on LCD_D7 and LCD_D6 pins. So b7 and b6 always read as 1 i.e. reg(0x04) returns C4 C4 ...

Anyway, you can't read the ID but you can just try some "likely" ID that might work e.g. tft.begin(0x9329);

Please report back whether this gives some sort of display in graphictest_kbv.ino

Take notes on paper e.g. wrong colours, mirrored text, wrong scroll directions, readPixel() error, ...
Then put all this information in your message. (Or post a video)

I should be able to get your screen working 95%. Which is better than a slap in the face with a cold fish.

David.

Hi, @david_prentice
My odd 2.4TFT died over night, white screen even when I force the ID.
Here is LCD_ID 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 00 93 40	Manufacturer ID
reg(0x0009) 04 04 61 00 00	Status Register
reg(0x000A) 08 08	Get Power Mode
reg(0x000C) 66 66	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 FF 00 FF 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) 40 40 01	Power Control
reg(0x00D2) 40 40 01 40 40	NVM Read
reg(0x00D3) 00 00 93 40	ILI9341, ILI9488
reg(0x00D4) 00 00 00 00	Novatek ID
reg(0x00DA) 00 00	RDID1
reg(0x00DB) 93 93	RDID2
reg(0x00DC) 40 40	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

I was left on for 6 hours, it was hot in one spot of the display, probably where the drive is.

I let it cool for 10hours, it fires up but just backlight, and the driver area gets warm very quickly.
Sound like it has gone to meet its maker... it is an ex-tft... it is no longer pining for the fjords.

Tom... :grinning: :+1: :coffee: :australia: