CN110865258B - Key detection circuit and key detection method for segmented comparison by using multiple thresholds - Google Patents
Key detection circuit and key detection method for segmented comparison by using multiple thresholds Download PDFInfo
- Publication number
- CN110865258B CN110865258B CN201911187916.1A CN201911187916A CN110865258B CN 110865258 B CN110865258 B CN 110865258B CN 201911187916 A CN201911187916 A CN 201911187916A CN 110865258 B CN110865258 B CN 110865258B
- Authority
- CN
- China
- Prior art keywords
- stage
- key
- capacitor
- data
- charging
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Input From Keyboards Or The Like (AREA)
- Charge And Discharge Circuits For Batteries Or The Like (AREA)
Abstract
A key detection circuit for segmented comparison using multiple thresholds, comprising: the charge moving circuit is configured to charge the charging capacitor and charge a preset capacitor by using the charged charging capacitor; a multi-stage detection circuit configured to divide a charging process of the charging capacitor to a preset capacitor into n stages and obtain detection data of each stage; an interference extraction unit configured to perform interference judgment on the detection data of each stage to judge whether the detection data is valid data or invalid data; the data processing module is configured to remove invalid data and perform weighting processing on the valid data; and the key judgment module is configured to judge the key effective value of the weighted result.
Description
Technical Field
The invention relates to a touch detection technology.
Background
The conventional touch system generally adopts a comparator, sets a comparison voltage, finishes a charging period when a small capacitor charges a preset capacitor to the voltage of the comparator, outputs the charging time as a result, and simply utilizes the output result to perform key judgment. Because the capacitor is very susceptible to power interference, electromagnetic interference and the like in the whole charging process, the interference is easily introduced into the output result, so that the final judgment result of the key is influenced, and the key is mistakenly triggered or missed.
Therefore, a touch determination method with high interference resistance is needed.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention divides the whole charging process of the preset capacitor into a plurality of stages by using one or two or more comparators or analog-to-digital converters (ADC) and the like, detects the charging time (or charging voltage) of each stage, and outputs the charging time (or charging voltage) as a result. Comparing the charging time (or charging voltage) of each stage with a reference value to judge whether the stage has interference, defining the data of the interference stage as invalid data, and defining the data of the non-interference stage as valid data; since the influence of the finger on the charging time (or charging voltage) is different at each stage, the effective data needs to be weighted and finally the key pressing judgment is performed. This can greatly improve the noise immunity of the touch system.
The invention provides a key detection circuit for segmented comparison by using multiple thresholds, which comprises:
the charge moving circuit is configured to charge the charging capacitor and charge a preset capacitor by using the charged charging capacitor;
a multi-stage detection circuit configured to divide a charging process of the charging capacitor to a preset capacitor into n stages and obtain detection data of each stage;
an interference extraction unit configured to perform interference judgment on the detection data of each stage to judge whether the detection data is valid data or invalid data;
the data processing module is configured to remove invalid data and perform weighting processing on the valid data;
and the key judgment module is configured to judge the key effective value of the weighted result.
In one embodiment, the charging capacitor comprises a key parasitic capacitor; when no finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance of the key; when a finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance and the finger capacitance.
In one embodiment, the interference extraction unit is configured to make the interference determination as follows:
setting a reference value for each stage;
calculating the difference between the actual detection data of each stage and the detection data of the stage when no finger is pressed down; and
comparing the difference value with the reference value, judging whether interference exists in the stage according to whether the difference value between the difference value and the reference value exceeds a set range, regarding the detection data with the interference as invalid data, and regarding the detection data of other stages without the interference as valid data.
In one embodiment, the charge shifting circuit includes:
the charging circuit comprises at least one charging capacitor, at least one key switch, a first switch, a second switch, a third switch and a preset capacitor, wherein the key switch, the first switch, the second switch, the third switch and the preset capacitor are connected with the at least one charging capacitor in series and respectively provided with a first end and a second end;
the second end of the at least one charging capacitor is coupled with the ground, and the first end of the at least one charging capacitor is coupled with the second end of the at least one key switch;
the first end of the first switch is coupled with the working voltage, and the second end of the first switch is coupled with the first end of the at least one key switch; the first end of the second switch is coupled with the first end of the at least one key switch, and the second end of the second switch is coupled with the first end of the preset capacitor; the first end of the third switch is coupled with the first end of the preset capacitor, and the second end of the third switch is coupled with the ground; the second end of the preset capacitor is coupled with the ground; the first end of the preset capacitor is coupled with the multi-stage detection circuit, and the voltage value of the first end of the preset capacitor is the voltage value of the preset capacitor and serves as the input of the multi-stage detection circuit.
In one embodiment, the multi-stage detection circuit includes a first comparator having a positive input terminal and a negative input terminal, the multi-stage detection circuit divides a charging process of a preset capacitor into n stages, each stage corresponds to a different comparison voltage threshold, the negative input terminal has an input of a voltage value of the preset capacitor, the positive input terminal has the input of the comparison voltage threshold, and the comparison voltage threshold varies with the variation of the stages; when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
In one embodiment, the multi-stage detection circuit includes a first comparator and a second comparator, the first comparator and the second comparator have a positive input end and a negative input end respectively, the multi-stage detection circuit divides a charging process of a preset capacitor into n stages, each stage corresponds to a different comparison voltage threshold, inputs of the negative input ends of the first comparator and the second comparator are voltage values of the preset capacitor, an input of the positive input end of the first comparator is a comparison voltage threshold corresponding to an odd-numbered stage, and an input of the positive input end of the second comparator is a comparison voltage threshold corresponding to an even-numbered stage. When the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
In one embodiment, the multi-stage detection circuit includes n comparators each having a positive input terminal and a negative input terminal; the multi-stage detection circuit divides the charging process of the preset capacitor into n stages, and each stage corresponds to a different comparison voltage threshold value; each comparator corresponds to one stage; the input of the negative input end of each comparator is the voltage value of a preset capacitor, and the input of the positive input end of each comparator is the comparison voltage threshold value of the corresponding stage; when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
In one embodiment, the data processing module eliminates invalid data and weights valid data according to the following formula:
wherein i represents a key index;
j denotes the jth stage;
n represents the total number of stages;
Tirepresenting a time effective value obtained after the whole charging process corresponding to the key i is finished;
ki(j) a weighting coefficient representing a j-th stage;
Ttouch(j) indicating the detection data when the finger is pressed at the j stage;
Trelease(j) indicating the detected data at the j-th stage when the finger is not pressed.
If the interference extraction unit judges that the j stage has interference, the T in the formula 1 is enabledtouch(j)-Trelease(j) When the data is equal to 0, invalid data is removed; and weighting the effective data according to a formula 1 for a key judgment module to judge the effective value of the key.
In one embodiment, the multi-stage detection circuit comprises an analog-to-digital converter, wherein the input end of the analog-to-digital converter is the voltage value of a preset capacitor; the multi-stage detection circuit sets a fixed total charging time T, divides the total charging time T into n parts, namely, the charging process is divided into n stages, and the voltage of a preset capacitor is adopted at intervals of certain time; this voltage is taken as detection data of each stage.
In one embodiment, the data processing module eliminates invalid data and weights valid data according to the following formula:
wherein i represents a key index;
j denotes the jth stage;
n represents the total number of stages;
Virepresenting the effective voltage value obtained after the whole charging process corresponding to the key i is finished;
mi(j) a weighting coefficient representing a j-th stage;
Vtouch(j) a detection value representing the j-th stage of finger pressing;
Vrelease(j) a detection value indicating that no finger is pressed at the j-th stage;
if the interference extraction unit judges that the j stage has interference, the interference extraction unit makes V in the formula 2touch(j)-Vrelease(j) When the data is equal to 0, invalid data is removed; to is provided withAnd weighting the effective data according to a formula 2 for the key judgment module to judge the effective value of the key.
The invention also provides a key detection method for segmented comparison by using multiple thresholds, which comprises the following steps:
charging a preset capacitor by using the charge moving circuit;
dividing the charging process of a preset capacitor into a plurality of stages, and carrying out detection in stages to obtain detection data;
performing interference judgment on the detection data of each stage, and dividing the detection data into valid data and invalid data;
eliminating invalid data, and performing weighting processing on the valid data; and
and judging the effective value of the key according to the result after the weighting processing.
In one embodiment, the charging capacitor comprises a key parasitic capacitor; when no finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance of the key; when a finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance and the finger capacitance.
In one embodiment, the interference determination comprises the steps of:
setting a reference value for each stage;
calculating the difference between the actual detection data of each stage and the detection data of the stage when no finger is pressed down; and
comparing the difference value with the reference value, judging whether interference exists in the stage according to whether the difference value between the difference value and the reference value exceeds a set range, regarding the detection data with the interference as invalid data, and regarding the detection data of other stages without the interference as valid data.
In one embodiment, the charge shifting circuit includes:
the charging circuit comprises at least one charging capacitor, at least one key switch, a first switch, a second switch, a third switch and a preset capacitor, wherein the key switch, the first switch, the second switch, the third switch and the preset capacitor are connected with the at least one charging capacitor in series and respectively provided with a first end and a second end;
the second end of the at least one charging capacitor is coupled with the ground, and the first end of the at least one charging capacitor is coupled with the second end of the at least one key switch;
the first end of the first switch is coupled with the working voltage, and the second end of the first switch is coupled with the first end of the at least one key switch; the first end of the second switch is coupled with the first end of the at least one key switch, and the second end of the second switch is coupled with the first end of the preset capacitor; the first end of the third switch is coupled with the first end of the preset capacitor, and the second end of the third switch is coupled with the ground; the second end of the preset capacitor is coupled with the ground; the first end of the preset capacitor is coupled with the multi-stage detection circuit, and the voltage value of the first end of the preset capacitor is the voltage value of the preset capacitor and serves as the input of the multi-stage detection circuit.
In one embodiment, the step of dividing the charging process of the predetermined capacitor into a plurality of stages and performing a phased detection includes:
dividing the charging process of a preset capacitor into n stages, wherein each stage corresponds to a different comparison voltage threshold;
providing a first comparator, wherein the first comparator is provided with a positive input end and a negative input end, the input of the negative input end is the voltage value of a preset capacitor, the input of the positive input end is the comparison voltage threshold value, and the comparison voltage threshold value is continuously changed along with the change of stages;
when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
In one embodiment, the step of dividing the charging process of the predetermined capacitor into a plurality of stages and performing a phased detection includes:
dividing the charging process of a preset capacitor into n stages, wherein each stage corresponds to a different comparison voltage threshold;
providing a first comparator and a second comparator, wherein the first comparator and the second comparator are respectively provided with a positive input end and a negative input end, the inputs of the negative input ends of the first comparator and the second comparator are both voltage values of a preset capacitor, the input of the positive input end of the first comparator is a comparison voltage threshold value corresponding to an odd-numbered stage, and the input of the positive input end of the second comparator is a comparison voltage threshold value corresponding to an even-numbered stage.
When the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
In one embodiment, the step of dividing the charging process of the predetermined capacitor into a plurality of stages and performing a phased detection includes:
dividing the charging process of a preset capacitor into n stages, wherein each stage corresponds to a different comparison voltage threshold;
providing n comparators each having a positive input terminal and a negative input terminal; each comparator corresponds to one stage; the input of the negative input end of each comparator is the voltage value of a preset capacitor, and the input of the positive input end of each comparator is the comparison voltage threshold value of the corresponding stage;
when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
In one embodiment, the step of removing invalid data and weighting valid data is performed according to the following formula:
wherein i represents a key index;
j denotes the jth stage;
n represents the total number of stages;
Tirepresenting a time effective value obtained after the whole charging process corresponding to the key i is finished;
ki(j) denotes addition of the j stageA weight coefficient;
Ttouch(j) indicating the detection data when the finger is pressed at the j stage;
Trelease(j) indicating the detected data at the j-th stage when the finger is not pressed.
Wherein, if the interference judging steps judge that the j stage has interference, the T in the formula 1 is enabledtouch(j)-Trelease(j) When the data is equal to 0, invalid data is removed; and weighting the effective data according to the formula 1.
In one embodiment, the step of dividing the charging process of the predetermined capacitor into a plurality of stages and performing a phased detection includes:
setting a fixed total charging time T, and dividing the total charging time T into n parts, namely dividing the charging process into n stages;
and providing an analog-to-digital converter, wherein the analog-to-digital converter acquires the voltage of the preset capacitor at regular intervals and takes the voltage as the detection data of each stage.
In one embodiment, the step of removing invalid data and weighting valid data is performed according to the following formula:
wherein i represents a key index;
j denotes the jth stage;
n represents the total number of stages;
Virepresenting the effective voltage value obtained after the whole charging process corresponding to the key i is finished;
mi(j) a weighting coefficient representing a j-th stage;
Vtouch(j) a detection value representing the j-th stage of finger pressing;
Vrelease(j) a detection value indicating that no finger is pressed at the j-th stage;
wherein, if the interference judging steps judge that the j stage has interference, the V in the formula 2 is enabledtouch(j)-Vrelease(j) When the data is equal to 0, invalid data is removed; and weighting the effective data according to the formula 2.
Drawings
The foregoing summary, as well as the following detailed description of the invention, will be better understood when read in conjunction with the appended drawings. It is to be noted that the appended drawings are intended as examples of the claimed invention. In the drawings, like reference characters designate the same or similar elements.
FIG. 1 is a schematic diagram of a key detection circuit using multi-threshold segment comparison according to an embodiment of the present invention;
FIG. 2 is a diagram of an embodiment of the key detection circuit of FIG. 1;
FIG. 3 is a diagram of one embodiment of a key detect circuit according to FIG. 1;
FIG. 4 is a diagram of one embodiment of a key detect circuit according to FIG. 1;
FIG. 5 is a schematic illustration of stages, divided according to VERF;
FIG. 6 is a diagram of one embodiment of a key detect circuit according to FIG. 1;
FIG. 7 is a schematic diagram of stages divided by time;
FIG. 8 is a flowchart of a key detection method according to an embodiment of the invention.
Detailed Description
The detailed features and advantages of the present invention are described in detail in the detailed description which follows, and will be sufficient for anyone skilled in the art to understand the technical content of the present invention and to implement the present invention, and the related objects and advantages of the present invention will be easily understood by those skilled in the art from the description, claims and drawings disclosed in the present specification.
The following description is of specific embodiments of the application and should not be taken as the only embodiments. It will be apparent to persons skilled in the relevant art(s) that, upon attaining an understanding of the present disclosure and principles, may make various modifications and changes in form and detail without departing from the principles and structures of the invention, but such modifications and changes are intended to be included within the scope of the appended claims.
The basic principle of the touch control system is charge transfer, namely, the charge of a small capacitor (such as a parasitic capacitor) is transferred to a large capacitor (such as a preset capacitor) for multiple times, and when a finger is pressed down, the small capacitor changes, so that the charging time is influenced; the system comprises a comparator for setting comparison voltage, when the voltage of the preset capacitor is equal to the voltage set by the comparator, a charging process of one period is completed, and the charging time is output as a result. The working process is as follows:
stage 1: independently charging the small key capacitor to enable the voltage of the small key capacitor to reach the working voltage;
and (2) stage: transferring the small capacitor charge to the large capacitor to slowly increase the voltage at the end of the large capacitor;
and (3) stage: performing the stage 1-2 according to a certain frequency cycle, and when the voltage of the end of the large capacitor reaches the reference voltage VREF of the comparator, turning over the output of the comparator;
and (4) stage: and recording the time when the large capacitance climbs to the VREF voltage from 0V as a representative value of the touch key.
When a hand is pressed down, the small capacitance is increased (the equivalent capacitance of the finger is increased), and the time for the large capacitance to climb from 0V to VREF voltage is shortened, so that whether the key is pressed or not is judged.
The prior art simply utilizes the output result to judge the key pressing. Because the whole charging process is very susceptible to power interference, electromagnetic interference and the like, the interference is easily introduced into the output result, so that the final judgment result of the key is influenced, and the key is mistakenly triggered or missed to be detected. Therefore, a touch determination method with high interference resistance is highly required.
In order to overcome the defects of the prior art, the invention divides the whole charging process of the preset capacitor into a plurality of stages by using one or two or more comparators or analog-to-digital converters (ADC) and the like, detects the charging time (or charging voltage) of each stage, and outputs the charging time (or charging voltage) as a result. Comparing the charging time (or charging voltage) of each stage with a reference value to judge whether the stage has interference, defining the data of the interference stage as invalid data, and defining the data of the non-interference stage as valid data; since the influence of the finger on the charging time (or charging voltage) is different at each stage, the effective data needs to be weighted and finally the key pressing judgment is performed. This can greatly improve the noise immunity of the touch system.
The invention uses the weighted sum of the detection data of each stage to represent the time effective value T of the keyi(i denotes a key index)
Wherein j represents the jth charging phase;
n represents the total charge phase;
ki(j) a weighting coefficient representing a j-th stage;
Ttouch(j) representing detection data when the finger is pressed in the charging j stage;
Trelease(j) detection data indicating that the finger is not pressed at the charging j stage;
detecting values of different charging stages, if the j stage has interference, the detected data of the j stage is regarded as invalid data, and enabling Ttouch(j)-Trelease(j) 0; weighting the effective data and according to the result (i.e. time effective value T)i) And judging the effective value of the key i.
The interference judging method comprises the following steps:
setting a reference value T _ set (j) for each charging phase, wherein j represents a charging phase;
interference judgment is carried out on the detection data of each charging stage; specifically, if Ttouch(j)-Trelease(j) If the difference value between the value and T _ set (j) exceeds the set range, the interference is considered to exist, and T is enabledtouch(j)-Trelease(j) When T is equal to 0, mixingtouch(j) As invalid data. If T istouch(j)-Trelease(j) If the difference value from T _ set (j) is within the set range, the data is regarded as valid data.
In addition, the invention can also use a weighted sum table of charging voltages in each stageVoltage effective value V of display keyi(i denotes a key index)
Wherein j represents the charging phase;
n represents the total charge phase;
mi(j) a weighting coefficient representing a j-th stage;
Vtouch(j) a detection value representing the finger pressing at the charging j stage;
Vrelease(j) indicating a detection value when no finger is pressed in the charging j stage;
detecting the charging voltage values of different charging stages, and if the j stage has interference, the detection data of the stage is regarded as invalid data to enable Vtouch(j)-Vrelease(j) 0; the effective data is weighted and the result (i.e. the effective voltage value V) is used as a basisi) And judging the effective value of the key i.
The invention adopts one or two or more comparators or analog-to-digital converters (ADC) and the like, divides the charging process of the preset capacitor into a plurality of stages, and outputs the charging time of each stage as a result. And comparing the charging time of each stage with a reference value so as to judge whether the stage has interference. It should be noted that, in the present invention, the implementation of the segmented comparison of the touch system by using the comparator or the analog-to-digital converter ADC is only a partial example, and the implementation of the segmented comparison of the touch system by using the inverter, the operational amplifier, and other devices through a similar method and performing the key determination also belong to the protection scope of the present invention.
FIG. 1 is a diagram of a key detect circuit using multi-threshold segment comparison according to an embodiment of the present invention. This button detection circuitry includes: a charge transfer circuit 101, a multi-stage detection circuit 102, an interference extraction unit 103, a data processing module 104, and a key determination module 105.
The charge shifting circuit 101 is configured to charge the charging capacitor and charge a predetermined capacitor with the charged charging capacitor.
The charging capacitor comprises a key parasitic capacitor. When no finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance of the key. When a finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance and the finger capacitance.
The preset capacitor is a capacitor preset according to requirements.
The preset capacitor is a large capacitor, and the charging capacitor is a small capacitor. In one embodiment, the magnitude of the charge capacitor is on the order of pf. The magnitude grade of the preset capacitor is nf grade.
The multi-stage detection circuit 102 is configured to divide a charging process of the charging capacitance to the preset capacitance into a plurality of stages and obtain detection data of each stage.
According to different embodiments, the detection data is the charging time or the charging voltage value of the preset capacitor at each stage.
In one embodiment, the multi-stage detection circuit 102 may include one or more comparators. The detection data at this time is the charging time of the preset capacitor at each stage.
In one embodiment, the multi-stage detection circuit 102 may include an analog-to-digital converter. The detection data at this time is the charging voltage value of the preset capacitor at the end of each stage.
The interference extraction unit 103 is configured to perform interference determination on the detection data of each stage, and determine whether the detection data is valid data or invalid data.
Specifically, interference extracting section 103 performs interference determination by the following method:
setting a reference value for each stage;
calculating the difference between the actual detection data of each stage and the detection data of the stage when no finger is pressed down; and
comparing the difference value with the reference value, judging whether interference exists in the stage according to whether the difference value between the difference value and the reference value exceeds a set range, and regarding detection data with the interference as invalid data; others are considered valid data.
The data processing module 104 is configured to cull the invalid data and perform weighting processing on the valid data.
The key determination module 105 is configured to perform key validity determination on the weighted result.
FIG. 2 illustrates one embodiment of a key detect circuit according to FIG. 1. This button detection circuitry includes: a charge shifting circuit 201, a multi-stage detection circuit 202, an interference extraction unit, a data processing module and a key judgment module. It should be noted that fig. 2 does not show the interference extraction unit, the data processing module, and the key determination module, and these three modules are identical to the three modules in fig. 1, and are not shown repeatedly because the frame is limited.
The charge shifting circuit 201 may include at least one charging capacitor (e.g., a first charging capacitor 2011 and a second charging capacitor 2012 …) and at least one key switch (e.g., a first key switch 2013 and a second key switch 2014 …) connected in series with the at least one charging capacitor. Each charging capacitor corresponds to a corresponding key channel, and the corresponding key switch controls the key channel to be opened and closed.
The at least one charging capacitor has a first terminal and a second terminal, and the at least one key switch has a first terminal and a second terminal. The second end of the at least one charging capacitor is coupled to ground, and the first end of the at least one charging capacitor is coupled to the second end of the at least one key switch.
The charge shifting circuit 201 further includes a first switch 2015, a second switch 2016, a third switch 2017, and a predetermined capacitor 2018. The first switch 2015, the second switch 2016, the third switch 2017 and the preset capacitor 2018 each have a first terminal and a second terminal. The first terminal of the first switch 2015 is coupled to the operating voltage VCC, and the second terminal is coupled to the first terminal of the at least one key switch. The second switch 2016 has a first terminal coupled to the first terminal of the at least one key switch, and a second terminal coupled to the first terminal of the predetermined capacitor 2018. The third switch 2017 has a first terminal coupled to the first terminal of the predetermined capacitor and a second terminal coupled to ground. The second terminal of the preset capacitor 2018 is coupled to ground. The first terminal of the predetermined capacitor 2018 is coupled to the multi-stage detection circuit 202, and the voltage value of the first terminal of the predetermined capacitor (i.e. the voltage value of the predetermined capacitor) is used as the input of the multi-stage detection circuit 202.
The multi-stage detection circuit 202 includes a first comparator 2021. The first comparator 2021 has a positive input terminal and a negative input terminal. The multi-stage detection circuit 202 divides the charging process of the predetermined capacitor into n stages, each stage corresponding to a different comparison voltage threshold. The input of the negative input end is the voltage value of the preset capacitor, the input of the positive input end is a comparison voltage threshold value, and the comparison voltage threshold value is continuously changed along with the change of the stage.
Specifically, the comparison voltage threshold of the first stage is set to VREF1, when the voltage value of the preset capacitor reaches VREF1, the first stage is ended, and at this time, the charging time for the voltage value of the preset capacitor to reach VREF1 is calculated, so that the voltage of the preset capacitor is maintained; setting the comparison voltage threshold value of the second stage as VREF2, continuing to charge the preset capacitor to VREF2, ending the second stage, and calculating the charging time for the voltage value of the preset capacitor to reach VREF 2; and analogically, switching the comparison voltage threshold of the comparator according to the time sequence until the end of the whole charging process.
By switching different comparison voltage thresholds for the same comparator, staged measurement is realized, and the charging time of each stage is obtained. Fig. 5 shows a schematic diagram of the division of the stages in the whole charging process, wherein:
the 2 nd stage charging time is defined by VREF 1-VREF 2;
the nth phase charge time is defined by VREFn-1 to VREFn (where VREFn is less than VCC).
The interference extraction unit is configured to determine whether the charging time of each stage is valid data or invalid data. Specifically, the interference extraction unit performs interference determination by the following method:
setting a reference value T _ set (j) for each stage, wherein j represents a charging stage;
calculating the actual charging time T of each stagetouch(j) No finger pressing at this stageCharging time T at the time of descendingrelease(j) The difference between them; and
comparing the difference with the reference value T _ set (j), if the difference between the difference and the reference value T _ set (j) exceeds a set range, considering the stage as interference, regarding the charging time as invalid data, and setting the difference to 0 (i.e. Ttouch(j)-Trelease(j) 0); if the difference between the difference and the reference value T _ set (j) is within a set range, the charging time is regarded as valid data.
The data processing module is configured to remove invalid data and perform weighting processing on valid data. See equation 1 specifically:
wherein i represents a key index;
j represents the jth charging phase;
n represents the total charge phase;
ki(j) a weighting coefficient representing a j-th stage;
Ttouch(j) representing detection data when the finger is pressed in the charging j stage;
Trelease(j) detection data indicating that the finger is not pressed at the charging j stage;
wherein if the j stage is judged to have interference, Ttouch(j)-Trelease(j) Invalid data is removed as 0.
The key judgment module is configured to perform key validity judgment on the weighted result (i.e., the result of formula 1).
Fig. 3 shows a further embodiment of the key detection circuit according to fig. 1. This button detection circuitry includes: a charge transfer circuit 301, a multi-stage detection circuit 302, an interference extraction unit, a data processing module, and a key determination module. It should be noted that fig. 3 does not show the interference extraction unit, the data processing module, and the key determination module, which are the same as the three modules in fig. 1, and are not shown repeatedly because the frame is limited.
The charge shifting circuit 301 may include at least one charging capacitor (e.g., a first charging capacitor 3011 and a second charging capacitor 3012 …) and at least one key switch (e.g., a first key switch 3013 and a second key switch 3014 …) connected in series to the at least one charging capacitor. Each charging capacitor corresponds to a corresponding key channel, and the corresponding key switch controls the key channel to be opened and closed.
The at least one charging capacitor has a first terminal and a second terminal, and the at least one key switch has a first terminal and a second terminal. The second end of the at least one charging capacitor is coupled to ground, and the first end of the at least one charging capacitor is coupled to the second end of the at least one key switch.
The charge shifting circuit 301 further includes a first switch 3015, a second switch 3016, a third switch 3017, and a predetermined capacitor 3018. The first switch 3015, the second switch 3016, the third switch 3017, and the predetermined capacitor 3018 each have a first terminal and a second terminal. The first terminal of the first switch 3015 is coupled to the operating voltage VCC, and the second terminal is coupled to the first terminal of the at least one key switch. The second switch 3016 has a first terminal coupled to the first terminal of the at least one key switch, and a second terminal coupled to the first terminal of the preset capacitor 3018. A first terminal of the third switch 3017 is coupled to a first terminal of the predetermined capacitor, and a second terminal thereof is coupled to ground. The second terminal of the preset capacitor 3018 is coupled to ground. The first terminal of the preset capacitor 3018 is coupled to the multi-stage detection circuit 302, and the voltage value of the first terminal of the preset capacitor (i.e. the voltage value of the preset capacitor) is used as the input of the multi-stage detection circuit 302.
The multi-stage detection circuit 302 includes a first comparator 3021 and a second comparator 3022. The first comparator 3021 and the second comparator 3022 each have a positive input terminal and a negative input terminal. The multi-stage detection circuit 302 divides the charging process of the predetermined capacitor into n stages, each stage corresponding to a different comparison voltage threshold. The inputs of the negative input terminals of the first comparator 3021 and the second comparator 3022 are both voltage values of a predetermined capacitor, the input of the positive input terminal of the first comparator 3021 is a comparison voltage threshold corresponding to an odd-numbered stage, and the input of the positive input terminal of the second comparator 3022 is a comparison voltage threshold corresponding to an even-numbered stage.
Specifically, the first comparator 3021 is used in the first stage, and when the voltage value of the preset capacitor reaches the first comparison voltage threshold VREF1, the first stage is considered to be ended, and the charging time of the stage is calculated; in the second stage, a second comparator 3022 is used, and when the voltage value of the preset capacitor reaches a second comparison voltage threshold VREF2, the second stage is considered to be ended, and the charging time in the stage is calculated; the third stage uses the first comparator 3021 again, and the fourth stage uses the second comparator 3022 again, which calculates the comparison voltage threshold of the comparator sequentially, and switches the comparison voltage threshold of the comparator in time sequence until the end of the whole charging process.
Through two comparators and switching different comparison voltage threshold values, detection in stages is realized, and charging time of each stage is obtained. Fig. 5 shows a schematic diagram of the division of the stages in the whole charging process, wherein:
the 2 nd stage charging time is defined by VREF 1-VREF 2;
the nth phase charge time is defined by VREFn-1 to VREFn (where VREFn is less than VCC).
The interference extraction unit is configured to determine whether the charging time of each stage is valid data or invalid data. Specifically, the interference extraction unit performs interference determination by the following method:
setting a reference value T _ set (j) for each stage, wherein j represents a charging stage;
calculating the actual charging time T of each stagetouch(j) And the charging time T when no finger is pressed at the stagerelease(j) The difference between them; and
comparing the difference with the reference value T _ set (j), if the difference between the difference and the reference value T _ set (j) exceeds a set range, considering the stage as interference, regarding the charging time as invalid data, and setting the difference to 0 (i.e. Ttouch(j)-Trelease(j) 0); if the difference between the difference and the reference value T _ set (j) is within the set range, the charge is performedThe electrical time is considered as valid data.
The data processing module is configured to remove invalid data and perform weighting processing on valid data. See equation 1 specifically:
wherein i represents a key index;
j represents the jth charging phase;
n represents the total charge phase;
ki(j) a weighting coefficient representing a j-th stage;
Ttouch(j) representing detection data when the finger is pressed in the charging j stage;
Trelease(j) detection data indicating that the finger is not pressed at the charging j stage;
wherein if the j stage is judged to have interference, Ttouch(j)-Trelease(j) Invalid data is removed as 0.
The key judgment module is configured to perform key validity judgment on the weighted result (i.e., the result of formula 1).
Fig. 4 shows a further embodiment of the key detection circuit according to fig. 1. This button detection circuitry includes: a charge transfer circuit 401, a multi-stage detection circuit 402, a disturbance extraction unit, a data processing module, and a key determination module. It should be noted that fig. 4 does not show the interference extraction unit, the data processing module, and the key determination module, which are the same as the three modules in fig. 1, and are not shown repeatedly because the frame is limited.
The charge shifting circuit 401 may include at least one charging capacitor (e.g., a first charging capacitor 4011, a second charging capacitor 4012 …) and at least one key switch (e.g., a first key switch 4013, a second key switch 4014 …) connected in series with the at least one charging capacitor. Each charging capacitor corresponds to a corresponding key channel, and the corresponding key switch controls the key channel to be opened and closed.
The at least one charging capacitor has a first terminal and a second terminal, and the at least one key switch has a first terminal and a second terminal. The second end of the at least one charging capacitor is coupled to ground, and the first end of the at least one charging capacitor is coupled to the second end of the at least one key switch.
The charge shifting circuit 401 further includes a first switch 4015, a second switch 4016, a third switch 4017, and a predetermined capacitor 4018. The first switch 4015, the second switch 4016, the third switch 4017, and the preset capacitor 4018 each have a first terminal and a second terminal. The first terminal of the first switch 4015 is coupled to the operating voltage VCC, and the second terminal is coupled to the first terminal of the at least one key switch. A first terminal of the second switch 4016 is coupled to the first terminal of the at least one key switch, and a second terminal thereof is coupled to a first terminal of the predetermined capacitor 4018. A first terminal of the third switch 4017 is coupled to the first terminal of the predetermined capacitor, and a second terminal thereof is coupled to ground. The second terminal of the preset capacitor 4018 is coupled to ground. The first terminal of the preset capacitor 4018 is coupled to the multi-stage detection circuit 402, and the voltage value of the first terminal of the preset capacitor (i.e. the voltage value of the preset capacitor) is used as the input of the multi-stage detection circuit 402.
The multi-stage detection circuit 402 includes n comparators, for example, a first comparator 4021, a second comparator 4022 …, and an nth comparator 402 n. Each comparator has a positive input and a negative input. The multi-stage detection circuit 402 divides the charging process of the predetermined capacitor into n stages, each stage corresponding to a different comparison voltage threshold. One for each phase. The input of the negative input end of each comparator is the voltage value of the preset capacitor, the input of the positive input end of each comparator is the comparison voltage threshold of the corresponding stage, for example, the input of the positive input end of the first comparator is the comparison voltage threshold VREF1 of the first stage, when the voltage value of the preset capacitor reaches VREF1, the first stage is ended; the input of the positive input end of the second comparator is a comparison voltage threshold VREF2 of the second stage, and when the voltage value of the preset capacitor reaches VREF2, the second stage is ended; and so on until the end of the entire charging process.
It should be noted that the use of n comparators for n different comparison voltage thresholds is only one of the solutions. It is within the scope of the present disclosure to use fewer than n comparators for the n different comparison voltage thresholds.
Through a plurality of comparators, realized stage by stage detection, obtained the charge time of each stage. Fig. 5 shows a schematic diagram of the division of the stages in the whole charging process, wherein:
the 2 nd stage charging time is defined by VREF 1-VREF 2;
the nth phase charge time is defined by VREFn-1 to VREFn (where VREFn is less than VCC).
The interference extraction unit is configured to determine whether the charging time of each stage is valid data or invalid data. Specifically, the interference extraction unit performs interference determination by the following method:
setting a reference value T _ set (j) for each stage, wherein j represents a charging stage;
calculating the actual charging time T of each stagetouch(j) And the charging time T when no finger is pressed at the stagerelease(j) The difference between them; and
comparing the difference with the reference value T _ set (j), if the difference between the difference and the reference value T _ set (j) exceeds a set range, considering the stage as interference, regarding the charging time as invalid data, and setting the difference to 0 (i.e. Ttouch(j)-Trelease(j) 0); if the difference between the difference and the reference value T _ set (j) is within a set range, the charging time is regarded as valid data.
The data processing module is configured to remove invalid data and perform weighting processing on valid data. See equation 1 specifically:
wherein i represents a key index;
j represents the jth charging phase;
n represents the total charge phase;
ki(j) a weighting coefficient representing a j-th stage;
Ttouch(j) representing detection data when the finger is pressed in the charging j stage;
Trelease(j) detection data indicating that the finger is not pressed at the charging j stage;
wherein if the j stage is judged to have interference, Ttouch(j)-Trelease(j) Invalid data is removed as 0.
The key judgment module is configured to perform key validity judgment on the weighted result (i.e., the result of formula 1).
Fig. 6 shows a further embodiment of the key detection circuit according to fig. 1. In this embodiment, the analog-to-digital converter ADC is used to implement multi-threshold segmentation for capacitive key detection. The principle of using the analog-to-digital converter is to fix the total time to adopt the voltage of the preset capacitor and output the voltage of the preset capacitor through the analog-to-digital converter. That is, the total charging time T is fixed, as shown in fig. 7, the total charging time T is divided into n parts, where n parts are n stages, the voltage of the preset capacitor is sampled at regular intervals, and the voltage sampled at each stage is output through the analog-to-digital converter; and comparing and judging the voltage as an output value of each stage.
This button detection circuitry includes: a charge transfer circuit 601, a multi-stage detection circuit 602, a disturbance extraction unit, a data processing module and a key judgment module. It should be noted that fig. 6 does not show the interference extraction unit, the data processing module, and the key judgment module, and these three modules are identical to the three modules in fig. 1, and are not shown repeatedly because the frame is limited.
The charge shifting circuit 601 may include at least one charging capacitor (e.g., a first charging capacitor 6011, a second charging capacitor 6012 …) and at least one key switch (e.g., a first key switch 6013, a second key switch 6014 …) connected in series with the at least one charging capacitor. Each charging capacitor corresponds to a corresponding key channel, and the corresponding key switch controls the key channel to be opened and closed.
The at least one charging capacitor has a first terminal and a second terminal, and the at least one key switch has a first terminal and a second terminal. The second end of the at least one charging capacitor is coupled to ground, and the first end of the at least one charging capacitor is coupled to the second end of the at least one key switch.
The charge shifting circuit 601 further includes a first switch 6015, a second switch 6016, a third switch 6017, and a predetermined capacitor 6018. The first switch 6015, the second switch 6016, the third switch 6017, and the pre-set capacitor 6018 each have a first terminal and a second terminal. The first switch 6015 has a first terminal coupled to the operating voltage VCC, and a second terminal coupled to the first terminal of the at least one key switch. A first terminal of the second switch 6016 is coupled to the first terminal of the at least one key switch, and a second terminal is coupled to a first terminal of the preset capacitor 6018. A first terminal of the third switch 6017 is coupled to the first terminal of the predetermined capacitor, and a second terminal thereof is coupled to ground. The second terminal of the preset capacitor 6018 is coupled to ground. The first end of the preset capacitor 6018 is coupled to the multi-stage detection circuit 602, and the voltage value of the first end of the preset capacitor (i.e. the voltage value of the preset capacitor) is used as the input of the multi-stage detection circuit 602.
The multi-stage detection circuit 602 includes an analog-to-digital converter ADC having an input terminal with a voltage value of a predetermined capacitor. The multi-stage detection circuit 602 sets a fixed total charging time T, as shown in fig. 7, divides the total charging time T into n parts (i.e., the charging process is divided into n stages), applies the voltage of the preset capacitor at regular intervals, and outputs the voltage sampled at each stage through the analog-to-digital converter; the voltage is used as the detection data of each stage for comparison and judgment of subsequent modules. In one embodiment, the analog-to-digital converter may be a high-speed ADC.
The charging voltage at the moment is acquired in a fixed time period, so that staged detection is realized, and the charging voltage value of each stage is obtained. Fig. 7 shows a schematic diagram of the division of the stages in the whole charging process, wherein:
the voltage of the 1 st stage is collected at the time point t 1;
the phase 2 voltage is collected at the time point t 2;
the nth stage voltage is collected at the tn time point.
The interference extraction unit is configured to determine whether the charging voltage value of each stage is valid data or invalid data. Specifically, the interference extraction unit performs interference determination by the following method:
setting a reference value V _ set (j) for each stage, wherein j represents a charging stage;
calculating the actual charging voltage V of each stagetouch(j) And the charging voltage V when no finger is pressed at the stagerelease(j) The difference between them; and
comparing the difference with the reference value V _ set (j), if the difference between the difference and the reference value V _ set (j) exceeds a set range, considering the stage as interference, regarding the charging voltage as invalid data, and setting the difference to 0 (i.e. Vtouch(j)-Vrelease(j) 0); if the difference between the difference and the reference value V _ set (j) does not exceed a set range, the charging voltage value is regarded as valid data.
The data processing module is configured to remove invalid data and perform weighting processing on valid data. See equation 2 specifically:
wherein, i represents a key index, i.e. the ith key channel;
j represents the charging phase;
n represents the total charge phase;
mi(j) a weighting coefficient representing a j-th stage;
Vtouch(j) a detection value representing the finger pressing at the charging j stage;
Vrelease(j) indicating a detection value when no finger is pressed in the charging j stage;
wherein if the j stage is judged to have interference, Vtouch(j)-Vrelease(j) Invalid data is removed as 0.
The key judgment module is configured to perform key validity judgment on the weighted result (i.e., the result of formula 2).
FIG. 8 is a flowchart illustrating a key detection method according to an embodiment of the invention. The method comprises the following steps:
step 1: the charge moving circuit charges a preset capacitor (801);
step 2: utilizing at least one comparator or ADC to divide the charging process of the preset capacitor into a plurality of stages for staged detection (8021-802 n);
and step 3: storing the detection data output by the detection circuit in each stage;
and 4, step 4: performing interference extraction, and dividing the detection data into effective data and ineffective data (803);
and 5: after grouping, eliminating invalid data, and performing weighting processing on the valid data (804);
step 6: and judging the effective value of the key according to the weighted result (805).
Compared with the prior art, the invention has the following technical effects:
1. the basic principle of the existing touch control system is charge transfer, namely, the charge of a charging capacitor (small capacitor) is transferred to a preset capacitor for multiple times, and when a finger is pressed down, the charging capacitor (small capacitor) changes, so that the charging time is influenced; the system comprises a comparator for setting comparison voltage, when the voltage of the preset capacitor is equal to the voltage set by the comparator, a charging process of one period is completed, and the charging time is output as a result. In the invention, one or two or more comparators or analog-to-digital converters (ADC) and the like are used for dividing the charging process of the preset capacitor into a plurality of stages, and the charging time or charging voltage of each stage is output as a result.
2. Currently, effective judgment for the touch key is to judge whether a finger touches or not based on a difference value between a current value and a reference value; since the pre-set capacitor is very susceptible to the influence of the power supply environment and the electromagnetic environment in the whole charging process, a part of interference is introduced into the final result, thereby causing the false triggering or missing detection of the key. In the invention, interference judgment is carried out on the data at each charging stage, and the weighting of the data (effective data) without interference is used as effective judgment of the key, so that the accuracy of key judgment is improved.
3. In a touch system with a low signal-to-noise ratio, the finger variation is extremely small. If the traditional mode is adopted, a great deal of noise can be introduced into the final result, and whether touch change exists is difficult to judge; in the invention, the charging time of each stage is compared with each reference time, the result of the stage with larger noise is removed, and the test results of other stages are subjected to certain weighting processing, so that the system with low signal-to-noise ratio is applied in a poorer environment and keeps good performance.
As used in this application and the appended claims, the terms "a," "an," "the," and/or "the" are not intended to be inclusive in the singular, but rather are intended to be inclusive in the plural unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that steps and elements are included which are explicitly identified, that the steps and elements do not form an exclusive list, and that a method or apparatus may include other steps or elements.
This application uses specific words to describe embodiments of the application. Reference throughout this specification to "one embodiment," "an embodiment," and/or "some embodiments" means that a particular feature, structure, or characteristic described in connection with at least one embodiment of the present application is included in at least one embodiment of the present application. Therefore, it is emphasized and should be appreciated that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, some features, structures, or characteristics of one or more embodiments of the present application may be combined as appropriate.
Similarly, it should be noted that in the preceding description of embodiments of the application, various features are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure aiding in the understanding of one or more of the embodiments. This method of disclosure, however, is not intended to require more features than are expressly recited in the claims.
Additionally, the order in which elements and sequences of the processes described herein are processed, the use of alphanumeric characters, or the use of other designations, is not intended to limit the order of the processes and methods described herein, unless explicitly claimed. While various presently contemplated embodiments of the invention have been discussed in the foregoing disclosure by way of example, it is to be understood that such detail is solely for that purpose and that the appended claims are not limited to the disclosed embodiments, but, on the contrary, are intended to cover all modifications and equivalent arrangements that are within the spirit and scope of the embodiments herein. For example, although the above described apparatus or system may be implemented by a hardware device, there is also a possibility to be implemented by a software solution.
Those skilled in the art will appreciate that various modifications and improvements may be made to the disclosure herein. For example, the different system components described above are implemented by hardware devices, but may also be implemented by software solutions only. Further, the location information disclosed herein may be provided via a firmware, firmware/software combination, firmware/hardware combination, or hardware/firmware/software combination.
The terms and expressions which have been employed herein are used as terms of description and not of limitation. The use of such terms and expressions is not intended to exclude any equivalents of the features shown and described (or portions thereof), and it is recognized that various modifications may be made within the scope of the claims. Other modifications, variations, and alternatives are also possible. Accordingly, the claims should be looked to in order to cover all such equivalents.
Also, it should be noted that although the present invention has been described with reference to the current specific embodiments, it should be understood by those skilled in the art that the above embodiments are merely illustrative of the present invention, and various equivalent changes or substitutions may be made without departing from the spirit of the present invention, and therefore, it is intended that all changes and modifications to the above embodiments be included within the scope of the claims of the present application.
Claims (18)
1. A key detection circuit for segmented comparison using multiple thresholds, comprising:
the charge moving circuit is configured to charge the charging capacitor and charge a preset capacitor by using the charged charging capacitor;
a multi-stage detection circuit configured to divide a charging process of the charging capacitor to a preset capacitor into n stages and obtain detection data of each stage;
an interference extraction unit configured to perform interference judgment on the detection data of each stage to judge whether the detection data is valid data or invalid data;
the data processing module is configured to remove invalid data and perform weighting processing on the valid data;
the key judgment module is configured to judge the key effective value of the weighted result;
wherein the charge transfer circuit includes:
the charging circuit comprises at least one charging capacitor, at least one key switch, a first switch, a second switch, a third switch and a preset capacitor, wherein the at least one key switch and the at least one charging capacitor are connected in series;
the second end of the at least one charging capacitor is coupled with the ground, and the first end of the at least one charging capacitor is coupled with the second end of the at least one key switch;
the first end of the first switch is coupled with the working voltage, and the second end of the first switch is coupled with the first end of the at least one key switch; the first end of the second switch is coupled with the first end of the at least one key switch, and the second end of the second switch is coupled with the first end of the preset capacitor; the first end of the third switch is coupled with the first end of the preset capacitor, and the second end of the third switch is coupled with the ground; the second end of the preset capacitor is coupled with the ground; the first end of the preset capacitor is coupled with the multi-stage detection circuit, and the voltage value of the first end of the preset capacitor is the voltage value of the preset capacitor and serves as the input of the multi-stage detection circuit.
2. The key detect circuit of claim 1, wherein the charge capacitor comprises a key parasitic capacitance; when no finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance of the key; when a finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance and the finger capacitance.
3. The key detection circuit of claim 1, wherein the interference extraction unit is configured to make the interference determination by:
setting a reference value for each stage;
calculating the difference between the actual detection data of each stage and the detection data of the stage when no finger is pressed down; and
comparing the difference value with the reference value, judging whether interference exists in the stage according to whether the difference value between the difference value and the reference value exceeds a set range, regarding the detection data with the interference as invalid data, and regarding the detection data of other stages without the interference as valid data.
4. The key detection circuit of claim 1, wherein the multi-stage detection circuit comprises a first comparator having a positive input terminal and a negative input terminal, the multi-stage detection circuit divides a charging process of a predetermined capacitor into n stages, each stage corresponds to a different comparison voltage threshold, the negative input terminal inputs a voltage value of the predetermined capacitor, the positive input terminal inputs the comparison voltage threshold, and the comparison voltage threshold varies with the stage;
when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
5. The key detection circuit of claim 1, wherein the multi-stage detection circuit comprises a first comparator and a second comparator, the first comparator and the second comparator have a positive input terminal and a negative input terminal, respectively, the multi-stage detection circuit divides a charging process of a predetermined capacitor into n stages, each stage corresponds to a different comparison voltage threshold, the negative input terminals of the first comparator and the second comparator both input a voltage value of the predetermined capacitor, the positive input terminal of the first comparator is a comparison voltage threshold corresponding to an odd-numbered stage, and the positive input terminal of the second comparator is a comparison voltage threshold corresponding to an even-numbered stage;
when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
6. The key detect circuit of claim 1, wherein the multi-stage detect circuit comprises n comparators each having a positive input terminal and a negative input terminal; the multi-stage detection circuit divides the charging process of the preset capacitor into n stages, and each stage corresponds to a different comparison voltage threshold value; each comparator corresponds to one stage; the input of the negative input end of each comparator is the voltage value of a preset capacitor, and the input of the positive input end of each comparator is the comparison voltage threshold value of the corresponding stage;
when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
7. The key detect circuit according to any of claims 4-6, wherein the data processing module culls invalid data and weights valid data according to the following formula:
wherein i represents a key index;
j denotes the jth stage;
n represents the total number of stages;
Tirepresenting a time effective value obtained after the whole charging process corresponding to the key i is finished;
ki(j) a weighting coefficient representing a j-th stage;
Ttouch(j) indicating the detection data when the finger is pressed at the j stage;
Trelease(j) detection data indicating that the finger is not pressed at the j-th stage;
if the interference extraction unit judges that the j stage has interference, the T in the formula 1 is enabledtouch(j)-Trelease(j) When the data is equal to 0, invalid data is removed; and weighting the effective data according to a formula 1 for a key judgment module to judge the effective value of the key.
8. The key detection circuit of claim 1, wherein the multi-stage detection circuit comprises an analog-to-digital converter having an input terminal for a voltage value of a predetermined capacitor; the multi-stage detection circuit sets a fixed total charging time T, divides the total charging time T into n parts, and adopts the voltage of a preset capacitor at intervals of a certain time; this voltage is taken as detection data of each stage.
9. The key detect circuit of claim 8, wherein the data processing module culls invalid data and weights valid data according to the following equation:
wherein i represents a key index;
j denotes the jth stage;
n represents the total number of stages;
Virepresenting the effective voltage value obtained after the whole charging process corresponding to the key i is finished;
mi(j)a weighting coefficient representing a j-th stage;
Vtouch(j) a detection value representing the j-th stage of finger pressing;
Vrelease(j) a detection value indicating that no finger is pressed at the j-th stage;
if the interference extraction unit judges that the j stage has interference, the interference extraction unit makes V in the formula 2touch(j)-Vrelease(j) When the data is equal to 0, invalid data is removed; and weighting the effective data according to a formula 2 for a key judgment module to judge the effective value of the key.
10. A key detection method using multiple thresholds for segment comparisons, the method comprising:
charging a preset capacitor by using the charge moving circuit;
dividing the charging process of a preset capacitor into a plurality of stages, and carrying out detection in stages to obtain detection data;
performing interference judgment on the detection data of each stage, and dividing the detection data into valid data and invalid data;
eliminating invalid data, and performing weighting processing on the valid data; and
judging the effective value of the key according to the result after weighting processing;
wherein the charge transfer circuit includes:
the charging circuit comprises at least one charging capacitor, at least one key switch, a first switch, a second switch, a third switch and a preset capacitor, wherein the at least one key switch and the at least one charging capacitor are connected in series;
the second end of the at least one charging capacitor is coupled with the ground, and the first end of the at least one charging capacitor is coupled with the second end of the at least one key switch;
the first end of the first switch is coupled with the working voltage, and the second end of the first switch is coupled with the first end of the at least one key switch; the first end of the second switch is coupled with the first end of the at least one key switch, and the second end of the second switch is coupled with the first end of the preset capacitor; the first end of the third switch is coupled with the first end of the preset capacitor, and the second end of the third switch is coupled with the ground; the second end of the preset capacitor is coupled with the ground; the first end of the preset capacitor is coupled with the multi-stage detection circuit, and the voltage value of the first end of the preset capacitor is the voltage value of the preset capacitor and serves as the input of the multi-stage detection circuit.
11. The key detection method of claim 10, wherein the charging capacitance comprises a key parasitic capacitance; when no finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance of the key; when a finger touches the key, the equivalent capacitance of the charging capacitor is associated with the parasitic capacitance and the finger capacitance.
12. The key detection method of claim 10, wherein the interference determination comprises the steps of:
setting a reference value for each stage;
calculating the difference between the actual detection data of each stage and the detection data of the stage when no finger is pressed down; and
comparing the difference value with the reference value, judging whether interference exists in the stage according to whether the difference value between the difference value and the reference value exceeds a set range, regarding the detection data with the interference as invalid data, and regarding the detection data of other stages without the interference as valid data.
13. The key detecting method of claim 10, wherein the step of performing a staged detection by dividing the charging process of the predetermined capacitor into a plurality of stages to obtain the detection data comprises:
dividing the charging process of a preset capacitor into n stages, wherein each stage corresponds to a different comparison voltage threshold;
providing a first comparator, wherein the first comparator is provided with a positive input end and a negative input end, the input of the negative input end is the voltage value of a preset capacitor, the input of the positive input end is the comparison voltage threshold value, and the comparison voltage threshold value is continuously changed along with the change of stages;
when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
14. The key detecting method of claim 10, wherein the step of performing a staged detection by dividing the charging process of the predetermined capacitor into a plurality of stages to obtain the detection data comprises:
dividing the charging process of a preset capacitor into n stages, wherein each stage corresponds to a different comparison voltage threshold;
providing a first comparator and a second comparator, wherein the first comparator and the second comparator are respectively provided with a positive input end and a negative input end, the inputs of the negative input ends of the first comparator and the second comparator are both voltage values of a preset capacitor, the input of the positive input end of the first comparator is a comparison voltage threshold value corresponding to an odd-numbered stage, and the input of the positive input end of the second comparator is a comparison voltage threshold value corresponding to an even-numbered stage;
when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
15. The key detecting method of claim 10, wherein the step of performing a staged detection by dividing the charging process of the predetermined capacitor into a plurality of stages to obtain the detection data comprises:
dividing the charging process of a preset capacitor into n stages, wherein each stage corresponds to a different comparison voltage threshold;
providing n comparators each having a positive input terminal and a negative input terminal; each comparator corresponds to one stage; the input of the negative input end of each comparator is the voltage value of a preset capacitor, and the input of the positive input end of each comparator is the comparison voltage threshold value of the corresponding stage;
when the voltage value of the preset capacitor reaches the comparison voltage threshold value of the corresponding stage, the corresponding stage is considered to be finished, and the charging time of the corresponding stage is the detection data of the corresponding stage.
16. A key press detection method as claimed in any one of claims 13 to 15 wherein the step of culling invalid data and weighting valid data is performed according to the following equation:
wherein i represents a key index;
j denotes the jth stage;
n represents the total number of stages;
Tirepresenting a time effective value obtained after the whole charging process corresponding to the key i is finished;
ki(j) a weighting coefficient representing a j-th stage;
Ttouch(j) indicating the detection data when the finger is pressed at the j stage;
Trelease(j) detection data indicating that the finger is not pressed at the j-th stage;
wherein, if the interference judging steps judge that the j stage has interference, the T in the formula 1 is enabledtouch(j)-Trelease(j) When the data is equal to 0, invalid data is removed; and weighting the effective data according to the formula 1.
17. The key detecting method of claim 10, wherein the step of performing a staged detection by dividing the charging process of the predetermined capacitor into a plurality of stages to obtain the detection data comprises:
setting a fixed total charging time T, and dividing the total charging time T into n parts, namely dividing the charging process into n stages;
and providing an analog-to-digital converter, wherein the analog-to-digital converter acquires the voltage of the preset capacitor at regular intervals and takes the voltage as the detection data of each stage.
18. A key press detection method as claimed in claim 17 wherein the step of eliminating invalid data and weighting valid data is performed according to the following formula:
wherein i represents a key index;
j denotes the jth stage;
n represents the total number of stages;
Virepresenting the effective voltage value obtained after the whole charging process corresponding to the key i is finished;
mi(j) a weighting coefficient representing a j-th stage;
Vtouch(j) a detection value representing the j-th stage of finger pressing;
Vrelease(j) a detection value indicating that no finger is pressed at the j-th stage;
wherein, if the interference judging steps judge that the j stage has interference, the V in the formula 2 is enabledtouch(j)-Vrelease(j) When the data is equal to 0, invalid data is removed; and weighting the effective data according to the formula 2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911187916.1A CN110865258B (en) | 2019-11-28 | 2019-11-28 | Key detection circuit and key detection method for segmented comparison by using multiple thresholds |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911187916.1A CN110865258B (en) | 2019-11-28 | 2019-11-28 | Key detection circuit and key detection method for segmented comparison by using multiple thresholds |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110865258A CN110865258A (en) | 2020-03-06 |
CN110865258B true CN110865258B (en) | 2022-02-22 |
Family
ID=69656654
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911187916.1A Active CN110865258B (en) | 2019-11-28 | 2019-11-28 | Key detection circuit and key detection method for segmented comparison by using multiple thresholds |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110865258B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113466721B (en) * | 2021-08-31 | 2021-12-21 | 蜂巢能源科技有限公司 | Failure identification method and device for lithium ion battery, electronic equipment and medium |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2307407Y (en) * | 1997-06-26 | 1999-02-10 | 宝山钢铁(集团)公司 | Push-button keyboard detector |
CN1829100A (en) * | 2005-03-01 | 2006-09-06 | 华为技术有限公司 | Method and device for restraining narrowband interference |
CN101359034A (en) * | 2007-07-31 | 2009-02-04 | 华矽半导体股份有限公司 | Keyboard detection circuit and method thereof |
CN101843477A (en) * | 2009-03-25 | 2010-09-29 | 西铁城控股株式会社 | Biological signal measuring device |
CN101908875A (en) * | 2010-07-23 | 2010-12-08 | 中颖电子有限公司 | Key-judging method for capacitive touch keys |
CN103454949A (en) * | 2013-09-12 | 2013-12-18 | 南京信息工程大学 | Anti-interference self-adjusting microcontroller system and controlling method thereof |
CN103678059A (en) * | 2012-09-26 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Random key testing method and device |
CN104461151A (en) * | 2014-12-22 | 2015-03-25 | 西安中颖电子有限公司 | Touch screen detection method with low pressure and high signal-to-noise ratio |
CN105467428A (en) * | 2015-11-17 | 2016-04-06 | 南京航空航天大学 | Seismic wave warning method based on short-time energy detection and spectrum feature analysis |
CN105637374A (en) * | 2013-10-07 | 2016-06-01 | 赛普拉斯半导体公司 | Detect and differentiate touches from different size conductive objects on a capacitive button |
CN107786193A (en) * | 2017-08-28 | 2018-03-09 | 珠海格力电器股份有限公司 | Touch key detection method and device |
CN109245754A (en) * | 2018-11-27 | 2019-01-18 | 深圳市飞翼科技有限公司 | A kind of capacitance touch button circuit for detecting and method |
CN109450427A (en) * | 2018-10-31 | 2019-03-08 | 西安中颖电子有限公司 | A kind of high-performance touch key-press decision method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10605843B2 (en) * | 2017-08-15 | 2020-03-31 | Phoenix Motorcars LLC | Inverter open/short failure detection |
-
2019
- 2019-11-28 CN CN201911187916.1A patent/CN110865258B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2307407Y (en) * | 1997-06-26 | 1999-02-10 | 宝山钢铁(集团)公司 | Push-button keyboard detector |
CN1829100A (en) * | 2005-03-01 | 2006-09-06 | 华为技术有限公司 | Method and device for restraining narrowband interference |
CN101359034A (en) * | 2007-07-31 | 2009-02-04 | 华矽半导体股份有限公司 | Keyboard detection circuit and method thereof |
CN101843477A (en) * | 2009-03-25 | 2010-09-29 | 西铁城控股株式会社 | Biological signal measuring device |
CN101908875A (en) * | 2010-07-23 | 2010-12-08 | 中颖电子有限公司 | Key-judging method for capacitive touch keys |
CN103678059A (en) * | 2012-09-26 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Random key testing method and device |
CN103454949A (en) * | 2013-09-12 | 2013-12-18 | 南京信息工程大学 | Anti-interference self-adjusting microcontroller system and controlling method thereof |
CN105637374A (en) * | 2013-10-07 | 2016-06-01 | 赛普拉斯半导体公司 | Detect and differentiate touches from different size conductive objects on a capacitive button |
CN104461151A (en) * | 2014-12-22 | 2015-03-25 | 西安中颖电子有限公司 | Touch screen detection method with low pressure and high signal-to-noise ratio |
CN105467428A (en) * | 2015-11-17 | 2016-04-06 | 南京航空航天大学 | Seismic wave warning method based on short-time energy detection and spectrum feature analysis |
CN107786193A (en) * | 2017-08-28 | 2018-03-09 | 珠海格力电器股份有限公司 | Touch key detection method and device |
CN109450427A (en) * | 2018-10-31 | 2019-03-08 | 西安中颖电子有限公司 | A kind of high-performance touch key-press decision method |
CN109245754A (en) * | 2018-11-27 | 2019-01-18 | 深圳市飞翼科技有限公司 | A kind of capacitance touch button circuit for detecting and method |
Non-Patent Citations (3)
Title |
---|
"Casting Back Errant Stage in Multi-stage Manufacturing Process";Jiali Zhao;《2010 International Conference on Electrical and Control Engineering》;20101231;全文 * |
"基于STM32的蓄电池状态检测系统设计";宋易;《电子测试》;20180430;全文 * |
"基于充放电原理的电容式触摸按键设计";田野;《电子设计工程》;20101031;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110865258A (en) | 2020-03-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8674960B2 (en) | Detector circuit and detect method of a capacitive touch panel | |
CN100377055C (en) | Interpretation method for touch controlled induction system | |
US8487908B2 (en) | Detector circuit and detect method of a capacitive touch panel | |
CN1832349A (en) | Capacitor measuring touch sensing identifying method and implementing device | |
CN110865258B (en) | Key detection circuit and key detection method for segmented comparison by using multiple thresholds | |
WO2006132960B1 (en) | Methods and systems for detecting a capacitance using sigma-delta measurement techniques | |
CN112396007B (en) | Non-invasive three-threshold detection method and system for load sudden change event of residents | |
CN108333428B (en) | Insulation resistance measuring apparatus and method | |
CN107735691B (en) | A kind of method for quick predicting and its system of charging performance of battery | |
CN108696271B (en) | Sliding gesture recognition method and system based on capacitive touch keys | |
EP3791787A1 (en) | System and method for detecting steps with double validation | |
US8390576B2 (en) | Methods and apparatus for detecting user's touch on a touch panel | |
EP3726715A1 (en) | Fault detection in hybrid dc-dc power converters | |
CN115879048A (en) | Series arc fault identification method and system based on WRFMDA model | |
CN112795476A (en) | Nanopore sequencing circuit, sequencing method and device | |
CN105539363A (en) | Door handle module for vehicle and apparatus for locking and unlocking vehicle door including the module | |
CN114095009A (en) | High-efficiency touch detection circuit | |
EP3879225A1 (en) | User context and activity detection device and method | |
CN112763093B (en) | Temperature detection circuit and temperature detection method | |
CN117463506A (en) | Self-adaptive constant-current constant-voltage control high-voltage power supply | |
CN116185236B (en) | Spaced touch system with high anti-interference capability | |
CN101996014A (en) | Pressure detection method of touch sensing element and electronic device using same | |
CN106802293A (en) | waveform peak detection method and device | |
CN110798195A (en) | Differential touch detection circuit and touch judgment method adopting same | |
CN106201122A (en) | Contact panel and its control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |