GLCD with touch

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

Moderator: Benj

gonzogonzo
Posts: 27
Joined: Mon Aug 11, 2014 3:57 pm
Has thanked: 8 times
Been thanked: 6 times
Contact:

GLCD with touch

Postby gonzogonzo » Mon Jul 09, 2018 10:23 am

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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8412
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2401 times
Been thanked: 3434 times
Contact:

Re: GLCD with touch

Postby medelec35 » Mon Jul 09, 2018 11:28 am

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

Martin
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

gonzogonzo
Posts: 27
Joined: Mon Aug 11, 2014 3:57 pm
Has thanked: 8 times
Been thanked: 6 times
Contact:

Re: GLCD with touch

Postby gonzogonzo » Mon Jul 09, 2018 11:58 am


User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8412
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2401 times
Been thanked: 3434 times
Contact:

Re: GLCD with touch

Postby medelec35 » Tue Jul 10, 2018 3:51 pm

I see what you mean,
I could not get the touch side to simulate either.
These users thanked the author medelec35 for the post:
gonzogonzo (Tue Jul 10, 2018 4:06 pm)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

gonzogonzo
Posts: 27
Joined: Mon Aug 11, 2014 3:57 pm
Has thanked: 8 times
Been thanked: 6 times
Contact:

Re: GLCD with touch

Postby gonzogonzo » Tue Jul 10, 2018 4:08 pm

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

Thanks medelec35,
i am working on prototype...

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8412
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2401 times
Been thanked: 3434 times
Contact:

Re: GLCD with touch

Postby medelec35 » Tue Jul 10, 2018 4:11 pm

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.
These users thanked the author medelec35 for the post:
gonzogonzo (Sun Jul 15, 2018 9:34 am)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

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

Re: GLCD with touch

Postby Benj » Thu Jul 12, 2018 2:53 pm

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.
These users thanked the author Benj for the post:
gonzogonzo (Sun Jul 15, 2018 9:34 am)
Rating: 5.26%
 

gonzogonzo
Posts: 27
Joined: Mon Aug 11, 2014 3:57 pm
Has thanked: 8 times
Been thanked: 6 times
Contact:

Re: GLCD with touch

Postby gonzogonzo » Sun Jul 15, 2018 9:34 am

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: 72
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 90 times
Been thanked: 15 times
Contact:

Re: GLCD with touch

Postby AbhijitR » Thu Aug 01, 2019 10:43 am

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: 14295
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4394 times
Been thanked: 4123 times
Contact:

Re: GLCD with touch

Postby Benj » Thu Aug 01, 2019 3:46 pm

Hi Abhi,

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

User avatar
AbhijitR
Posts: 72
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 90 times
Been thanked: 15 times
Contact:

Re: GLCD with touch

Postby AbhijitR » Fri Aug 02, 2019 12:44 pm

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.87 KiB) Downloaded 23 times
2.8in_SPI_Display.jpg
2.8in_SPI_Display.jpg (74.35 KiB) Viewed 1297 times

User avatar
AbhijitR
Posts: 72
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 90 times
Been thanked: 15 times
Contact:

Re: GLCD with touch

Postby AbhijitR » Tue Aug 06, 2019 4:13 am

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: 72
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 90 times
Been thanked: 15 times
Contact:

Re: GLCD with touch

Postby AbhijitR » Thu Aug 08, 2019 6:51 am

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: 72
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 90 times
Been thanked: 15 times
Contact:

Re: GLCD with touch

Postby AbhijitR » Sat Aug 17, 2019 5:09 pm

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.1 KiB) Downloaded 18 times

User avatar
AbhijitR
Posts: 72
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 90 times
Been thanked: 15 times
Contact:

Re: GLCD with touch

Postby AbhijitR » Mon Aug 19, 2019 10:41 am

Hello!

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

Thank you

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

Re: GLCD with touch

Postby Benj » Mon Aug 19, 2019 1:02 pm

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.
These users thanked the author Benj for the post:
AbhijitR (Mon Aug 19, 2019 5:57 pm)
Rating: 5.26%
 

User avatar
AbhijitR
Posts: 72
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 90 times
Been thanked: 15 times
Contact:

Re: GLCD with touch

Postby AbhijitR » Mon Aug 19, 2019 1:50 pm

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
(885.82 KiB) Downloaded 24 times
These users thanked the author AbhijitR for the post:
Benj (Mon Aug 19, 2019 4:02 pm)
Rating: 5.26%
 

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

Re: GLCD with touch

Postby Benj » Mon Aug 19, 2019 4:05 pm

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: 72
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 90 times
Been thanked: 15 times
Contact:

Re: GLCD with touch

Postby AbhijitR » Mon Aug 19, 2019 5:56 pm

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: 72
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 90 times
Been thanked: 15 times
Contact:

Re: GLCD with touch

Postby AbhijitR » Fri Aug 23, 2019 2:40 am

Hello! Ben

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

Thank you.

Regards
Abhi