3.5 inch TFT display for Arduino Mega

Hi friends,

I bought one 3.5 inch TFT display with 480×320 pixels. I tried using different libraries including UTFT. All of them does not display anything in my display. I am attaching photos of my display. Someone please give pin details of this display shield. I would like to know the RDX, WRX, RDX, CS, RST, Databus and IM [2:0]. I hope this controller includes touch screen, if so, provide pin details for handling touchscreen also.
Thanks in advance.

Thanking you,

Manu M.

It is easier to read the text printed on the pcb when your photo is the "right way up".

It clearly says that it is a Mcufriend Shield for mega2560.

It has 7 resistor packs. So it is probably 8080-16 interface but it might be 8080-8.

These shields are write-only. You can not read the controller ID. You just have to guess.

It is probably supported by MCUFRIEND_kbv but only as a SPECIAL. (e.g. USE_MEGA_16BIT_SHIELD)

It might be supported by UTFT or Bodmer's TFT_HX8357 library.

David.

david_prentice:
It is easier to read the text printed on the pcb when your photo is the "right way up".

It clearly says that it is a Mcufriend Shield for mega2560.

It has 7 resistor packs. So it is probably 8080-16 interface but it might be 8080-8.

These shields are write-only. You can not read the controller ID. You just have to guess.

It is probably supported by MCUFRIEND_kbv but only as a SPECIAL. (e.g. USE_MEGA_16BIT_SHIELD)

It might be supported by UTFT or Bodmer's TFT_HX8357 library.

David.

Hi,

Thanks for the help. How did you find out this module is read only? I would like to know the pin out.

david_prentice:
It is easier to read the text printed on the pcb when your photo is the "right way up".

It clearly says that it is a Mcufriend Shield for mega2560.

It has 7 resistor packs. So it is probably 8080-16 interface but it might be 8080-8.

These shields are write-only. You can not read the controller ID. You just have to guess.

It is probably supported by MCUFRIEND_kbv but only as a SPECIAL. (e.g. USE_MEGA_16BIT_SHIELD)

It might be supported by UTFT or Bodmer's TFT_HX8357 library.

David.

Hi,

Thanks a lot. I downloaded UTFT from their official website. Now its UTFT_Demo_480x320 is working. I am attaching one picture, in the text is inverted. I don't know how to make it correctly.

Thanks for any help.

Edit: Its not just about text. Everything is inverted.

You can see the pinout by inspecting the driver code for the data bus. PORTA, PORTC.
And by inspecting the example sketch constructor for the control pins.

UTFT has no concept of reading anything.
The shield hardware does not make the TFT_RD pin accessible. So you would not be able to read anyway.

Your GateScan needs inverting. Your colours need inverting.

I suggest that you try every 320x480 controller from the UTFT.h file.
See if one works out of the box. i,e. correct colours

Make notes of the results. Report back. Please use controller names and not model names. i.e. say ILI9486, ILI9481, ... Do not use the Itead or Coldtears brand name

David.

david_prentice:
You can see the pinout by inspecting the driver code for the data bus. PORTA, PORTC.
And by inspecting the example sketch constructor for the control pins.

UTFT has no concept of reading anything.
The shield hardware does not make the TFT_RD pin accessible. So you would not be able to read anyway.

Your GateScan needs inverting. Your colours need inverting.

I suggest that you try every 320x480 controller from the UTFT.h file.
See if one works out of the box. i,e. correct colours

Make notes of the results. Report back. Please use controller names and not model names. i.e. say ILI9486, ILI9481, ... Do not use the Itead or Coldtears brand name

David.

Hi,

Thanks for reply, I tried all drivers available in tft drivers folder. I firstly used R61581. I got ILI9481 and ILI9486 working as same. Now I am checking datasheet r61581 for manually inverting gate scan and colour.

Thanks

If you report the results from each 320x480 with 16-bit interface, I can probably give a guess as to which controller you actually have. UTFT only has ILI9481, ILI9486, R61581 to test.

Bodmer's TFT_HX8357 library is also guesswork. But it supports both Himax and Ilitek controllers.
And will be faster and more intuitive.

David.

david_prentice:
If you report the results from each 320x480 with 16-bit interface, I can probably give a guess as to which controller you actually have. UTFT only has ILI9481, ILI9486, R61581 to test.

Bodmer's TFT_HX8357 library is also guesswork. But it supports both Himax and Ilitek controllers.
And will be faster and more intuitive.

David.

I couldn't feel much difference. However I am posting photo of same slide with 3 controllers.

david_prentice:
You can see the pinout by inspecting the driver code for the data bus. PORTA, PORTC.
And by inspecting the example sketch constructor for the control pins.

UTFT has no concept of reading anything.
The shield hardware does not make the TFT_RD pin accessible. So you would not be able to read anyway.

Your GateScan needs inverting. Your colours need inverting.

I suggest that you try every 320x480 controller from the UTFT.h file.
See if one works out of the box. i,e. correct colours

Make notes of the results. Report back. Please use controller names and not model names. i.e. say ILI9486, ILI9481, ... Do not use the Itead or Coldtears brand name

