# Patent

## Title
Touch detection techniques for capacitive touch sense systems

## Abstract

A technique for recognizing and rejecting false activation events related to a capacitance sense interface includes measuring a capacitance value of a capacitance sense element. The measured capacitance value is analyzed to determine a baseline capacitance value for the capacitance sensor. The capacitance sense interface monitors a rate of change of the measured capacitance values and rejects an activation of the capacitance sense element as a non-touch event when the rate of change of the measured capacitance values have a magnitude greater than a threshold level, indicative of a maximum rate of change of a touch event.

## Background
RELATED APPLICATIONS
This application is a continuation of U.S. application Ser. No. 13/047,620 filed Mar. 14, 2011, now U.S. Pat. No. 8,248,084 which is a continuation of Ser. No. 13/047,270 filed Mar. 14, 2011, which is a continuation of Ser. No. 11/729,818 filed Mar. 28, 2007, now U.S. Pat. No. 8,040,142, issued Oct. 18, 2011, which claims priority to U.S. Provisional Patent Application No. 60/788,127, filed Mar. 31, 2006, all of which are hereby incorporated by reference in their entirety.


TECHNICAL FIELD
This disclosure relates generally to capacitance sensing techniques, and in particular but not exclusively, relates to improved touch detection techniques for capacitance sense interfaces.
BACKGROUND INFORMATION
Capacitance sensors are used to implement a variety of useful functions including touch sensors (e.g., touch pad, touch dial, touch wheel, etc.), determining the presence of an object, accelerometers, and other functions. FIG. 1A illustrates a conventional capacitance measurement circuit 100 including a relaxation oscillator, a reference clock, and a frequency comparator. The relaxation oscillator is coupled to drive a charging current (IC) in a single direction onto a device under test (“DUT”) capacitor. As the charging current accumulates charge on the DUT capacitor, the voltage across the capacitor increases with time as a function of IC and its capacitance C. Equation 1 describes the relation between current, capacitance, voltage and time for a charging capacitor.

CdV=ICdt  (Equation 1)

The relaxation oscillator begins by charging the DUT capacitor from a ground potential or zero voltage and continues to accumulate charge on the DUT capacitor at a fixed charging current IC until the voltage across the DUT capacitor reaches a reference voltage (Vref). At Vref, the relaxation oscillator allows the accumulated charge to discharge or the DUT capacitor to “relax” back to the ground potential and then the process repeats itself. The relaxation oscillator outputs a relaxation oscillator clock signal (RO CLK) having a frequency (fRO) dependent upon capacitance C of the DUT capacitor, charging current IC, a discharge time td, and Vref, as described in equation 2 below.




  
    
      
        
          f
          RO
        
        =
        
          
            (
            
              
                C
                ·
                
                  
                    V
                    ⁢
                    
                      
                    
                    ⁢
                    ref
                  
                  
                    I
                    C
                  
                
              
              +
              
                t
                d
              
            
            )
          
          
            -
            1
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          2
        
        )
      
    
  




If capacitance C of the DUT capacitor changes, then fRO will change proportionally according to equation 2. By comparing fRO of RO CLK against the frequency (fREF) of a known reference clock signal (REF CLK), the change in capacitance ΔC can be measured. Accordingly, equations 3 and 4 below describe that a change in frequency between RO CLK and REF CLK is proportional to a change in capacitance of the DUT capacitor.

ΔC∝Δf, where  (Equation 3)

Δf=fRO−fREF.  (Equation 4)

The frequency comparator is coupled to receive RO CLK and REF CLK, compare their frequencies fRO and fREF, respectively, and output a signal indicative of the difference Δf between these frequencies. By monitoring Δf one can determine whether the capacitance of the DUT capacitor has changed.
FIG. 1B illustrates another capacitance sensing technique using a charge transfer mechanism. FIG. 1B illustrates a conventional capacitance measurement circuit 101 including three switches 105 with control terminals φ0, φ1, and φ2, and summing capacitor 110 having a capacitance CSUM, and an analog to digital (“ADC”) converter 115. Capacitance measurement circuit 101 may be used to sense changes in a DUT capacitor 120 having a changing capacitance CDUT.
During operation, capacitance measurement circuit 101 operates as follows to sense capacitance changes on DUT capacitor 120. First, summing capacitor 110 is discharged to a ground potential by asserting control terminal φ0 to open circuit switch SW0 and by asserting control terminal φ1 to close circuit switch SW1. Once discharged to ground, integrating capacitor 110 is disconnected from ground by asserting φ1 to open switch SW1. Then, DUT capacitor 120 is charged to the supply voltage VS by asserting φ0 to open circuit switch SW0 and asserting φ2 to close circuit switch SW2. Once DUT capacitor 120 charges to the supply voltage VS, the charge on DUT capacitor 120 is transferred onto summing capacitor 110 and distributed between the two capacitors. Charge transfer occurs by asserting φ1 and φ2 to open circuit switches SW1 and SW2, respectively, and asserting φ0 to close circuit switch SW0.
The above stages of charging DUT capacitor 120 and transferring the charge onto summing capacitor 110 are repeated a fixed number times causing the voltages of nodes N1 and N2 to ramp with time as illustrated in line graphs 130 and 135, respectively. After a fixed number of consecutive charging stages and charge transferring stages, ADC converter 115 samples the final voltage on node N2. The capacitance CDUT is determined based on the output of ADC converter 115 and is proportional to the voltage at node N2 after the final charge transfer stage.
Because the capacitance deviation of a capacitance sense switch due to a finger press is small compared to the underlying capacitance of the switch itself, the above two capacitance sensing techniques can be susceptible to external noise, interference, or other environmental factors. For example, parasitic capacitances may couple to the user interface, electromagnetic interference (“EMI”) may disrupt capacitance measurements and control signals, deviations in operating temperature can cause thermal expansions and dielectric variations that affect capacitance measurements, user error can result in malfunctions, and so forth. These environmental factors can often result in disruptive capacitance deviations that are larger than the capacitance changes induced by a finger interaction with the capacitance sense interface. Accordingly, a reliable capacitance sense interface and control system should account for some or all of these sources of noise.



BRIEF DESCRIPTION OF THE DRAWINGS
Non-limiting and non-exhaustive embodiments of the invention are described with reference to the following figures, wherein like reference numerals refer to like parts throughout the various views unless otherwise specified.
FIG. 1A is a block diagram illustrating a conventional capacitance sensor.
FIG. 1B is a block diagram illustrating a conventional capacitance sensor.
FIG. 2 illustrates a user finger interacting with a capacitance sensor, in accordance with an embodiment of the invention.
FIG. 3A is a functional block diagram illustrating a capacitance sensor circuit, in accordance with an embodiment of the invention.
FIG. 3B is a block diagram illustrating a radial slider interface, in accordance with an embodiment of the invention.
FIG. 3C is a block diagram illustrating a linear slider interface, in accordance with an embodiment of the invention.
FIG. 4 is a chart illustrating a scanning technique of use with a multi-sensor capacitance sense interface, in accordance with an embodiment of the invention.
FIG. 5 is a functional block diagram illustrating a system for improved capacitive touch sensing, in accordance with an embodiment of the invention.
FIG. 6 is a chart illustrating a baseline drift compensation technique for improved capacitive touch sense operation, in accordance with an embodiment of the invention.
FIG. 7 is a chart illustrating a finger on startup detection technique for improved capacitive touch sense operation, in accordance with an embodiment of the invention.
FIG. 8 is a chart illustrating an activation with hysteresis technique for improved capacitive touch sense operation, in accordance with an embodiment of the invention.
FIG. 9A illustrates typical capacitance profiles for a finger event and an electrostatic discharge (“ESD”) event on a capacitance sensor, in accordance with an embodiment of the invention.
FIG. 9B is a chart illustrating an ESD compensation technique for improved capacitive touch sense operation, in accordance with an embodiment of the invention.
FIG. 10 is a flow chart illustrating a process for improved capacitive touch sensing using a capacitance sense interface, in accordance with an embodiment of the invention.
FIG. 11 illustrates a demonstrative integrated circuit for implementing an embodiment of the invention.



