circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 114 January 2000
Reach Out and Touch
Designing a Resistive Touchscreen


Taking the 5-wire route

Burr-Brown has the ADS7845 device for a 5-wire touchscreen interface. Like its cousin the ADS7843, it connects to your microprocessor via a simple serial interface. It too uses a 12-bit ADC. The pinouts of the chips are nearly identical. The 5-wire device uses one of the two spare analog inputs available on the 4-wire device to accommodate the fifth wire input.
Another way to interface to a 5-wire touchscreen is to do it all with a PIC. As shown in Figure 6, this method results in a low parts count. The thing that makes this design easy is the fact that we can control the four corners of the bottom plane with the PIC’s digital drivers and run the sense-plane wire directly into the PIC’s on-chip ADC. Thus eliminating the need for fancy analog multiplexing using external FETs.

(Click here to enlarge)

Figure 6—Four of the PIC’s digital lines are used to provide x and y voltage gradients. A single analog input is used to determine the contact point by measuring the pick-off voltage in both the x and the y planes.


As you can see, we used four PIC I/O lines (RB2–5) to connect to the four corners, labeled UL (upper left), LL (lower left), UR (upper right), and LR (lower right). To generate a left-to-right voltage gradient, the PIC sets UL and LL to a low (0 V) and sets UR and LR high (5 V). It then performs an ADC conversion, reading AN0.
The presence of a voltage greater than a few counts indicates a touch. The bleed resistor R5 in Figure 6 pulls the ADC input low, so we have no problem knowing that a touch has occurred.
To generate a top-to-bottom voltage gradient, the PIC simply sets UL and UR to high and LR and LL to low. Note that LL is always low and UR is always high. Although we could hardwire them to ground and +5 V respectively, it’s better to allow the PIC to do this to preserve balanced levels on all four corners.
Once the PIC has secured readings for the x and y directions, it can adjust for offset and scale factors, and determine the x and y positions. The PIC I used was a PIC16C71 with an 8-bit ADC, which works for applications where positional accuracy is not important. Newer members of the PIC family have better accuracy and would improve this design.

Look Ma, No Processor

If you want a simple interface to a 4-wire glass and you can live with a predefined output format, the TriTech TR88L811 chip makes it possible to go from the glass to a serial bitstream with only one chip. If you have an extra serial channel available and only need 10 bits of positional accuracy, then this may be the way to go.
The TR88L811 is designed for standalone applications and requires only a 1.8432-MHz crystal and an RS-232–level shifter to form a complete interface that you can attach to a spare PC COM port.
Figure 7 shows an example circuit that steals its power from the PC’s COM port. The TriTech device scans the touchscreen continuously and sends a serial data packet out of its TxD pin when a touch is detected. The data packet, sent at 19,200 bps, contains five bytes—a header and two bytes each of x and y position. The position is resolved to 10 bits, which is adequate for most applications.

(Click here to enlarge)

Figure 7—The processor in this interface is actually the Tritec TR88L811, a dedicated 4-wire touchscreen interface device. It handles all of the touchscreen scanning, touch detection, and message formatting chores. The 3-volt device was originally developed for the PDA industry.


If a touch is maintained, the chip will send data out at a rate of approximately 200 coordinate pairs per second. The main advantage of this device is that it requires no firmware. As long as you can live with the 10-bit resolution and can work with its output format, then it’s a turnkey solution.
You can buy the raw touchscreen glass from several manufacturers. I’ve had a good experience dealing with the Bergquist Company and I’ve also been successful interfacing to glass made by Elo and Microtouch.