- This topic has 7 replies, 4 voices, and was last updated 10 years, 6 months ago by SHAH DISHANT H..
-
AuthorPosts
-
February 1, 2013 at 8:02 am #2097ANJUSHAParticipant
hai,
i want to know how to interface a touch screen to arm7, in which inbuilt ADC is present.
February 28, 2013 at 4:29 pm #9201AJISH ALFREDParticipantHi Abiram,
Your touch screen should have two analog output pins, X-cordinate & Y-cordinate. Read the value of both using two seperate ADCs, and the result is the location (X,Y) of a touch.
March 2, 2013 at 4:33 am #9215ANJUSHAParticipantthank you sir…….
sir can you give an idea of the logic involved in writing code for interfacing a touch screen to lpc2148.
example.like for a motor ,logic is presented as on and off…two cases.similarly for touch screen
can you tell me sir.
March 2, 2013 at 5:16 pm #9220AJISH ALFREDParticipantHi Abiram,
Good question. You asked for the logic only, while most people ask for a working code staraight away. I’m impressed. If you have the perfect logic, you can make your controller to do any task. Code is nothing but a representation of your logic, right?
Regarding your question,
The aim is to sense a touch and find its co-rdinates (X,Y) on the touch screen.
You have to connect the X and Y probs to seperate ADCs.
You must initialize the ADC in such a way that it should perform continuous digital conversion.
Now your code should do the following continuously
– read the ADC1
– read the ADC2
If there is no touch the values will be the maximum. If they are 10-bit ADC, 1023 will be the maximum value. This value will drop suddenly whenever you touch the screen. That’s how you sense a touch.
Now the location of the touch is the reading from both the ADC at that moment.
I can represent the logic as follows
step1: initialize the adc
step2: read adc1
step3: if adc1 value less than a threshold value, say 550 then go to step6, otherwise go to next step
step4: read adc2
step5: if adc2 value less than a threshold value, then go to next step, ortherwise go to step2
step6: read and store the value of adc1 as X cordinate and ADC2 as Y cordinate of the touch
Any further doubts, please ask.
March 3, 2013 at 2:45 pm #9226ANJUSHAParticipanthello sir,
Thank you sir.your explaination is perfect sir.i am trying according to the steps given sir.now i want to define 6 functions to control 6 operations in a system.so sir could you tell me depending on factor of touch screen ,we should divide (x,y) values .so that 6 functions are to be controlled through touch screen……….likewise ex: if we take keypad we had 0 to 9 digits.so 9 functions can be controlled on selecting the digits.the same logic has to be implemented using touch screen.how sir?can you tell me.
March 4, 2013 at 8:12 am #9234AJISH ALFREDParticipantK. Assume your touchscreen is divided into 6 areas, like 6 switches. You select them and find in which range the X and Y varies in that particular area.
Use these values to check in which area the touch has been sensed.
April 13, 2014 at 6:02 am #11541karthikParticipantHi,
I have written a code such that the o/p values of touch screen are converted to digital values and transmitted through UART so that I can easily note down the touch screen digital values of x-y coordinates . When monitoring the digital values of ADC keeps varying a lot!!! Please help.. Any suggestions?
I have connected the pins of touchscreen directly to my controller. Is there any necessity of any external circuit?
Thanks in advance.May 27, 2014 at 3:03 am #11772SHAH DISHANT H.ParticipantHi,
What is the variation you are getting ?
Tell the range. actually the step size for LPC2148 is very small so you can expect a variation.
-
AuthorPosts
- You must be logged in to reply to this topic.