DETAILED DESCRIPTION
Embodiments of a system and method for improved capacitive touch sense detection are described herein. In the following description numerous specific details are set forth to provide a thorough understanding of the embodiments. One skilled in the relevant art will recognize, however, that the techniques described herein can be practiced without one or more of the specific details, or with other methods, components, materials, etc. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring certain aspects.
Reference throughout this specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
FIG. 2 illustrates a user finger 205 interacting with a capacitance sensor 200, in accordance with an embodiment of the invention. In short, when a conductive object, such as user finger 205, is moved into proximity with capacitance sensor 200, its capacitance is increased above its baseline capacitance, resulting in a measurable capacitance change. By monitoring capacitance sensor 200 for deviations ΔC from its baseline capacitance, sensor activations can be determined and registered within software. Of course, a user interaction with capacitance sensor 200 is not limited to a finger. Other conductive objects may be used to interact with capacitance sensor 200 including, a stylus, a pen, or any other conductive object.
By grouping a plurality of capacitance sensors 200 into an array of capacitance sensors, such as a radial slider array, a linear slider array, a touch pad array, or the like, a variety of capacitance sense interfaces may be implemented. For example, capacitance sensor arrays may be used to implement user interfaces of a variety of products including: door switches, white goods (e.g., kitchen appliances), laptop computers, desktop computers, personal digital assistants (“PDAs”), portable music players (e.g., MP3 players), wireless telephones, cellular telephones, radios, or the like. Capacitance sensor arrays may also be used to implement position sensors.
FIG. 3A is a functional block diagram illustrating a capacitance sensor circuit 300, in accordance with an embodiment of the invention. The illustrated embodiment of capacitance sensor circuit 300 includes capacitance measurement circuitry 305, an input/output (“I/O”) interface 310, and a capacitance sense interface 315. I/O interface 310 links capacitance sense interface 315 to capacitance measurement circuit 305. In one embodiment, I/O interface 310 is a configurable analog interconnect between capacitance measurement circuitry 305 and capacitance sense interface 315. For example, I/O interface 310 may be configured to sequentially scan multiple capacitance (“CAP”) sensors within capacitance sense interface 315 to time-share capacitance measurement circuitry 305. Once connected to an individual CAP sensor within capacitance sense interface 315, capacitance measurement circuitry 305 can measure its capacitance to determine whether its capacitance has deviated sufficiently from its baseline capacitance such that the activation event should be registered in software as a user activation (i.e., acknowledged in software such that an appropriate action or function is executed).
Capacitance measurement circuitry 305 may be implemented using a variety of different capacitance measurement circuits, such as capacitance measurement circuit 100, capacitance measurement circuit 101, or otherwise. During operation, capacitance measurement circuitry 305 may output a signal or value that is representative of the capacitance of a selected CAP sensor. In one embodiment, this value may include a count of a number of clock cycles from a gated reference clock that transpired during a single charge and discharge cycle of the selected CAP sensor. This value or count may subsequently be analyzed by software to determine whether the measured capacitance deviation should be registered (i.e., acknowledged) by software as a valid user activation event.
FIGS. 3B and 3C illustrate examples of capacitance sense interface 315, in accordance with an embodiment of the invention. FIG. 3B illustrates a radial slider interface 320 having twelve individual CAP sensors 325. FIG. 3C illustrates a linear slider interface 330 having seven CAP sensors 325. It should be appreciated that radial slider interface 320 and linear slider interface 330 may include more or less CAP sensors than illustrated. Furthermore, radial slider interface 320 and linear slider interface 330 are only intended as example embodiments of capacitance sense interface 315. Other configurations or arrays of CAP sensors may be implemented.
FIG. 4 is a chart 400 illustrating a scanning technique for use with capacitance sensor circuit 300 to monitor capacitance sense interface 315 for user activations, in accordance with an embodiment of the invention. Chart 400 plots capacitance values for CAP sensors 325 versus time. The capacitance values plotted along the y-axis of chart 400 are values determined by capacitance measurement circuitry 305 that are representative of a measured capacitance of CAP sensors 325. In one embodiment, the capacitance values are clock cycle counts gated by relaxation oscillator circuitry included within capacitance measurement circuitry 305. In one embodiment, the capacitance values are the output of an analog-to-digital (“ADC”) converter (e.g., ADC 115).
Each trace S0, S1, S2, S3, S4 represents a measured capacitance value associated with a corresponding one of CAP sensors 325 (only five traces are illustrated so as not to clutter the drawing). Each CAP sensor 325 is sampled in sequence by capacitance measurement circuitry 305 one time during each scan cycle (e.g., scan cycles 1, 2, 3, 4, and 5 are illustrated). For example, CAP sensor 325A (represented by trace S0) is sampled at times T0, T6, T8, T10, T12 . . . , CAP sensor 325B (represented by trace S1) is sampled at time T1, CAP sensor 325C (represented by trace S2) is sampled at time T2, and so on. Traces S0 to S4 have been staggered vertically for clarity; however, if CAP sensors 325 are physically identical in size and orientation, traces S0 to S4 may in fact overlap with minor deviations due to localized variations in the capacitances of each CAP sensor 325.
During operation, the baseline capacitance of CAP sensors 325 may drift due to a variety of environmental factors, such as temperature changes, dynamically changing parasitic capacitances, localized disturbances, electromagnetic interference (“EMI”), or otherwise. This drift is illustrated by the wandering traces S1 to S4. Furthermore, chart 400 illustrates a user activation of CAP sensor 325A sometime between the samplings of CAP sensor 325A at time T6 and time T8. In one embodiment, when the measured capacitance value of CAP sensor 325A crosses the activation threshold, the user activation of CAP sensor 325A is registered or acknowledged by software or hardware logic coupled to capacitance measurement circuitry 305.
FIG. 5 is a functional block diagram illustrating a system 500 for improved capacitive touch sensing, in accordance with an embodiment of the invention. The illustrated embodiment of system 500 includes capacitance sensor circuit 300, touch sense logic 505, application logic 510, and I/O device 515. The illustrated embodiment of touch sense logic 505 includes a startup logic component 520, a baseline logic component 525, a hysteresis logic component 530, an electrostatic discharge (“ESD”) component 535, and an interpolation logic component 540.
During operation, capacitance measurement circuit 305 outputs a signal 550 being indicative of a capacitance or capacitance change of a selected one of CAP sensors 325 within capacitance sense interface 315. In one embodiment, capacitance measurement circuit 305 includes a relaxation oscillator and signal 550 is representative of a frequency change Δf or a period change ΔP of the oscillator circuit. In one embodiment, signal 550 is the output of a gated clock signal that forms a counter. The number of gated clock cycles counted by the counter is then related to the capacitance on the selected CAP sensor 325 in a similar manner as the frequency change Δf or the period change ΔP is related to the capacitance on the selected CAP sensor 325, discussed above.
Touch sense logic 505 may be implemented entirely in software or firmware (e.g., machine readable instructions), entirely in hardware (e.g., application specific integrated circuit, field programmable gate array, etc.), or some combination of both. Touch sense logic 505 analyzes signal 550 to compensate for various environmental factors (e.g., temperature drift), filter noise, reject false activation events (e.g., reject ESD events), interpolate higher resolution from capacitance sense interface 315, and compensate for various other user interactions with the capacitance sense interface 315. Touch sense logic 505 analyzes signal 550 to determine whether an actuations of CAP sensors 325 should be registered (acknowledged) as valid touch events or rejected (masked) as false touch events. While analyzing signal 550, the touch sense logic may implement one or more of the techniques discussed below.
Application logic 510 represents various user applications that may receive input from capacitance sensor circuit 300, use the input to manipulate application data, and generate output for I/O device 515. I/O device 515 may represent any type of I/O device including a display, a network interface card, an audio port, various peripheral devices, and the like.
A) Baseline Drift Compensation Technique
FIG. 6 is a chart 600 illustrating a baseline drift compensation technique for improved capacitive touch sense operation, in accordance with an embodiment of the invention. In general, capacitance sensor circuit 300 measures a change in capacitance from a deactivated state to an activated state of a selected CAP sensor 325. In one embodiment, baseline logic 525 monitors the difference between the current value of signal 550 and a historical or baseline value. Thresholds for determining whether an activation event has in fact occurred are set related to these historical or baseline values. Measured capacitance values that pass over the activation threshold are considered to be touch events. Accordingly, it is important to accurately track the baseline capacitance values associated with CAP sensors 325 should they drift over time.
Background (or “parasitic”) capacitance may change slowly as a result of environmental factors (temperature drift, electrostatic charge build up, etc.). The activation threshold values should be adjusted to compensate for this background capacitance and other factors. This may be done by monitoring signal 550 in real-time, and updating the baseline capacitance value on a regular basis based on the actual capacitance values measured during each sampling cycle. In one embodiment, the baseline capacitance value for each CAP sensor 325 is tracked and updated using a weighted moving average. For example, the weighted moving average may apply a 0.25 weight to the presently measured capacitance value and a 0.75 weight to the historical baseline capacitance value. Of course, other weights may be applied. In one embodiment, infinite impulse response (“IIR”) filters are used to filter signal 550 in real-time and make computation of the weighted moving average efficient.
As illustrated in FIG. 6, when an activation is sensed, the baseline capacitance value is held steady so that the elevated values due to the user interaction do not skew the baseline capacitance value calculation. Accordingly, during activations the baseline update algorithm is disabled and the measured capacitance values masked so as to hold the baseline capacitance value steady until the CAP sensor is deactivated.
The rate at which the baseline capacitance values are updated can be set as part of the system design and even updated by users at a later date. The automatic update rate or interval may also be set by the user to compensate for expected environmental variance. In the event that environmental changes are too rapid, the automatic update rate can be adjusted at run-time to compensate. In one embodiment, the update interval may be set to every Nth sampling (e.g., N=5), where N can be any positive integer.
The baseline capacitance values for each CAP sensor 325 may be adjusted individually or as part of a sensor group (e.g., sensor groups 340 or 350). Tracking and updating baseline capacitance values for each CAP sensor 325 allows different environmental effects to be compensated in each CAP sensor 325 independently. Alternatively, a group baseline capacitance value compensation enables variations to be averaged over a group of CAP sensors 325. Accordingly, an embodiment of the invention enables convenient group compensation of baseline capacitance values and the update rate to be applied to a group of CAP sensors 325. This may be useful for groups of CAP sensors 325 that are physically adjacent to each other in capacitance sense interface 315.
B) Finger On Startup Detection Technique
FIG. 7 is a chart 700 illustrating a finger on startup detection technique for improved capacitive touch sense operation, in accordance with an embodiment of the invention. In one embodiment, the baseline capacitance values discussed above are initialized upon booting or starting system 500. If during the initialization procedures (e.g., time T0 to T1 in FIG. 7), one or more CAP sensors 325 are actuated by a user (e.g., the user has his finger on one or more CAP sense buttons), it may be necessary to detect this condition and quickly update the startup baseline capacitance values. After the user removes the activation (time T2 in FIG. 7), the measured capacitance value of signal 550 will change to a negative value below the startup baseline capacitance value. Simply relying on the baseline logic 525 to slowly track down the startup baseline capacitance value using the weighted moving average can take too long, during which time user interaction with capacitance sense interface 315 will not be recognized. Accordingly this finger on startup condition should be quickly recognized and compensated.
In one embodiment, the finger on startup condition is determined by startup logic 520, if the measured capacitance values of signal 550 cross a negative finger threshold below the startup baseline capacitance value and remains below it for a predetermined period of time (Tp). If this condition is found to be valid, then the startup baseline capacitance value is immediately updated by averaging the capacitance values measured after signal 550 dropped below the negative finger threshold. In one embodiment, the predetermined period of time Tp is a fixed number of sampling cycles (e.g., five sampling cycles).
C) Activation With Hysteresis Technique
FIG. 8 is a chart 800 illustrating activation of CAP sensors 325 using hysteresis for improved capacitive touch sense operation, in accordance with an embodiment of the invention. Depending on the scan rate of a capacitance sense interface 315, rapid repeat activation of the CAP sensors 325 may result in measured capacitance values that do not return all the way to the baseline capacitance value between activations. Unless compensated for, rapid repeat activations may not be detected.
To compensate for rapid repeat activations, hysteresis logic 530 may add hysteresis to the detection algorithm by applying two separate thresholds for determining when a selected CAP sensor 325 is activated and when the selected CAP sensor 325 is deactivated. As illustrated in FIG. 8, hysteresis logic 530 may add an activation threshold and a lower deactivation threshold. When a measured capacitance value cross the activation threshold, the corresponding CAP sensor 325 is registered as “activated.” When the measured capacitance value falls below the deactivation threshold, the corresponding CAP sensor 325 is deemed “deactivated.” In this manner, the measured capacitance value need not return all the way to the baseline capacitance value before an activation is deemed deactivated, nor does the measured capacitance value need to return to the baseline capacitance value to register a subsequent activation.
D) ESD Compensation Technique
FIG. 9A illustrates typical measured profiles for a finger event and an ESD event on CAP sensors 325, in accordance with an embodiment of the invention. As can be seen, the measured capacitance values rise and fall gradually as a user finger (or other conductive device) approaches and departs capacitance sense interface 315. In contrast, an ESD event is typified by a rapid spike above the baseline capacitance value, followed by a rapid drop below the baseline capacitance value followed by a ringing or transients with rapidly declining envelope.
FIG. 9B is a chart 900 illustrating an ESD compensation technique for rejecting ESD events, in accordance with an embodiment of the invention. The user interface environment has substantial opportunity for interruption from ESD events. In order to prevent false activation, signal 550 is evaluated by ESD logic 535. The nature of ESD events is to inject large fast transients into the measured capacitance values, as illustrated in FIG. 9A. ESD logic 535 can reject these ESD events by quickly recognizing these transients and masking the false event for a period of time.
ESD logic 535 can recognize an ESD event by monitoring the slope between consecutive samplings of the measured capacitance values (e.g., calculating the derivative of traces S0 to S4 is real-time) and determining whether the measured capacitance values cross an ESD threshold below the baseline capacitance value. When the derivative value is significantly faster than typical of human activation, an activation may be rejected as an ESD event. In one embodiment, ESD logic 535 determines that an ESD event has occurred if: (1) the slope of the measured capacitance value turns positive and has a magnitude greater than a positive slope threshold (POS_SLOPE_TH), (2) the slope of the measured capacitance value then turns negative and has a magnitude greater than a negative slope threshold (NEG_SLOPE_TH), and (3) the measured capacitance value cross an ESD threshold (ESD_TH) below the baseline capacitance value. ESD logic 535 may apply a fourth requirement that conditions (1), (2), and (3) occur within a predetermined time threshold. If ESD logic 535 determines these conditions are valid, then the activation event is rejected as a false activation or ESD event and all activation on the particular CAP sensor 325 will be rejected or masked for a period of time.
E) Variable Resolution Via Interpolation
Some application logic 510 may require the use of a sliding switch, such as radial slider interface 320 or linear slider interface 330. In many cases the resolution desired is much finer than is physically possible by simply using a greater number of smaller CAP sensors 325. There may also be a desire for detecting greater resolution or granularity than there are physical CAP sensors in the physical array of CAP sensors. In one embodiment, interpolation logic 540 includes detection algorithms to assess the signal strength on each CAP sensor in the array and map the measured values onto a user selected number of CAP sensors (e.g., interpolation). Typical examples include mapping eight linearly spaced CAP sensors 325 onto a 0 to 100 scale, mapping twenty CAP sensors 325 onto a 0 to 256 scale, or mapping eight CAP sensors 325 onto six separate capacitance sense buttons. The calculations may be done with fractional fixed point for efficiency in a limited capability microcontroller.
FIG. 10 is a flow chart illustrating a process 1000 for improved capacitive touch sensing using system 500, in accordance with an embodiment of the invention. The order in which some or all of the process blocks appear in process 1000 below should not be deemed limiting. Rather, one of ordinary skill in the art having the benefit of the present disclosure will understand that some of the process blocks may be executed in a variety of orders or even in parallel.
In a process block 1005, capacitance sensor circuit 300 commences measuring the capacitance values associated with CAP sensors 325. In one embodiment, I/O interface 310 is configured to scan each CAP sensor 325 in sequence to time share capacitance measurement circuit 305 across all CAP sensors 325. Accordingly, the measured capacitance values for all CAP sensors 325 may be obtained in process block 1005 before continuing on with the rest of process 1000, or process 1000 may be executed in its entirety after obtaining a single measured capacitance value, before moving to the next CAP sensor 325 in the sequence.
In a decision block 1010, touch sense logic 505 determines whether system 500 was started with a user finger on capacitance sense interface 315. If so, then the baseline capacitance values for CAP sensors 325 are recalculated in process block 1015. In a process block 1020, touch sense logic 505 tracks the baseline capacitance value(s) of CAP sensors 325 in capacitance sense interface 315. If the baseline capacitance values drift, then a weighted moving average may be applied to update the baseline average and track the baseline drift. In a process block 1025, hysteresis is applied to signal 550 to determine whether any of CAP sensors 325 have been activated or deactivated (decision block 1030). Finally, in a process block 1035, touch sense logic 505 evaluates signal 505 to determine whether the activation should be acknowledged or registered as a valid user activation or rejected as a false activation. Rejecting the activation as a false activation may include identifying noise (e.g., ESD events) in signal 505 and compensating (e.g., reject ESD events).
FIG. 6 illustrates a demonstrative integrated circuit (“IC”) 1100 implemented using an embodiment of system 500. IC 1100 illustrates a Programmable System on a Chip (PSoCTM) microcontroller by Cypress Semiconductor Corporation. The illustrated embodiment of IC 1100 includes programmable input/output (“I/O”) ports 1102, at least a portion of which correspond to I/O interface 310. I/O ports 1102 are coupled to Programmable Interconnect and Logic (“PIL”) 1104 which acts as an interconnect between I/O ports 1102 and a digital block array 1106. Digital block array 1106 may be configured to implement a variety of digital logic circuits (e.g., DAC, digital filters, digital control systems, etc.) using configurable user modules (“UMs”). Digital block array 1106 is further coupled to a system bus 1112.
Static Random Access Memory (“SRAM”) 1110 and processor 1111 are also coupled to system bus 1112. Processor 1111 is coupled to non-volatile storage (“NVS”) 1116 which may be used to store firmware (e.g., touch sense logic 540).
An analog block array 1118 is coupled to system bus 1112. Analog block array 1118 also may be configured to implement a variety of analog circuits (e.g., ADC, analog filters, comparators, current sources, etc.) using configurable UMs. Analog block array 1118 is also coupled to an analog I/O unit 1124 which is coupled to I/O ports 1102. In one embodiment, I/O interface 310 is included within analog I/O 1124. Various subcomponents of capacitance measurement circuit 305 may be implemented with various UMs of digital clock array 1106 and/or analog block array 1118 or the subcomponents may be stand alone components.
The processes explained above are described in terms of computer software and hardware. The techniques described may constitute machine-executable instructions embodied within a machine (e.g., computer) readable storage medium, that when executed by a machine will cause the machine to perform the operations described. Additionally, the processes may be embodied within hardware, such as an application specific integrated circuit (“ASIC”) or the like.
System 500 may be incorporated into IC 1100, as well as, various other integrated circuits. Descriptions of system 500 may be generated and compiled for incorporation into other integrated circuits. For example, behavioral level code describing system 500, or portions thereof, may be generated using a hardware descriptive language, such as VHDL or Verilog, and stored to a machine-readable storage medium. Furthermore, the behavioral level code can be compiled into register transfer level (“RTL”) code, a netlist, or even a circuit layout and stored to a machine-readable storage medium. The behavioral level code, the RTL code, the netlist, and the circuit layout all represent various levels of abstraction to describe system 500.
The above description of illustrated embodiments of the invention, including what is described in the Abstract, is not intended to be exhaustive or to limit the invention to the precise forms disclosed. While specific embodiments of, and examples for, the invention are described herein for illustrative purposes, various modifications are possible within the scope of the invention, as those skilled in the relevant art will recognize.
These modifications can be made to the invention in light of the above detailed description. The terms used in the following claims should not be construed to limit the invention to the specific embodiments disclosed in the specification. Rather, the scope of the invention is to be determined entirely by the following claims, which are to be construed in accordance with established doctrines of claim interpretation.

