I have a DMC analog resistive touchscreen interfacing with a TSC2003 via the traditional 4-wire interface. A touch will result in the TSC2003 generating an interrupt. The interrupt handler subsequently wakes a touchscreen task which is responsible for retrieving touch coordinates and passing them to the application layer for processing.
The touchscreen task is table driven. Each table entry identifies the function to perform (i.e., read). There is a one (1) millisecond delay between reads. Once all functions have been performed, the task goes back to sleep. All reads are performed in 12-bit mode. X/Y/Z drivers are turned on prior to reading X/Y/Z coordinates. PD1-PD0 in each command is set to "11" to disable the interrupt, turn the internal reference on and turn the ADC on. The last function performed is to read VB1. I am not concerned about the voltage reading, but use the command to set PD1-PD0 to "10" to enable the interrupt, leave the internal reference on and turn the ADC off.
The following has been observed:
- X/Y/Z values appear in the first data byte. D3-D0 in the second data byte are always 0x0F.
- Values in the first data byte will occasionally be reported as 0x00 or 0xFF.
- A "mechanical finger" is used to repeatedly touch the screen at a fixed location. X/Y coordinates are usually within five (5) pixels of each other. However, a "flyer" will get reported during testing that is no where near the fixed press location.
Our application requires that touches be accurately reported. "Flyers" are unacceptable.
I've tried reading X/Y/Z a second time (i.e., debouncing). I discard any readings where the X/Y measurements are 0x00/0xFF or the difference between the two readings is 10 pixels or greater. This has greatly eliminated false readings. However, I still run into instances where a flyer occurs with both sets of measurements appearing as valid touches.
Questions:
- The TSC2003 lists the sampling dynamics throughput rate as 50 ksps (e.g., 0.00002 seconds). Are there any timing requirements on how quickly measurements must be taken following the interrupt? I am obviously limited by the speed of the I2C bus and my self imposed millisecond delay between reads.
- Once the X/Y/Z drivers are activated, are they ever turned off?
- Could my reading of VB1 be affecting the measurements of the next interrupt. Moving the setting of PD1-PD0 to "10" to the second Z measurement didn't help.
- I am not concerned about conserving power. My understanding is that the internal reference is only needed for battery and aux input measurements. Are X/Y/Z measurements affected by the presence/absence of the internal reference voltage?
- I have implemented pressure measurement using the second equation as it only requires X, Y and Z1 measurements. My mechanical finger exerts a fairly consistent pressure on the screen. However, the calculated value of RTOUCH varies greatly as the finger is moved to various parts of the touchscreen. Could this be affected by D3-D0 always being 0x0F? When I change to 8-bit mode, the measurements do not change. Does the 4096 constant get changed to 256?
I've read the datasheet several times. This shouldn't be all that hard. I must be overlooking something simple.
Thanks in advance for everyone's time and trouble.