I was reading this article today about interfacing a microcontroller with a 4-wire resistive touch screen, and found myself a little bit confused.
The article suggested this could be done by using four digital i/o pins and two ADC inputs. Two of the four touch screen interface wires are for the X-axis and two are for the Y-axis. The pairs are operated on independently (e.g. the other pair is tristated by the microcontroller).
The operation performed by the microcontroller on each pair is to apply Vcc to one wire and apply Gnd to the other. The wire to which Gnd is applied is also connected to an ADC input on the microcontroller, and the voltage read is proportional to the position being touched along that axis.
What I don't understand is why the ADC would ever read anything but 0V since the microcontroller is driving that wire to Gnd. How does this work?
Here is the schematic from the article for reference:
