ST7796 4" TFT Touchscreen problem ?

All that relates to the H/W
Post Reply
User avatar
Electroguard
Posts: 272
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 54 times
Been thanked: 127 times

ST7796 4" TFT Touchscreen problem ?

Post by Electroguard »

Does anybody have a 4" TFT Touchscreen working correctly ?

I have two 4" TFT Touchscreen displays, which I think are ST7796, but the only markings I can see are 4.0" TFT SPI 480x320 V.10
They are pin compatible with the smaller ILI9341 displays (with the first 5 pins of the main group labelled as "touch"), and they both display correctly with Annex32 WiFi BLE CAN 1.43.5 configured for ST7796.

But the touchscreens don't calibrate correctly.
When running touch.calib, the first green cross displays at the top left, but neither of the modules will register a touch on that mark, nor anywhere else on that side of the display, whereas a touch to the opposite side may register.
So the modules display correctly, and can register touch, but not in the correct locations.

Because both 4" modules have the same problem, and ILI9341 modules behave correctly, it suggests there may be an ST7796 driver problem... unless someone is actually using a 4" ST7796 without any problems ?
cicciocb
Site Admin
Posts: 401
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 90 times
Been thanked: 290 times
Contact:

Re: ST7796 4" TFT Touchscreen problem ?

Post by cicciocb »

Hi Robin,
Have a look at this post.
You should remove a diode from the display

[External Link Removed for Guests]
User avatar
Electroguard
Posts: 272
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 54 times
Been thanked: 127 times

Re: ST7796 4" TFT Touchscreen problem ?

Post by Electroguard »

Thank you Francesco, very well spotted - I'll bridge out the diode tomorrow and am quite hopeful it should resolve the problems, cos the symptoms seem identical.
User avatar
Electroguard
Posts: 272
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 54 times
Been thanked: 127 times

Re: ST7796 4" TFT Touchscreen problem ?

Post by Electroguard »

Nope, bridging out D1 did not make any difference (and MISO is not shorted to GND as some have reported)
The Annex32 TFT startup screen displays correctly, but when running touch.calib it only responds to one side of the screen - and its exactly the same for both modules.
Ah well, easy come easy go... better off with a smaller display which has touchscreen capability to take advantage of the GUI components.
User avatar
Electroguard
Posts: 272
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 54 times
Been thanked: 127 times

Re: ST7796 4" TFT Touchscreen problem ?

Post by Electroguard »

My bad, forgot to also bridge J1 which did the trick... and now 4" touchscreen is luvverly.
cicciocb
Site Admin
Posts: 401
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 90 times
Been thanked: 290 times
Contact:

Re: ST7796 4" TFT Touchscreen problem ?

Post by cicciocb »

Perfect, I'll add this info in the documentation.
User avatar
Electroguard
Posts: 272
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 54 times
Been thanked: 127 times

Re: ST7796 4" TFT Touchscreen problem ?

Post by Electroguard »

Perhaps add the missing syntax entry for touch.z while you're at it.
PPANTHER256
Posts: 6
Joined: Wed Mar 10, 2021 5:45 am
Has thanked: 1 time
Been thanked: 3 times

Re: ST7796 4" TFT Touchscreen problem ?

Post by PPANTHER256 »

I have the same Problem with an ILI9488 TFT.
It seems that the Driver does not tristate the MISO line (it is always driven low, by the display), so do not connect the MISO-line to the Display. You only need it, when you want to save the screen content to a file.
The other solution ist do insert a tristate driver and activate it with the CS of the display (one quarter of a 74HC125)
Pin1 to the CS of the display, pin2 to MISO of the TFT and pin3 to the common MISO line.
PPANTHER256
Posts: 6
Joined: Wed Mar 10, 2021 5:45 am
Has thanked: 1 time
Been thanked: 3 times

Re: ST7796 4" TFT Touchscreen problem ?

Post by PPANTHER256 »

Al little addendum:
Its wise to isolate any of your SPI devices in the suggested way from the bus, as there are four drivers in one 74HC125.
(by the way, the SDcard adapter module with active buffers shows the same Problem, but this is due to bad design, the MISO line buffer is always on
but should be tied to the CS of the sd-card)
If you plan to use the SPI-bus at higher frequencies (>10MHz) use a 74LVC125 for buffering, the 74HC125 might be to slow.
cicciocb
Site Admin
Posts: 401
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 90 times
Been thanked: 290 times
Contact:

Re: ST7796 4" TFT Touchscreen problem ?

Post by cicciocb »

Probably the best, it this case is to disconnect the MISO signal as the read from the display is not a strong requirement.
Post Reply