Problem with 2.4 TFT Shield

Hello! So, I tried to make a project on an Arduino Uno, using a 2.4 TFT Shield (2.4'' LCD Shield for Arduino (Red) - Optimus Digital) and libraries Adafruit GFX, TFTLCD and TouchScreen. But, the project got too big for an Uno, so I bought an Arduino Mega 2560 (Placa dezvoltare, AZ-Delivery, Mega 2560 R3, 102 x 53 x 15 mm, Compatibil Arduino - eMAG.ro). Although on the Uno the code worked without any issue(except the fact I couldn't load all of it), on the Mega the exact same code gets the white screen. Is the LCD incompatible with the Mega, or what is the problem and how can I solve it?

Update: When I check its ID, it says 0x0, so it seems the Mega doesn't even recognize it

Your link claims that the TFT controller is SPF5408 or ILI9341.
Genuine Adafruit_TFTLCD does not support SPF5408.

What controller do you actually have ?
Hint read tft.readID() on the Uno.

Genuine Adafruit_TFTLCD does not support Mcufriend shields on a MEGA2560.

Life is simpler if you install MCUFRIEND_kbv via the IDE Library Manager.
The examples will report the controller ID.
The shield should just "work out of the box" on Uno, Leo, Zero, Due, Mega, ...

David.

Ok, sorry for late answer, I had some issues with the Uno. When I run the examples from mcufriend_kbv, it says that ID is 0x0, so something isn't alright. But, when I run the examples from Adafruit TFT, it says that the ID is 0xC0C0, so maybe it helps

Please paste the output from LCD_ID_readreg.ino (which is in the examples)

Adafruit_TFTLCD is not reading the ID either !!

David.

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 82 27 04	Display Control
reg(0x00B7) 00 77	Entry Mode Set
reg(0x00BF) 00 02 02 02 02 02	ILI9481, HX8357-B
reg(0x00C0) 00 00 00 00 00 00 00 00 00	Panel Control
reg(0x00C8) 00 00 20 31 42 13 04 00 00 00 00 00 00	GAMMA
reg(0x00CC) 00 06	Panel Control
reg(0x00D0) 00 A4 B2	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

You have an 0xE300 controller. This is not supported by v2.9.9-Release.

It is supported by the current Beta (master) on GitHub. You would have to delete the v2.9.9-Release directory. Then download ZIP from GitHub. Install from ZIP.

I have been meaning to issue a new Release for the last year or two !
This would be a good opportunity to get on with it !!
Then you don't have to mess around with ZIPs.

David.

1 Like

Yes, with the beta library works. Thank you very much!

And as a suggestion when you want to improve something at the library, the setRotation is upside down comparing to Adafruit TFT. The setRotation(2) from Adafruit TFT is equivalent to setRotation(4) from mcufriend_kbv and vice-versa, and the same with 1-3. It's not a big deal, because if you change the number from setRotation is exactly the same, but maybe you wanted to know.
Or second case, they are good but the rotation was that way on Adafruit TFT because of "compatibility" with 0x8357.

No, I don't want to change the rotations. It is Adafruit that is inconsistent.

Native "Portrait" is ribbon cable at bottom. Any off-screen Touch icons at bottom. USB socket at top. Touch icons are "right way up"

Native "Landscape" is ribbon cable at right. Any off-screen Touch icons at right. USB socket at left.

If you prefer to rotate your Arduino 180 degrees Portrait you just use setRotation(2). i.e. all the Arduino pin numbers upside down.

If you prefer to rotate your Arduino 180 degrees Landscape you just use setRotation(3). i.e. all the Arduino labels upside down.

David.

p.s. there is no setRotation(4)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.