2.8 tft lcd ILI9341 XPT2046

Hello to all.
I have bought a new TFT like below.
But I don't know how to set up with arduino mega 2056 board?

Does Somebody have any link that could help me?
Very thank you.

Could you post a link to where you got the display?
Also a photo of the whole display?

Here you are.
pic

This display isn't the same but has some helpful info. There is a photo describing what each pin is for, and where each one attaches on a Mega.

@leoncorleone Installation and Troubleshooting is for Problems with the Arduino itself NOT your project. It says so in the description of the section. Therefore I have moved your post here. Please be more careful where you post in future.

You may want to read this before you proceed:-
how to get the best out of this forum

It is quite simple. Connect all 16 data bus + all 5 TFT control signals to the MEGA2560 via level shifters. i.e. twenty one 5V to 3.3V level shifters.

Add a few more level shifters for the SD card. And you are good to go.

The XPT2046 is 5V tolerant but since it shares the SPI bus with the SD card you might as well operate everything from 3.3V as Nature intended.

Oh, software libraries are no problem. Just wire up the hardware first. Then we will show you how to use software.

Life would be MUCH easier with a proper 3.3V Due. Zero level shifters.

There is many libraries for this kind of TFT, which library I could use for this TFT?

If you wire up all the level shifters we can show you how to use the appropriate libraries.

I use arduino software for mega2560 and this tft lcd.
Which library is good for this kind of LCD?
Thank you.

This kind of LCD has 16 pins for data bus,
Other Pins are:
RS: LCD command/data selection
RD: LCD read signal
WR:LCD write signal
CS: LCD chip selection
RST: LCD reset
F_CS: Flash chip selection
SDCS: SDcard chip selection
MISO: SPI Bus data output
MOSI: SPI Bus data input
CLK: SPI Bus clock
T_CS:?
BL: background Light

Is there any example for arduino that could help me? I couldn't find, please help me. thanks.

@leoncorleone, @david_prentice,

I thought there are shields for MEGA and Due for displays with this pinout (CTE, Cold Tears?).
But I am not sure, as I am actually not working with TFT displays. But David knows.

But there are STM32 boards that match this pinout.
You can find some information in GFX_TFT_known_configurations.h and links in the driver header files.

Sorry that I can't help more, as I have currently too many projects started, and then there is Olympics on TV.

Jean-Marc

I can't find my favorite board anymore. Was this one: STM32F407VxT6 Board - LCD wiki
But this is still available:
High Quality STM32F103ZET6 Development Board ARM STM32 STM32F10 Board Compatibility Multiple Extension|extension|extension boardextension arm - AliExpress

The display in #1 and #3 has a 34-pin 17x2 header.

I am not aware of any Mega2560 Adapter Shield for 34-pin.
If one existed I would advise buying it.

Of course the OP can make her own Adapter with a Protoshield pcb
and some 74LVC245A chips.

Personally, I would make an Adapter for a Due because it avoids buying / soldering all of those level converters.

You don't have to use 74LVC245A chips. There are many different ways to convert the 5V MEGA2560 to regular 3.3V logic.

But it would be MUCH easier to just buy a ready-made MEGA2560 Display Shield in the first place.

David.

Yes, I fully agree. But I would prefer a processor board that directly matches the display.
Or, of course, a display that matches the processor board intended for use.

Jean-Marc

I had only guessed. But only some of my Due shields have 2 display connectors, but the smaller one is 16x2. And I don't know the pinout. Schematics may be on an earlier notebook.

Thank you.

Hi, I wanted to do the wiring manuall.
Is there any library and example for arduino to run that.
Very thank you.

Here is the standard wiring that is used by most Mega2560 Display Shields and Mega2560 Adapter Shields.

#elif defined(__AVR_ATmega2560__) && defined(USE_MEGA_16BIT_SHIELD)
//LCD pins   |D15 |D14 |D13 |D12 |D11 |D10 |D9  |D8  |D7  |D6  |D5  |D4  |D3  |D2  |D1  |D0  |
//ATmega2560 |PA7 |PA6 |PA5 |PA4 |PA3 |PA2 |PA1 |PA0 |PC7 |PC6 |PC5 |PC4 |PC3 |PC2 |PC1 |PC0 |
//MEGA2560pin|29  |28  |27  |26  |25  |24  |23  |22  |30  |31  |32  |33  |34  |35  |36  |37  |
//LCD pins   |RD  |WR  |RS  |CS  |RST |
//ATmega2560 |PL6 |PG2 |PD7 |PG1 |PG0 |
//MEGA2560pin|43  |39  |38  |40  |41  |

Please note that your Display MUST have 3.3V logic signals.

It is MUCH easier if you use a Due because it has 3.3V GPIO pins.

David.

I have searched google so much but I couldn't find anything with arduino mega2560.
If somebody has any example of google please help me.
Thanks.