## Claims

1. A method comprising:
measuring capacitance values of a capacitance sense element;
monitoring a rate of change of the measured capacitance values; and
rejecting an activation of the capacitance sense element as a non-touch event if conditions indicative of the non-touch event are sensed, wherein the conditions indicative of the non-touch event comprise the rate of change of the measured capacitance values having a magnitude greater than a threshold level, wherein the threshold level is indicative of a maximum rate of change of a touch event.

2. The method of claim 1, further comprising analyzing the measured capacitance values to determine a baseline capacitance value for the capacitance sense element, wherein the analyzing comprises:
tracking the baseline capacitance value for the capacitance sense element;
calculating a weighted average based on a current capacitance value measured on the capacitance sense element and the capacitance values that were previously measured on the capacitance sense element; and
updating the baseline capacitance value with the weighted average.

3. The method of claim 2, further comprising filtering the measured capacitance values using an infinite impulse response (IIR) filter before the calculating the weighted average.

4. The method of claim 1, further comprising:
analyzing the measured capacitance values to determine a baseline capacitance value for the capacitance sense element;
accepting the activation of the capacitance sense element as a touch event; and
maintaining the baseline capacitance value when the activation of the capacitance sense element is accepted as the touch event to not skew the calculated weighted average.

5. The method of claim 1, wherein the threshold level is a positive threshold and the maximum rate of change is a positive, maximum rate of change of the touch event.

