METHOD AND APPARATUS FOR TOUCH SCREEN NOISE IMMUNITY IMPROVEMENT
COPYRIGHT NOTICE
A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
BACKGROUND OF THE INVENTION
Field of Invention
This invention relates to improving noise immunity in electrical circuits. The invention is more particularly related to the improving noise immunity in touch screen applications. The invention is also more particularly related to the measurement of stylus position and determination of stylus up/down (PU/PD) simultaneously to reduce false position readings. The invention includes the application of known or calculatable voltages to gates of electronic devices to reduce float, and the determination of a max rate of change against which measurements are compared to determine validity.
Discussion of Background
Touch screens are utilized in many modem devices, including computer displays, cash registers, medical equipment, Personal Data Assistants (PDAD s), and other devices. A typical touch screen consists of a 4- wire resistor network constructed from two resistive planes positioned closely together (see Fig. 1, for example). The touch screen can be modeled as two resistors, one resistor for an X plane Rx total ( l + R2), and one resistor for a Y plane Ry total (R3 + R4).
Fig. 2 illustrates a configuration of the touch screen X and Y planes and a stylus (pen) 200. When nothing is in contact with the touch screen a resistance between the X and Y planes is essentially infinite (high impedance, very large value). When the pen (stylus) 200 contacts the touch screen, a connection resistance R5 is formed that connects X and Y planes.
hi addition to forming R5, contact by the pen 200 also divides each of the Rx totaι and Ry totai plane resistors into component resistances (Rl and R2 for the X plane, and R3 and R4 for the Y plane). With the application of known voltage(s) and measurements, appropriately timed, at selected points of the 4 wire resistor network, a position of the stylus relative to each of the X and Y planes may be determined.
Fig. 3 illustrates an example arrangement for polarizing the X plane with a known bias voltage to determine an X position measurement of the stylus. The voltage (V3oo) at the juncture of Rl and R2, 300, corresponds to the point where the stylus makes contact with the touch screen. A comparison of the bias voltage to voltage at 300 (V300/VBIAS) provides a ratio that indicates a position of the stylus in an X direction.
For example, consider a VBIAS of 5v, and a measured voltage of 2v at juncture 300. The measurement of voltage at juncture 300 is performed by connecting resistances R5, R3, R4, and any connection/measurement resistances R (all collectively referred to as connection resistances) to an input of a high impedance amplifier 310. The connecting resistances are part of an electrical path attached to the juncture point 300, and allow the voltage at the high impedance amplifier 310 input to raise to the level of juncture 300. The amplifier output is then measured and the X axis distance is calculated, hi this case the 2N measured a juncture 300 indicate that the stylus is 2/5 ths (2N/5N) of a distance across the X plane.
A second, but similar process is then applied to the Y axis, applying a VBIAS and measuring voltage at juncture point 320. Again, the measured voltage is used to determine a position of the stylus, in this case, a distance across the Y plane. Combined, the X and Y distances provide a position of the stylus or pen.
A third process is applied to determine whether the stylus is up (Pen Up PU) or down (Pen Down PD), referred to as touch detection. As shown in Fig. 4, touch detection is typically performed by applying a known voltage (usually VDD) i series with an internal resistance RΓΝT connected to the touch screen. Voltage changes at extreme ends of the touch screen are detected, the voltage changes due to contact between the X and Y planes through R5. Using Schmidt trigger voltage detectors 410/420 (alternatively, any type of circuit that performs an A/D conversion may be utilized, a hysteresis type device is preferred), the voltage levels are converted to digital logic values 1 and 0 which can be stored in a table or otherwise utilized to trigger an interrupt in a processing unit that detects a change in status from D Stylus is UpD (PU) to D Stylus is downD (PD). i this example, an AND device 430 detects different voltage levels on opposite sides of the X plane, indicating a PD
(pen down) condition (touch detection). Conversely, closely matching voltages indicate a PU condition.
Each of the processes for detecting an X position, a Y position and PU/PD are typically performed at time intervals. Fig. 5 illustrates an example of timing of the various processes for X position 500, Y position 510, and PU/PD 520. However, problems exist, particularly in the area of spikes and inaccurate readings of touch screens that cause false or mcorrect position detections of the stylus or pen.
SUMMARY OF THE INVENTION
The present inventors have realized that noise and spike conditions occur on touch screens for a number of reasons. For example, imperfections on a touch screen surface cause stylus pressure to vary widely, if only momentarily. Furthermore, measurements for position and touch detection are performed at different times, and voltages present at an amplifier detecting position voltages do not necessarily correspond to stylus up or down conditions that are detected during a different time period. Still further, float voltages at a measurement amplifier during times of non contact between a stylus and touch screen may cause widely varying readings.
Roughly described the present invention provides for stable noise immune readings on a touch screen by reading each of X or Y positions of a stylus in conjunction with a PU/PD reading (see Fig. 5 A). The invention includes the provision of a control mechanism to maintain a known or calculatable voltage (a predetermined drift rate) at inputs to measurement devices (Schmidt triggers, A/D's, etc.) during periods of non-contact between a stylus and the touch screen. As soon as the circuit enters a condition where the voltage would otherwise become floating (PU, for example), the control mechanism makes the voltage drift at the predetermined rate, fri one embodiment, as shown in Fig. 5C, a current source i, and capacitor C are connected to the input of a measurement device M, which controls Vi at the input of the measurement device under what would otherwise be a floating or drift condition (when R5 goes to high impedance). The invention also includes a method for detecting erroneous readings by comparing changes in consecutive readings against a maximum rate of change for valid readings.
The invention may be embodied as a circuit for testing a voltage on a test line subject to float conditions, comprising, a detection device having an input coupled to said test line, said detection device configured to detect voltages on said test line, a charging device configured to place an amount of charge on said test line at a rate of change greater than a max rate of change for non floating voltages carried on said test line; and a selection device configured to eliminate detections
by said detection device that are mainly attributable to said charging device. The invention may also be embodied as a method of noise immunity improvement a line being tested (test line), comprising the steps of, reading a first amount of voltage (RVl) present on said test line during a first reading time point, reading a second amount of voltage (RV2) present on said test line during a second reading time point, calculating a difference in voltage between the RN1 and RN2 voltage readings, invalidating the voltage readings if the difference in RN1 and RV2 is greater than a maximum rate of change of valid voltages on said test line, and determining a valid reading based on RVl and RV2 if the difference in RVl and RV2 is less than the maximum rate of change of valid voltages on said test line.
Although particularly well suited for increasing touch screen noise immunity as described herein. It is also envisioned that the techniques described herein may be applied to any electrical circuit making various types of measurements or detections, and in particular any circuits subject to floating conditions.
BRIEF DESCRIPTION OF THE DRAWINGS
A more complete appreciation of the invention and many of the attendant advantages thereof will be readily obtained as the same becomes better understood by reference to the following detailed description when considered in connection with the accompanying drawings, wherein:
Fig. 1 is an illustration of a 4-wire resistor network constructed from two resistive planes;
Fig. 2 illustrates a configuration of a touch screen having X and Y planes and a stylus pen for making contact between the X and Y planes;
Fig. 3 is a circuit diagram of an arrangement for polarizing the X plane of a touch screen and a measurement device for determining an X position of a stylus;
Fig. 4 is a circuit diagram illustrating an arrangement of measurement devices for determining whether a stylus is up or down;
Fig. 5A is a timing chart showing timing for determining an X position, a Y position and a PU/PD position of a stylus;
Fig. 5B is a timing chart illustrating X and Y position readings in conjunction with PU/PD detections according to the present invention;
Fig. 5 C is an embodiment of the present invention illustrating a current source and a capacitor for controlling voltage at an input to a measurement device under floating conditions;
Fig. 6 is an example of a 2-ρlane touch screen constructed with pillars separating the planes and illustrating how one type of spike may occur;
Fig. 7 is an example of pen readings and a spike;
Fig. 8 is a circuit diagram including a measurement circuit according to the present invention;
Fig. 9 is a flowchart illustrating a procedure for making X-Y measurements and detecting stylus up according to the present invention; and
Fig. 10 is an example of X-Y measurements including one valid X-Y measurement and two invalid measurements according to the processes of the present invention.
DETAILED DESCRIPTION OF THE INVENTION
Variations in stylus pressure on a touch screen is one type of condition that can lead to spikes and inaccurate stylus position readings. Variations in stylus pressure can be caused by any of screen imperfections, a screen surface having improper supports, or other problems. For example, when a user writes on a touch screen, and the stylus contacts a divot or other screen imperfection, the stylus may jump or momentarily loose contact with the screen, causing spikes in screen output. Improper supports for the touch screen can cause similar problems. Other conditions causing the stylus to lose pressure, or prevent contact of parallel planes of the touch screen, or any anomaly that prevents or inhibits formation of R5 connection between planes will also cause similar problems.
Referring again to the drawings, wherein like reference numerals designate identical or corresponding parts, and more particularly to Fig. 6 thereof, there is illustrated one example of a touch screen having a support structure that tends to produce spikes when reading a position of a stylus. Fig. 6 includes an X-plane 600, a Y-plane 610, and support mechanisms 620 that maintain a non-contact distance 630 between the X and Y planes. When a stylus 200 is in contact with the upper plane (X-plane 600 in this example), the upper plane is bent toward the lower plane causing formation of the connection resistance R5. However, as motion of the stylus brings the contact position closer to a supporting mechanism, stylus contact with the upper plane, or contact between the planes may be momentarily lost as the stylus sweeps over or near the supporting mechanism (620 in this example). As noted above, any problem causing loss of stylus contact, plane contact, or preventing formation of R5 will cause a similar condition to occur.
Now, referring back to Fig. 3, which illustrates a typical configuration for detecting a position of a stylus on a touch screen plane, it is noted that the input to the measurement amplifier (high impedance amplifier 310), at times of non-contact between the X and Y planes, is in a float condition. The float condition occurs because the input is neither grounded nor does it have an applied voltage. Under float conditions, the input voltage is uncontrolled and can be at any value.
Also referring back to Fig. 5A, it is seen that the X-plane measurement, Y-Plane measurement, and PU PD detections are performed at different times. Thus, if an X or Y plane measurement is made during a float condition (such as when the stylus is inadvertently D bumped D from contact with the touch screen, or other anomaly causing the X and Y planes to loose the connection resistance), the X or Y measurement will be at an unknown value which will most likely result in an inaccurate reading with respect to a current intended position of the stylus.
The PU PD reading may have been made before the stylus loses contact and the X or Y plane readings taken. Thus a false position of the stylus is determined from a floating voltage rather than that controlled as applied through the connection resistance R5. If the PU/PD condition detected after the X and Y positions are measured, the stylus may have already regained contact with the touch screen, and the floating voltages again may be utilized as the stylus position although they represent float voltages.
Fig. 7 is a graph that illustrates example readings of X and Y positions under the above described conditions. A set of proper readings 700 are acquired as a user draws a stylus across the touch screen. However, when a screen imperfection or other anomaly is encountered, the stylus loses pressure or contact causing connection resistance R5 to go to a high impedance state (essentially infinite). Without R5, the input to the measurement amplifier begins to float. The floating voltages are read as an inaccurate X-Y reading 710. At a point after contact is resumed, proper readings 720 continue.
The present inventors have determined that controlling the float voltage and validating X-Y position measurements with simultaneous PU/PD detection can solve the problems associated with inaccurate readings, particularly those due to float conditions.
Fig. 8 illustrates a circuit configuration for controlling float (drift) voltage at the input of a measurement amplifier once stylus pressure is released. An external power source VDD is added which is set to charge capacitor(s) 830 at a known rate. The power source VDD provides enough current to override any input leakage current or other conditions that result in a float or drift condition at the input of the measurement amplifier (ADC) 810. In addition, the amount of current supplied by VDD is small enough that it does not significantly alter any voltages provided from valid X-Y measurements.
The error introduced by the current supplied by VDD through R6 will be compensated (cancelled) during a calibration routine performed by software during initialization of the touch screen. For example, in one calibration arrangement, a procedure tests V300 voltages at predetermined locations on the touch screen. The predetermined locations may be identified by an
x displayed on the touch screen to which a user makes contact at the x, or the locations may be preset in factory test equipment. The V30o voltages retrieved during calibration are then utilized to calibrate x and y distance equations based on subsequent V300 voltages measured to determine pen (stylus) position. This same type of calibration procedure compensates for any affect that the VDD/R6 current may have on the measurement process because the VDD R6 current is present during the calibration procedure.
Thus, the rate at which capacitor(s) 830 are charged is set to control float and not affect x-y measurements. The capacitor(s) 830 include any existing filter capacitors and other capacitances of the circuit, including any added capacitances to adjust the rate of charge. The rate of change of voltage as the capacitors charge is known, i.e., a fixed or calculatable capacitance value, or a charge rate determined via an initialization procedure, for example. The value of charge in the capacitor(s) at any specific time can be detected via software as needed (from readings at amplifier 810, for example).
Thus, when the stylus is in contact with the screen, the voltage of capacitors 830 follow the voltage V300. When the stylus is not contacting the screen, the capacitors voltage drifts at a controlled rate to VDD- hi addition, threshold values of VDD are set such that voltages above or below the thresholds are considered off the screen. For example, an 80% upper threshold indicates that any voltages measured higher than 80% of VDD is an invalid (or PU) measurement.
Although primarily envisioned as operating in positive voltages, the invention may also be practiced with negative voltages. With such an implementation the greater charge rate of the capacitors 830, due to charging from the current source, would be in negative amounts (less than the non-floating voltages applied to the test line under valid operating conditions). However, in either case, the absolute value of the voltage of the charging capacitors would be greater that the absolute value of an acceptable change in the test line voltage under valid operating conditions, both situations detectable via software.
Many solutions are possible for implementing the circuit for controlling a bias current used to charge capacitor(s) 830 during float conditions. One cost effective solution is shown in Fig. 8 which places a resistor R6 between VDD and the input of the measurement amplifier 810. R6 is set at a value much larger than Rl and R2. Since R6 is much higher than Rl and R2, the voltage at the ADC input is practically the same as V300. The capacitor(s) 830 start charging to VDD when the stylus go PU.
Therefore, when the stylus places both planes in contact (or forms resistance R5), since R6 is much larger than Rl and R2 it does not significantly alter any X position measurements or Y
position measurements, using a similar configuration on the Y-plane (current from R6 is DabsorbedO by R2 to ground since R6 is much larger than both Rl and R2). When the stylus pressure is released, R5 goes to a high impedance state, and the capacitor(s) 830 begin charging at a known rate.
The resistors (R6, etc.), and capacitor(s) 830 are chosen so that the highest acceptable (the fastest movements a D normal D user would do) change rate of X/Y position as caused by a userDs use of the stylus has a slower slope than that of the capacitor(s) charge curve. Table 1 illustrates an example set of values for R6 and capacitor(s) 830.
Table 1
By keeping the max users rate of change less than the rate of charge of the capacitor(s), measurements of voltage above the max userDs rate of change (i.e., the capacitor charge rate) can be identified as invalid. In addition to the R6/NDD combination, other solutions for maintaining a known or calculable voltage at a measurement capacitor input include a constant current source, PWM (pulse width modulation), etc.
Fig. 9 is a flowchart showing an example algorithm for making measurements and validating X-Y positions according to the present invention. The method begins after a stylus is down (PD) interrupt is received. At step 900, the method is initialized by setting a stylus-up flag to false and a stylus-up count to zero. At step 910 an X-Y measurement mode is set up to acquire X-l and Y-l (X and Y positions). The setup of the measurement mode consists of configuring hardware and measurement devices such that the X-Y position can be acquired.
For example, the configuration shown in Fig. 8 is set up to measure a distance across an X-plane, and a similar configuration (refers) would be set up to measure the Y-plane. First the X-plane distance would be measured, and then the Y-plane. These measurements are performed by reading the N30Q voltage. These readings are performed by setting silicon switches (via software) to connect measurement voltages and A/D converters (Schmidt trigger, for example). The A/D converted value is read by software and utilized as either an X or Y measurement is made depending on the configuration of electronics and silicon switches set. Seperate X and Y measurement connections are made via the silicon switches which connect the measurement equipment to the
touch screen circuitry (see Fig. 8, for example). After making the X-Y measurements, a wait period of Dt is implemented at step 920.
After a wait of Dt (step 920), a procedure similar to those discussed with respect to step 910 is instituted to acquire positions X-2 and Y-2. X-2/Y-2 represent a new measured position (or voltage of the charging capacitor) of the stylus from X-l/Y-1 to X-2/Y-2 during the wait period Dt.
However, if the X2/Y2 measurement results from the charging capacitor, the measurement is invalid, resulting from a PU condition.
At step 940, a distance of movement between X-l and X-2 is compared against a constant value Kx, and a distance move between Y-l and Y-2 is compared to a constant Ky. Kx and Ky are both selected to represent a DnormalD drawing range. Thus, if during a time period Dt, say for example, .01 seconds, it may be expected that a user would move the stylus approximately in a range of from 0 to 10 millimeters. Thus the value Kx would be set to a value that is equivalent or at some point above a max normal drawing range in the X-direction. Similarly, the value of Ky would be set at or above a max normal drawing range in the Y-direction. In one embodiment, both Kx and Ky values are simply one acceptable DnormalD drawing range K.
If both of the drawing ranges are within the acceptable DnormalD drawing range (Kx and Ky), then the stylus-up flag is set to zero, and a confirmed position X-Y of the stylus is set to X-l, Y-l (see step 950). However, if either X-2 or Y-2 are outside of the acceptable DnormalD drawing range, then the stylus-up counter is incremented by one at step 960.
At step 970, after updating the stylus-up count, the stylus-up is tested to determine if it is greater than a predetermined number the stylus-up counts which is set to indicate a stylus-up condition. The stylus-up count threshold, in this example (at step 970) is set to four. However, other stylus-up count thresholds may be implemented. For example, higher stylus-up count thresholds may be required if, for example, the measurement and testing performed in steps 910 .. 940 are done at a more rapid pace or some other reason for which additional redundancy is needed. Conversely, a lower threshold may be acceptable if those steps are performed at a slower rate or under conditions where less redundancy is needed. The values of K (Kx/Ky) and the stylus-up count for determining a stylus-up condition (stylus-up threshold) may be adjusted on these or any other factors including speed of the testing environment, a particular application on which the touch screen is being applied, or other design considerations.
If the stylus-up threshold testing at step 970 indicates a stylus-up condition, a stylus-up flag is set to true at step 980. If the stylus-up threshold testing at step 970 indicates that the stylus is not
yet up, the process is repeated starting at step 910 with measurement of new X-l and Y-l positions that are acquired.
Alternatively, a second wait Dt may be implemented (not shown, roughly equivalent to the Dt at step 920), compensated for additional time required for steps 930, 940, 950/960, and 970 to be performed, and the values X-2/Y-2 can be substituted for X-l/Y-1, and a second measurement starting at step 930 to get new values for X-2 and Y-2 may be performed.
The actual configuration or flow for performing the functions of the present invention should not be restricted to the flow diagram of Fig. 9. Other embodiments and different flows may also be implemented which perform the same basic requirements of getting two measurements (consecutive measurements, for example), comparing these measurements to a rate of change to determine whether or not a stylus is up or not. Alternatively, consecutive, 3rd, and 4th (or more) measurements may be utilized to provide for noise reduction. For example, on a touch screen, measured voltages representing a straight line will not be completely linear because of noise. Therefore, instead of 2 points, 4 or 5 consecutive measurements are made and the average of the consecutive measurements (or a median line between each of the consecutive measurements) is used as the actual line drawn.
However, the core idea is unchanged, and if the change of position is more rapid than what a user is capable (or more rapid than a user would likely make a drawing on the touch screen), then those measurements are considered invalid because it is likely to be indicative of circuit conditions not related to the position of the stylus (i.e., one of a voltage spike or other floating condition at the point where that position is measured (input of measurement amplifier 310, for example), or the capacitor(s) 830 being charged by a VDD R current source, for example).
In the flow diagram of Fig. 9, five consecutive invalid measurements (considered a stylus-up condition), are a benchmark that indicates that the stylus is not in contact with the touch panel by the user's choice. When this occurs, the stylus-up flag is set to true and the X-Y sampling (position determination) is stopped until another stylus is down (PD) interrupt is received.
Table 2 provides an example implementation of a software program for reading a touch location. As with other figures and example implementations presented herein, Table 2 is not intended to limit the present invention and is provided as one example implementation. The example is not intended as an executable or compilable code, but as an example of program flow consistent with the present invention.
Table 2
#define kPenupCount 8 ttdefine kNumSamples 5
#define kMaxTouchDeviationX 5 #define kMaxTouchDeviationY 5 void
ReadTouchPoint ( TOUCH_POINT pTouchPoint) (
WORD sampleX [kNumSamples] ;
WORD sampleY [kNumSamples] ;
ULONG i;
ULONG counter = 0;
BOOL ok = FALSE;
BOOL isPenϋp; do
{ isPenϋp = FALSE;
// X samples
PolarizeForXReading ( ) ;
ReadX(ssampleX[0] ) ; for (i = 1; i < kNumSamples; i++)
{
ReadX(ssampleX[i] ) ; if (abs (sampleX[i] - sampleX[i - 1])
> kMaxTouchDeviationX) { isPenϋp = TROE: break; } }
// Y samples if {! isPenϋp)
{
PolarizeForYReading ( ) ;
ReadY(&sampleY[0] ) ; for (i = 1; i < kNumSamples; i++)
{
ReadY ( ssampleY [i] ) ; if (abs ( sampleY [i] - sampleY [i - 1)
> kMaxTouchDeviationY) { isPenϋp = TRUE; break; } } } if (isPenϋp)
{ counter++; // The current sample is a pen-up candidate } else
{ ok = TRUE; // The sample is good.
} while (!ok && counter < kPenupCount); if (counter >= kPenupCount)
// Pen up else
// Pen down
Fig. 10 illustrates three sets of example measurements made and tested according to the process/method illustrated in Fig. 9. The three sets of measurements correspond to (X-l/Y-1, X-2/Y-2) 1000, (X-3/Y-3, X-4/Y-4) 1010, and (X-5/Y-5, X-6/Y-6)1020. The first measurement set, (X-l/Y-1, X-2/Y-2) is shown as having been acquired a Dt time period apart (via steps 910 and 930, for example). Comparing X-l/Y-1 to X-2/Y-2, the differences between the X-positions and
Y-positions indicated thereby are less than the values Kx and Ky, therefore indicating a valid position measurement at point X- 1/Y- 1 , since the gap between X-2/Y-2 and X- 1/Y- 1 is within the acceptable DnormalD drawing range (either reading (X1,Y1 or X2,Y2) or a combination of all readings may be utilized as the valid point, however, the last reading is considered to be the most accurate. However, in the following measurements 1010 and 1020, the stylus has apparently been released and then comes back in contact with the touch panel momentarily. This causes the capacitor at the measurement amplifier input to start charging, and the gap between the samples on both measurements will be larger than K because the charge rate of the capacitors has been set to be larger than a max speed of user inputs. Thus, these points will be considered to be invalid (indicating a stylus-up condition) .
Following the method/process presented in Fig. 9, during the three X-Y samples shown in Fig. 10, a position of the stylus is kept constant at X-l/Y-1 since only the first sample is valid. The stylus position will remain at X-l/Y-1 until either a second valid sample is determined, or a stylus-up condition (after 4 or 5 invalid measurements) and the stylus-up flag is set to true (i.e., stylus position on screen does not change until next valid measurement). In practice, the samples acquired will be very close together and any sample skip due to invalid measurements will not be noticeable, particularly when compared to invalid values that occur without applying the present invention.
Table 3 provides example code of a program for reading touch locations that includes a filtering routine. The filtering is applied independently to both the group of X samples and the group of Y samples. The resulting samples from this filtering are then used as the final X and Y coordinates.
Table 3 z#define kPenupCount 8
#define kNumSamples 5
#define kMaxTouchDeviationX 5
#define kMaxTouchDeviationY 5
// Median filter - sorts the samples and returns the central one static WORD
DADMedianFilter(WORD *sample, WORD length)
{
WORD counter;
WORD temp;
BOOL inversions = TRUE; while (inversions)
{ inversions = FALSE; for (counter = 0; counter < length - 1; counter++)
{ if (sample[counter] > samp!e[counter + 1])
{ temp = sample[counter + 1]; sample[counter + 1] = sampIe[counter]; sample[counter] = temp; inversions = TRUE;
} } } return sample[Iength / 2];
} void
ReadTouchPoint(PTOUCH_POINT pTouchPoint)
{
WORD sampleXfkNumSamples];
WORD sampleY[kNumSamples];
ULONG i;
ULONG counter = 0;
BOOL ok = FALSE;
BOOL isPenUp; do
{ isPenUp = FALSE;
// X samples PolarizeForXReadingO; ReadX(&sampleX[0]); for (i = 1; i < kNumSamples; i++)
{ ReadX(&sampleX[i]); if (abs(sampleX[i] - sampIeXp - 1]) > kMaxTouchDeviationX)
{ isPenUp = TRUE; break; }
}
// Y samples if (ϋsPenUp)
{ PolarizeForYReadingO; ReadY(&sampIeY[0]); for (i = 1; i < kNumSamples; i++)
{ ReadY(&sampleY[i]); if (abs(sampleY[i] - samp!eY[i - 1]) > kMaxTouchDeviationY)
{ isPenUp = TRUE; break; } } } if(isPenUp)
{ counter++; // The current sample is a pen-up candidate
} else
{ ok = TRUE; // The sample is good.
} } while (!ok && counter < kPenupCount); if (counter >= kPenupCount) {
// Pen up
} else
{
// Pen down pTouchPoint->xVaIue = MedianFiIter(sampIeX, kNumSamples); pTouchPoint->yVa!ue = MedianFiIter(sampleY, kNumSamples);
}
Although the present invention has been described with respect to touch screen technology, the teclmiques and processes described herein may be applied to any circuits that exhibit floating conditions.
Portions of the present invention may be conveniently implemented using a conventional general purpose or a specialized digital computer or microprocessor programmed according to the teachings of the present disclosure, as will be apparent to those skilled in the computer art.
Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art. The invention may also be implemented by the preparation of application specific integrated circuits or by interconnecting an appropriate network of conventional component circuits, as will be readily apparent to those skilled in the art.
The present invention includes a computer program product which is a storage medium (media) having instructions stored thereon in which can be used to control, or cause, a computer to perform any of the processes of the present invention. The storage medium can include, but is not limited to, any type of disk including floppy disks, mini disks (MDDs), optical discs, DND, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, NRAMs, flash memory devices (including flash cards), magnetic or optical cards, nanosystems (including molecular memory ICs), RAID devices, remote data storage/archive/ warehousing, or any type of media or device suitable for storing instructions and/or data. Stored on any one of the computer readable medium (media), the present invention includes software for controlling both the hardware of the general purpose/specialized computer or microprocessor, and for enabling the computer or microprocessor to interact with a human user or other mechanism utilizing the results of the present invention. Such software may include, but is not limited to, device drivers, operating systems, and user applications. Ultimately, such computer readable media further includes software for performing the present invention, as described above.
Included in the programming (software) of the general/specialized computer or microprocessor are software modules for implementing the teachings of the present invention, including, but not limited to, setting measurement modes for X and Y planes of a touch screen, adjusting bias currents and/or VDD, comparing measurements, stylus detection (PU PD), and the display, storage, or communication of results according to the processes of the present invention.
Obviously, numerous modifications and variations of the present invention are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims, the invention may be practiced otherwise than as specifically described herein.