Page 1 of 1

ST7796 4" TFT Touchscreen problem ?

Posted: Sat Aug 14, 2021 6:41 pm
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 ?

Re: ST7796 4" TFT Touchscreen problem ?

Posted: Sun Aug 15, 2021 3:10 pm
by cicciocb
Hi Robin,
Have a look at this post.
You should remove a diode from the display

https://github.com/Bodmer/TFT_eSPI/issues/849

Re: ST7796 4" TFT Touchscreen problem ?

Posted: Sun Aug 15, 2021 4:15 pm
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.

Re: ST7796 4" TFT Touchscreen problem ?

Posted: Sun Aug 15, 2021 5:26 pm
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.

Re: ST7796 4" TFT Touchscreen problem ?

Posted: Sun Aug 15, 2021 5:59 pm
by Electroguard
My bad, forgot to also bridge J1 which did the trick... and now 4" touchscreen is luvverly.

Re: ST7796 4" TFT Touchscreen problem ?

Posted: Sun Aug 15, 2021 6:33 pm
by cicciocb
Perfect, I'll add this info in the documentation.

Re: ST7796 4" TFT Touchscreen problem ?

Posted: Sun Aug 15, 2021 6:52 pm
by Electroguard
Perhaps add the missing syntax entry for touch.z while you're at it.

Re: ST7796 4" TFT Touchscreen problem ?

Posted: Mon Sep 13, 2021 5:59 am
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.

Re: ST7796 4" TFT Touchscreen problem ?

Posted: Mon Sep 13, 2021 9:07 am
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.

Re: ST7796 4" TFT Touchscreen problem ?

Posted: Mon Sep 13, 2021 11:58 am
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.