6. The method of claim 1, wherein the threshold level is a negative threshold and the maximum rate of change is a negative, maximum rate of change of the touch event.

7. The method of claim 1, wherein the rejecting the activation comprises masking all activations of the capacitance sense element for a period after sensing the conditions indicative of the non-touch event.

8. The method of claim 1, further comprising
determining if the non-touch event is an electrostatic discharge (ESD) event, wherein the determining comprises:
detecting that the non-touch event has conditions indicative of an ESD event, wherein the conditions indicative of the ESD event include at least one of the following:
the rate of change of the measured capacitance values turning positive and having a first magnitude greater than a positive threshold,
the rate of change of the measured capacitance values turning negative and having a second magnitude greater than a positive threshold, or
the measured capacitance values crossing an ESD threshold below a baseline capacitance value.

9. The method of claim 1, further comprising:
analyzing the measure capacitance values to determine that the capacitance sense element has been activated when the measured capacitance values cross an activation threshold; and
analyzing the measured capacitance values to determine that the capacitance sense element has been deactivated when the measured capacitance values cross a deactivation threshold.

10. The method of claim 9, further comprising analyzing the measured capacitance values to determine a baseline capacitance value for the capacitance sense element, wherein the analyzing the measured capacitance value to determine the baseline capacitance value further comprises holding the baseline capacitance value substantially steady during activation events of the capacitance sense element.

