2.4" TFT SPI 240X320 v1.3


I want to make a project that uses 2.4" TFT SPI 240x320. I have an arduino ATmega here. I want to implement the touchscreen of the display. Can someone help me accomplish this project?

can you give a link to the specific display?
it looks similar to displays which use the ILI9341 display controller, e.g. Hiletgo 240X320 Resolution 2.8" SPI TFT LCD Display Touch Panel ILI9341
be careful, although such displays can be powered from 5V the display logic is 3.3V and can be damaged if connected directly to a UNO, Mega, etc which use 5V logic

if it is the ILI9341 display controller you can use the TFT_eSPI graphics library

Which ATmega? 328 or 2560?

Does ATmega328 have enough memory for it? (just a question)

the one I have here is ATmega 2560

https://www.aliexpress.com/item/1005004433031032.html
idk where to find the exact display that I have

I'm kinda new to this display thing that's why I want to learn more how to use it.

probably not - I would never try to attach such a display to a ATmega328
using level shifters to convert the ATmega328 5V logic to the display 3.3V logic causes too many problems

Thank you for your answer :slightly_smiling_face:

I would not attempt to connect such a display to a ATmega2560 - the need for level translators makes problems
I recommend you get a microcontroller which uses 3.3V logic, e.g. ESP32, ESP8266, Arduino Due, RP2040, etc

the link to the display in post 6 states the driver is ILI9341 / ST7789 which are different devices - is there anything written on the rear of the PCB which indicates which driver it is?
get a 3.3V logic micro, connect the display to its SPI interface and try the Adafruit_ILI9341 library

It's not as bad as horace's colleague says.
The driver is indeed an ILI9341, so you can use the proven Adafruit_ILI9341 library. Conversion of logic voltage levels is also not a problem. For this you need 5 pcs of 2k2 resistors and 5 pcs of 3k3 or 4k7 resistors. Instead of resistors forming voltage dividers, you can also use a 4050 circuit. I advise you to rely on the video, where everything is explained in detail: https://www.youtube.com/watch?v=4DtuOeeYHys
The video is about connecting to the UNO, but the corresponding PIN change will probably not be a problem for you ?

Even ignoring the logic level conversion issues, the display you show does not have the IC (U1) that is needed on a touch display.

The screen also needs to be one that has the touch stuff built in, and with U1 not fitted, I doubt it has.

Of course you are right. The module shown in the attached forography does not have a touch function.
And I have a question for you: did you run such a module exactly in such a version on the photo, that is, without touch and in version 1.3 ?

Never checked what the 'version number' is on the back of the display.

Buy one and see if it works, then report back.

O.K. :slight_smile:
I don't need to buy because I recently picked them up (2 pieces) and have a problem with them. It looks like they only support 240x240 px and mix colors. A bit strange - I admit. I'll come back tomorrow and post photos. Greetings

I have a similar 240X320 Resolution 2.8" SPI TFT LCD Display Touch Panel ILI9341 labeled V1.2 with the U1 chip fitted - the touch functionality works OK using the XPT2046_touch_library


Here's how 2 modules of an identical display, differing in design (and the absence or not of touch functionality, which probably shouldn't matter), work, connected to an Arduino Nano, with the Adafruit_ILI9341 library. Both display the same image generated by a test program known to everyone modified to stop at that particular image. As you can see, the display without the described version shows everything correctly (according to the program), while the version 1.3 display only supports 240x240 resolution, swaps red for dark blue (and vice versa) and yellow for light blue, and rotates the image 90 degrees. I originally assumed that I was using an outdated library, but I checked that I have the latest one installed, version 1.6.1.
Do you know where to look for the cause ?