sorry for the delay, i wrote the reply twice and for twice the reply was not submitted i eventually got .... off...
now that i have regained some patience i will write the post again..
the microcontroller is a pic16f887, the touch screen is a nintendo ds touch screen.
i have found many websites which describe how they connect this tousch screen to their micros, such as
**broken link removed**
the problem is that they are identical to mine and still my code doesn't work properly. if one looks at the link i gave, they use 4 pull down resistors, but for what? at least two of the pins of the touch screen can be kept low all the time. unfortunately though i am pretty sure of what i am saying, my circuit doesn't work properly... (i have tested the algorithm thoroughly and i am sure that the latter works properly)... the problem is with the electronics of the interface circuit i believe...
first of all when i connect the touch screen such that the VDD is supplied by the micro, the touch screen sinks to much current and the voltage on the pin drops from 5V to 4.2V, so not only i may damage the micro, but also i will never get the maximum value from my adc( i.e 255 for 8 bit mode)..
secondly, the circuit only works if half of the circuit is connected, i mean if i connect the other pull down resistor, the circuit will start giving values instead of between 0-255, to 0-128 approximately...
this is my algorithm, with respect to the following link:
touchpanel.jpg picture by bouvett - Photobucket
first i power x+, and read from y+, then i power y+ and read from x+... when i read i set the pin as an analogue input and when i power i set it as a digital output...
the algorithm must be right as else it wouldn't give me good results.. the problem is when i connect the x- or y- to ground through the resistors as shown.. when i run the algorithm with only one pull down resistor, everything works well, when i connect the other one, the analogue voltage output falls by half, so it must be an analogue electronics problem for sure..
so i would like to ask whether there's anyone who has tried such a circuit so that he/she can give some feedback on the topic.. thanks