11. The method of claim 1, further comprising
updating a baseline capacitance value based at least in part upon a weighted moving average of the measured capacitance values.

12. The method of claim 1, further comprising:
analyzing the measured capacitance values to determine a baseline capacitance value for the capacitance sense element; and
analyzing the measured capacitance values to determine whether the measured capacitance values are below the baseline capacitance value by a threshold value for a predetermined period; and
updating the baseline capacitance value based on the measured capacitance values measured after the measured capacitance values are below the baseline capacitance value by the threshold value.

13. A method comprising:
measuring capacitance values of a capacitance sense element;
monitoring a rate of change of the measured capacitance values; and
distinguishing between an activation of the capacitance sense element by a conductive object and a non-touch event when the rate of change of the measured capacitance values exceeds a magnitude greater than a threshold level, the threshold level indicative of a maximum rate of change of a touch event.

14. The method of claim 13, further comprising analyzing the measured capacitance values to determine a baseline capacitance value for the capacitance sense element.

15. The method of claim 14, wherein the analyzing comprises:
tracking the baseline capacitance value for the capacitance sense element;
filtering the measured capacitance values using an infinite impulse response (IIR) filter;
calculating a weighted average based on a current capacitance value measured on the capacitance sense element and the capacitance values that were previously measured on the capacitance sense element; and
updating the baseline capacitance value with the weighted average.

