GLCD with touch

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
gonzogonzo
Posts: 56
Joined: Mon Aug 11, 2014 3:57 pm
Has thanked: 18 times
Been thanked: 17 times
Contact:

GLCD with touch

Post by gonzogonzo »

Hello,

I would like to simulate a GLCD with touch but I do not understand how simulating touch; i have download example "GLCD4.3touch" and use and simulation GLCD is ok but touch is for for me a "black hole".
There is someone can help me with refering to this example?

Thank in advance and sorry for my poor english.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: GLCD with touch

Post by medelec35 »

Hi gonzogonzo,
Can you post a link to the example please.
It saves people searching for it.

Martin
Martin

gonzogonzo
Posts: 56
Joined: Mon Aug 11, 2014 3:57 pm
Has thanked: 18 times
Been thanked: 17 times
Contact:

Re: GLCD with touch

Post by gonzogonzo »

Hi medelec35,

thanks for fast reply and here is the link:http://www.matrixtsl.com/wikiv7/index.p ... efc6ae87a6.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: GLCD with touch

Post by medelec35 »

I see what you mean,
I could not get the touch side to simulate either.
Martin

gonzogonzo
Posts: 56
Joined: Mon Aug 11, 2014 3:57 pm
Has thanked: 18 times
Been thanked: 17 times
Contact:

Re: GLCD with touch

Post by gonzogonzo »

medelec35 wrote:I see what you mean,
I could not get the touch side to simulate either.
Thanks medelec35,
i am working on prototype...

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: GLCD with touch

Post by medelec35 »

Was it that specific gLCD or will any be ok so long as touch part works?
I have found an example with a different controller that works and can upload it if that will help?
Unless it's specifically XPT2046 then I have not got a working example that will simulate touch.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GLCD with touch

Post by Benj »

Hello,

The touch sensor IC basically allows you to overlay the display with a resistive film. When this film is touched you get a resistance on the X and Y axis that the touch controller IC can read to determine the position of the touch.

It looks like the XPT2046 component does not simulate but should work fine on the real hardware.

gonzogonzo
Posts: 56
Joined: Mon Aug 11, 2014 3:57 pm
Has thanked: 18 times
Been thanked: 17 times
Contact:

Re: GLCD with touch

Post by gonzogonzo »

Hi medelec35 and Benj,

sorry for my reply delay but i am not at home;
my hardware use gLCD Ili9341 320X240 and touch XPT2046 and now i have made a prototype (with PIC) that work very well with software write in Flowcode V7 (only a little problem with touch solved with a sorte of antidebounce).
Problem is that there is not touch simulation and this delay development software; but all is working...
If You can explain like i can made simulation of touch would be great!

Thank again

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: GLCD with touch

Post by AbhijitR »

Hello!

I am trying to use the 2.8 in SPI touch screen display (display chip is ILI9341 and inbuilt touch panel is XPT2046) along with PIC18F46K22, my first doubt is am I using the correct PIC chip to work with this display for a very basic display operation, no graphics for the moment, only display and touch.

I connected the PIC and only the display as per the information provided in the component properties, with few print screen macros, it worked well after few changes and notes from the forum.

Later I tried to connect the touch panel connections with the PIC as per the properties window and then nothing works, as if the PIC is freeze, I really do not understand what's going wrong, is it some connection problem or something to do with the SPI settings for the touch panel, I am puzzled.

I am using FC8, V8.1.1.11

Thank you.

Regards
Abhi

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GLCD with touch

Post by Benj »

Hi Abhi,

Can you attach your program that demonstrates the issue and we will investigate for you.

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: GLCD with touch

Post by AbhijitR »

Hi! Ben
good afternoon

Following you reply, I am attaching the FC as well the picture of the display for your knowledge, do let me know if you need some more information.

Thank you, hear you soon.

Regards
Abhi
Attachments
Test_02-08-2019.fcfx
(12.86 KiB) Downloaded 237 times
2.8in_SPI_Display.jpg
2.8in_SPI_Display.jpg (74.35 KiB) Viewed 8895 times

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: GLCD with touch

