Page 1 of 1

XPT2046 Touch with ILI9341 Display

Posted: Tue Aug 03, 2021 10:27 am
by Alan_37
Hi

I am experimenting with the ili9341 display but the touch part seems to have bug
I just made this very simple program to test the touch.
FC.png
FC.png (136.82 KiB) Viewed 2614 times
here is what I get on the serial output
Ser.png
Ser.png (100.66 KiB) Viewed 2614 times
there seem to be 4 problems

1, Sample sensor always return 1 even if the screen is not touched
2, X coordination never gives output value
3, Y gives the X and Y coordination ( if I go from left to right value change also changes if I go from up and down )
4, Pressure never goes to 0 even if the display is not touched

I am using STM23F407

Any help please

Re: XPT2046 Touch with ILI9341 Display

Posted: Sat Aug 14, 2021 10:20 am
by Alan_37
hello,

Anyone can help with this? please

Re: XPT2046 Touch with ILI9341 Display

Posted: Mon Aug 16, 2021 3:12 pm
by BenR
Hello,

I've used this touch device recently but I'll have another look for you.

Your program looks a bit odd you call initialise and then sample with no loop. Is the initialise being called again and again. Ideally you should only call it once and then you can call sample again and again.

Re: XPT2046 Touch with ILI9341 Display

Posted: Mon Aug 16, 2021 5:01 pm
by jgu1
Hi!

I used the component for aprox. a week ago, and it work for me also..

Br Jorgen.

Re: XPT2046 Touch with ILI9341 Display

Posted: Mon Aug 16, 2021 10:49 pm
by Alan_37
Hi Ben

This is a test macro, the loop is outside I removed the init from the loop
but I get the same results, if you say it's working fine at your side then maybe
I got a faulty display.

Re: XPT2046 Touch with ILI9341 Display

Posted: Mon Aug 16, 2021 11:04 pm
by BenR
Have you tried changing the analogue mode property setting?

Maybe also worth trying a software based SPI bus or playing with the prescale to make sure the SPI isn't going too fast?