16. An apparatus comprising:
a capacitance measurement circuit to be coupled to a capacitance sense element, wherein the capacitance measurement circuit is configured to measure capacitance values of the capacitance sense element; and
event logic coupled to the capacitance measurement circuit, the event logic to measure a rate of change of the measured capacitance values and to distinguish between an activation of the capacitance sense element by a conductive object and a non-touch event when the rate of change of the measured capacitance values exceeds a magnitude greater than a threshold level, the threshold level indicative of a maximum rate of change of a touch event.

17. The apparatus of claim 16, wherein the event logic is further configured to
determine if the non-touch event is an electrostatic discharge event (ESD) event when at least one of the following conditions is detected:
the rate of change of the measured capacitance values turning positive and having a first magnitude greater than a positive threshold,
the rate of change of the measured capacitance values turning negative and having a second magnitude greater than a positive threshold, or
the measured capacitance values crossing an ESD threshold below a baseline capacitance value.

18. The apparatus of claim 16, further comprising hysteresis logic coupled to the event logic to determine whether capacitance sense element has been activated based on whether the measured capacitance values cross an activation threshold value and to determine whether the capacitance sense element has been deactivated based on whether the measured capacitance values cross a deactivation threshold.

19. The apparatus of claim 16, further comprising baseline logic coupled to analyze the measured capacitance values to determine whether a baseline capacitance value associated with the capacitance sense element has drifted and to update the baseline capacitance value.