David.

I tried to change Gatescan(tried to invert). I edited init file

        LCD_Write_COM(0xC0);
 LCD_Write_DATA(0x03);
 LCD_Write_DATA(0x3B);//
 LCD_Write_DATA(0x00);
 LCD_Write_DATA(0x00);
 LCD_Write_DATA(0x00);
 LCD_Write_DATA(0x01);
 LCD_Write_DATA(0x00);//NW
 LCD_Write_DATA(0x43);

and made it like

        LCD_Write_COM(0xC0);
 LCD_Write_DATA(0x07);//changed to invert gate scan
 LCD_Write_DATA(0x3B);//
 LCD_Write_DATA(0x00);
 LCD_Write_DATA(0x00);
 LCD_Write_DATA(0x00);
 LCD_Write_DATA(0x01);
 LCD_Write_DATA(0x00);//NW
 LCD_Write_DATA(0x43);

Still no change. Even if I comment these lines, program works as earlier. But I verified these lines are being executed using Serial.print() function. Thanks for any help.

All three controllers produce the same result. i.e. Invert colours, invert GS. There is no need to post multiple photos.

If the 0xC0 command does not "work", it means that you have not got R61581 or ILI9481.
The ILI9486 has GS in reg(0xB6)

Note that you probably have a Himax controller. This has a different "unlock" mechanism.

But you have got the basic idea. i.e. look up the GS or REV bit in each datasheet. See which one works.

Manufacturer commands are different for each make. GateScan is not always called GS.

David.

david_prentice:
All three controllers produce the same result. i.e. Invert colours, invert GS. There is no need to post multiple photos.

If the 0xC0 command does not "work", it means that you have not got R61581 or ILI9481.
The ILI9486 has GS in reg(0xB6)

Note that you probably have a Himax controller. This has a different "unlock" mechanism.

But you have got the basic idea. i.e. look up the GS or REV bit in each datasheet. See which one works.

Manufacturer commands are different for each make. GateScan is not always called GS.

David.

Hi all,

Thanks a lot. Everything worked fine. I think this module is having ILI9486 controller.

I changed Command 0x20 to 0x21(It acutally turns ON invertion).

Then I used Command 0x36's parameter to display proper orientation.

Thanks all. Thanks a lot.

I have concluded that it is fairly pointless offering advice here.

But for the benefit of other readers.
ILI9481, R61581, HX8357-B GS is in reg(0xC0)
ILI9486, ILI9488 GS is in reg(0xB6)
RM68140 GS is in reg(0xB6) but different bit
HX8357-C, HX8357-D in reg(0xCC)

It is not difficult to wiggle bits as a diagnostic. And find out which controller you actually have.

The User commands for inversion and rotation are available in all MIPI compatible controllers.
Of course, UTFT only needs to be configured for one aspect. You can get away with very inaccurate initialisation. Any subsequent rotation is handled in software.

I suggest that you identify as best you can. Then you can choose a "more efficient" library or simply add the appropriate "TFT Driver" files to UTFT.

David.

Hi all,

Thanks for all help. As far as I know, SD card is the only module which uses the SPI in the display shield. Do I need to make any other pin output and high in order to interface with SD card?

Thanks in advance

The SD card is mapped correctly to the Mega's hardware SPI pins. CS is digital#53 i.e. the default SS pin.

You can try any SD.h examples that you like. You do not need to worry about the TFT.

The SD might work but it will be very unreliable.

ALL these red Mcufriend 2560 shields rely on resistor packs to provide safe signals from the 5V Mega to the 3.3V hardware. It works fine with the TFT and XPT2046. The resistor pack values are too big for the SD.

If you manage to get any SD apps to work, please let us know.

David.

david_prentice:
The SD card is mapped correctly to the Mega's hardware SPI pins. CS is digital#53 i.e. the default SS pin.

You can try any SD.h examples that you like. You do not need to worry about the TFT.

The SD might work but it will be very unreliable.

ALL these red Mcufriend 2560 shields rely on resistor packs to provide safe signals from the 5V Mega to the 3.3V hardware. It works fine with the TFT and XPT2046. The resistor pack values are too big for the SD.

If you manage to get any SD apps to work, please let us know.

David.

Hi,

Thanks for fast reply.

So it is normal in these type of shields right?

When I use Etherenet shield it works fine(with this arduino mega).

I can't even show one bmp file(One bmp file takes approx 300KB which is too big for arduino mega). Is there any other method for accessing SD card with these shield(or showing 3 pictures of this size.)?

Thanks a lot...

Look at your Ethernet shield. I bet that it has a proper 3.3V level shifter chip for the SD.

In theory the SD should have 3.3V logic. However many SD cards are 5V tolerant.
You can replace the SD resistor pack with a smaller value or even 0R at your own risk.

The only way to have 3 images without SD is to use JPEG. It is surprising how well a 32kB JPEG
can be rendered. The GCC Compiler has problems with larger arrays and storing large amounts of data.

Bodmer's TFT_HX8357 library should work with your shield. And Bodmer's JPEG library has some impressive examples.

David.