XPT2046 Touch with ILI9341 Display

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
Alan_37
Posts: 118
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 34 times
Been thanked: 16 times

XPT2046 Touch with ILI9341 Display

Post 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 2572 times
here is what I get on the serial output
Ser.png
Ser.png (100.66 KiB) Viewed 2572 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

Alan_37
Posts: 118
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 34 times
Been thanked: 16 times

Re: XPT2046 Touch with ILI9341 Display

Post by Alan_37 »

hello,

Anyone can help with this? please

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: XPT2046 Touch with ILI9341 Display

Post 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.

jgu1
Posts: 602
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 495 times
Been thanked: 132 times

Re: XPT2046 Touch with ILI9341 Display

Post by jgu1 »

Hi!

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

Br Jorgen.

Alan_37
Posts: 118
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 34 times
Been thanked: 16 times

Re: XPT2046 Touch with ILI9341 Display

Post 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.

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: XPT2046 Touch with ILI9341 Display

Post 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?

Post Reply