Post by AbhijitR »

Hello! Ben
Good morning

Any update regarding my previous post, do you think some problems with the chip settings or component properties.

Thank you, hear you soon.

Regards
Abhi

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: GLCD with touch

Post by AbhijitR »

Hello! Team

Following my previous chats regarding my doubt about the display with touch which I am not able to work with, if someone could correct or should I drop the plan to use it.

Thank you.

Regards
Abhi

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: GLCD with touch

Post by AbhijitR »

Hello! Team (Ben)

Following my previous post regarding the touch screen (using XPT2046 component) I progressed further with the working, but again got stuck up, only one coordinate is displayed on the screen (probably Y axis) I do not understand why the other coordinate is not able to read, I thought the chip (XPT2046) on the display might be the problem so I replaced that with new one but still the same result, I also installed the FC 8.2.1.13 but still the same.

Is it possible for someone to check if there is some problem with the flowchart or something wrong with the component macro or I need to buy a new display assuming the display is faulty.

NOTE: the LED A0 in the loop switch ON when the touch panel/screen is touched and is switched OFF too once the finger is removed, but only one coordinate value is read.

Hope to receive some answer from experts.

Thank you.

Regards
Abhi
Attachments
Test_17-08-2019.fcfx
(14.09 KiB) Downloaded 191 times

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: GLCD with touch

Post by AbhijitR »

Hello!

Any help possible on my previous post regarding the touch screen.

Thank you

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GLCD with touch

Post by Benj »

Hello Abhi,

Have you tried the change the SPI bus channel for the XPT2046 to Software and see if this makes any difference. Aha I see you've now managed to get past the lockup. Any idea what was causing this?

Have you got a schematic or datasheet for the touch sensor on the display. Just to check if the various configuration settings are correct.

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: GLCD with touch

Post by AbhijitR »

Hello! Ben

Finally!, thanks for the reply, your word is final, always, many many thanks for the suggestion, yes now I can read both the coordinates, for your knowledge, as you said I just changed the bus setting to "software" and kept the same pins as before and it works.

Previously I made a mistake in the connections of the touch panel, I connected the T_DO pin of the display to MOSI and T_DIN to MISO, exact reverse, it took me some time to realize my mistake.

For my knowledge can you brief what made the touch screen work by changing the setting to software, it was like "Abracadabra" and it worked.

I have attached the datasheet of that chip which I replaced assuming the previous one was damaged, but now I think it should have worked, but its okay, it is better late then never, I am happy the touch panel is working, I will explore some more and hope it will work without any trouble.

Humbly Thank you again.

Regards
Abhi
Attachments
XPT2046.pdf
(881.75 KiB) Downloaded 197 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GLCD with touch

Post by Benj »

Hi Abhi,

The software channel simply uses standard I/O pins to re-create the bus. It is slower then the hardware peripheral and requires the microcontroller to sit and create the bus.

The hardware channels use the internal peripheral to create the bus. It will run without the microcontroller having to think about it but there is obviously something not quite right with this. Maybe the default SPI mode is slightly off and needs changing. I can look into this.

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: GLCD with touch

Post by AbhijitR »

Hi! Ben

Many thanks for the explanation, it was so easy to understand then reading the datasheet, :D .

Okay, regarding the investigation about the SPI for XPT2046, I had a thought in my mind, correct me if I am wrong,
there are 3 MACRO's, Initialize, ReadCoord and SampleSensor, and all work well, except the read coordinate (0) which is for X axis, in my opinion the truth table (table 4 and may be 5 in the datasheet, page 15) which control/command the reading function of the X axis is missing something, you are the correct person to know, I just had a thought in my mind.

I am sure you will find the answer thank you Ben and hear you soon.

Regards
Abhi

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: GLCD with touch

Post by AbhijitR »

Hello! Ben

Any news/update regarding the XPT2046 SPI to read the x coordinate using hardware instead of software channel.

Thank you.

Regards
Abhi

Post Reply