CN110739952A - method for reducing interference between capacitive touch keys - Google Patents
method for reducing interference between capacitive touch keys Download PDFInfo
- Publication number
- CN110739952A CN110739952A CN201910972965.XA CN201910972965A CN110739952A CN 110739952 A CN110739952 A CN 110739952A CN 201910972965 A CN201910972965 A CN 201910972965A CN 110739952 A CN110739952 A CN 110739952A
- Authority
- CN
- China
- Prior art keywords
- key
- executing
- capacitive touch
- touch keys
- reducing interference
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K17/00—Electronic switching or gating, i.e. not by contact-making and –breaking
- H03K17/94—Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated
- H03K17/96—Touch switches
Abstract
A method for reducing interference among capacitive touch keys is characterized in that the anti-interference processing method comprises the following steps of , starting and initializing a program, secondly, judging whether other interrupt flag bits are set or not, if so, executing , if not, executing step IV, if not, entering other interrupt programs, fourthly, judging whether the interrupt flag bits of the keys are set or not, if so, executing , if not, executing step VI, entering the key interrupt program, if sixth, delaying time K, seventh, executing a key processing function, starting a key channel, and eighth, executing other programs, and then returning to the step II.
Description
Technical Field
The invention relates to capacitive touch keys, in particular to methods for reducing interference among capacitive touch keys.
Background
The basic principle of the capacitive touch key is charge transfer, as shown in fig. 3, which is a circuit control schematic diagram of a touch key in the prior art, a distributed capacitor Cp on the touch-sensitive key is formed by a finger-sensitive capacitor Cf and a circuit capacitor Cx, when the finger touches the touch key, the charge of the distributed capacitor Cp on the touch-sensitive key is transferred to a sensitivity adjustment capacitor Cadj until the voltage of the sensitivity adjustment capacitor Cadj reaches a reference voltage Vref, a comparator is inverted to generate a key interruption flag bit, and the charging time TKCNT is counted during the charge transfer.
In the using process, the fluctuation of the TKCNT can cause the touch key to be misjudged, the interference can be judged as a key possibly, and the anti-interference capability is poor.
In the prior art, anti-interference of a touch key is mainly solved in the following ways of , PCB wiring is optimized, filtering processing is added, whether the key is interfered or pressed is judged according to the pressing time of the key, and an interference detection channel is added, so that the key is pressed only when the sampling value of a key sampling channel reaches a set value under the condition that the sampling value of the interference detection channel is not interfered.
The method and the method II need to modify hardware, in actual engineering, the method needs to redraw a PCB for continuous verification, the method II needs to modify a schematic diagram and redraw the PCB, and does not need to debug a capacitance value for continuous verification, so the method and the method II need to spend a long time to solve the problem quickly and cannot solve the interference between keys, the method III can only process the interference which is not external interference but not from other key channels, and cannot solve the problem of poor interference resistance caused in principle, the method IV has a plurality of judgment levels and can really resist the interference, but if the judgment value of the interference is not set well enough, the anti-interference performance of the keys is too good, so that the keys have the condition of being pressed, and the problem of poor interference resistance caused in principle cannot be solved.
In summary, the existing touch key control method still has the above-mentioned various problems, and it is to be improved and improved steps for the anti-interference processing method of the capacitive touch key to improve the anti-interference capability.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide methods for effectively reducing interference between capacitive touch keys, aiming at the above-mentioned current state of the art, and the anti-interference processing method not only can solve the problem of external interference, but also can solve the problem of mutual interference between keys.
methods for reducing interference between capacitive touch keys, characterized in that the anti-interference processing method comprises the following steps:
step , starting the program, and initializing the setting;
step two, judging whether other interrupt flag bits are set, if so, executing a step , otherwise, executing a step four;
step three, entering other interrupt programs;
step four, judging whether the key interruption flag bit is set, if so, executing a step , otherwise, executing a step six;
step five, entering a key interruption program;
sixthly, delaying time K, wherein K is the discharge delay time of the sensitivity adjusting capacitor Cadj;
step seven, executing the key processing function and starting a lower key channel;
and step eight, executing other programs, and then returning to the step two.
Preferably, the key interruption procedure of step five includes the following steps:
(5-1) clearing the key interruption zone bit;
(5-2) starting a timer, and timing the key-press duration;
(5-3) judging whether the key pressing time length reaches the preset key pressing time length Tb, if so, pressing a key, and executing the step , otherwise, not pressing the key, and turning to the step six;
(5-4) resetting the timer and processing the key data;
and 5-5, obtaining the key value of the current key operation, and then executing the step six.
Preferably, in the step , the value range of the key press duration Tb preset in the step (5-3) is 50ms to 150 ms.
Preferably, the step four of determining whether the key interruption flag bit is set adopts the following method:
(4-1) whether the reference voltage on the sensitivity adjusting capacitor Cadj in the touch key circuit reaches a preset reference voltage Vref or not, if so, executing a step , otherwise, circulating the step;
and (4-2) reversing the comparator to generate a key interruption flag bit.
Preferably, in the step , the preset reference voltage Vref in the step (4-1) has a value range of 3V to 5V.
Considering that theoretically, the discharge voltage of the capacitor can reach 0V only when the time reaches infinity, and three bits (i.e., 0.001V to 0.009V) after the discharge voltage of the sensitivity adjustment capacitor Cadj reaches a decimal point of 0V are set as complete discharge in practice, preferably, the value range of the delay time K in the step six is as follows: k is more than or equal to ToverWherein, ToverFor adjusting sensitivityThe time that the capacitor Cadj is completely discharged, and ToverSatisfy the requirement ofAbove VtAdjusting the discharge voltage, V, of the capacitor Cadj for sensitivityrefIn order to generate the reference voltage of the key interruption zone bit, R is a discharge resistor, C is a discharge capacitor, and R and C jointly form a discharge circuit.
Compared with the prior art, the method has the advantages that the hardware structure is not changed, only the software is improved, a time delay link is set after the key interruption program is executed, the voltage on the sensitivity adjusting capacitor Cadj is ensured to be completely discharged, and then the lower key channel is opened, so that the initial voltage on the sensitivity adjusting capacitor Cadj is ensured to be when the current keys are started each time, the fluctuation of the charging time TKCNT is effectively reduced, the consumed time is short, the design cost is low, the problem of external interference from the keys can be solved, and the problem of mutual interference among the touch keys can be solved.
Drawings
Fig. 1 is a general flowchart of an anti-interference processing method according to an embodiment of the present invention.
Fig. 2 is a flowchart of a key interrupt processing procedure of the anti-interference processing method according to the embodiment of the present invention.
Fig. 3 is a schematic diagram of a touch key circuit in the prior art.
Detailed Description
The invention is described in further detail with reference to the following embodiments of the drawings.
The basic principle of the touch key is charge transfer, as shown in fig. 3, the distributed capacitance Cp on the touch sensing key is formed by the finger sensing capacitance Cf and the circuit capacitance Cx, the charge of the distributed capacitance Cp on the touch sensing key is transferred to the sensitivity adjustment capacitance Cadj in the process of touching the key, meanwhile, the timer counts the charging time TKCNT in the process of charge transfer until the voltage on the sensitivity adjustment capacitance Cadj reaches the preset reference voltage Vref, and the comparator is inverted to generate the interrupt flag bit.
When no key is pressed down, the distributed capacitance Cp is equal to the circuit capacitance Cx, and the time for transferring Cp charges to the sensitivity adjusting capacitance Cadj is the reference value of the charging time; when a key is pressed down, the distributed capacitance Cp is equal to the circuit capacitance Cx plus the finger sensing capacitance Cf; for reaching the same reference voltage Vref, the smaller the capacitance value of the distributed capacitance Cp, the longer the charging time, the larger the TKCNT value; the larger the value of the distributed capacitance Cp, the shorter the charging time, and accordingly, the smaller the value of TKCNT.
After the interrupt flag bit is generated, the interrupt program starts to read the charging time TKCNT, judges the variation of the charging time TKCNT value (namely the charging time TKCNT after the key is pressed is different from the charging time reference value when no key is pressed), starts the time counting of the pressed time duration of the key, considers that the key is pressed only when the variation of the charging time TKCNT reaches the set limit and the time duration reaches the preset time, and excludes the key touch possibly caused by external interference, so that the external interference resistance of the key is ensured, wherein the limit representing the pressed key can be set by the variation of the charging time TKCNT before and after the finger is pressed, so that the sensitivity of the key is ensured.
During the interruption process, the sensitivity adjusting capacitor Cadj is discharged, after the interruption process is completed, the lower key channels are opened, and the charge transfer is performed again, at this time, the charging initial voltage of the sensitivity adjusting capacitor Cadj is the voltage discharged last times, and the initial voltage is determined by the discharging time length of the sensitivity adjusting capacitor Cadj in the interruption process last times.
In order to avoid the fluctuation of the charging time TKCNT caused by the starting voltage of , this embodiment adopts a pure software control method, and methods for reducing the interference between the capacitive touch keys are designed, as shown in fig. 1 and fig. 2, the anti-interference processing method includes the following steps:
step , program start, initialize settings.
And step two, judging whether other interrupt flag bits are set or not, if so, executing a step , and if not, executing a step four.
And step three, entering other interrupt programs.
Step four, judging whether the key interruption flag bit is set, if so, executing a step , otherwise, executing a step six, wherein the method for judging whether the key interruption flag bit is set adopts the following method:
(4-1) whether the reference voltage on the sensitivity adjusting capacitor Cadj in the touch key circuit reaches a preset reference voltage Vref or not is judged, if so, the step is executed, and if not, the step is circulated, wherein the value range of the preset reference voltage Vref is 3V-5V;
and (4-2) reversing the comparator to generate a key interruption flag bit.
Step five, entering a key interruption program;
(5-1) clearing the key interruption zone bit;
(5-2) starting a timer, and timing the key-press duration;
(5-3) judging whether the key time duration reaches the preset key time duration Tb, if so, pressing the key, and executing the step , otherwise, pressing no key, and turning to the step six, wherein the value range of the preset key time duration Tb is 50-150 ms;
(5-4) resetting the timer and processing the key data;
and 5-5, obtaining the key value of the current key operation, and then executing the step six.
And step six, delaying time K, wherein K is the discharge delay time of the sensitivity adjusting capacitor Cadj.
And step seven, executing the key processing function and starting a lower key channel.
And step eight, executing other programs, and then returning to the step two.
In the present embodiment, a delay time K is set after the key interruption procedure, and the delay time K must satisfy the condition that the sensitivity adjustment capacitor Cadj is completely discharged, and generally, in the touch key circuit, adopts an RC discharge circuit as shown in fig. 3, and the RC discharge circuit satisfies the following formula:
Vt=Vref×exp(-Tover/RC)
wherein, VtAdjusting the discharge voltage, V, of the capacitor Cadj for sensitivityrefFor generating a reference voltage for the key-off flag, ToverAdjusting the time for the capacitor Cadj to completely discharge for sensitivity; r is a discharge resistor, C is a discharge capacitor, and R and C jointly form a discharge circuit.
As can be seen from the above formula, the discharge voltage of the sensitivity adjustment capacitor Cadj can reach 0V only when the time reaches infinity, and the discharge voltage V of the sensitivity adjustment capacitor Cadj is set in practicetThe value of 0.001V to 0.009V is complete discharge (the number of digits after the decimal point can be adjusted according to the precision requirement, and three digits after the decimal point are taken in the embodiment);
thus, when ToverSatisfies the following conditions:when the time is over, the sensitivity adjusting capacitor Cadj is considered to be completely discharged, and the value range of the delay time K is only required to satisfy that K is more than or equal to ToverThe complete discharge of the sensitivity adjustment capacitor Cadj can be ensured.
According to the embodiment, a hardware structure does not need to be changed, the consumed time is short, the design cost is low, improvement is performed on software, after each time of key interruption program execution, the delay time K is further executed, and the voltage on the sensitivity adjusting capacitor Cadj is ensured to be completely discharged, so that the discharge voltage of the sensitivity adjusting capacitor Cadj is ensured to be the same, the initial voltage of times of key starting is , the fluctuation of the charging time TKCNT is effectively reduced, the problem of external interference of keys can be solved, the problem of mutual interference among touch keys can be solved, and the whole control method is simple and easy to implement.
Claims (6)
1, A method for reducing interference between capacitive touch keys, characterized in that, the anti-interference processing method includes the following steps:
step , starting the program, and initializing the setting;
step two, judging whether other interrupt flag bits are set, if so, executing a step , otherwise, executing a step four;
step three, entering other interrupt programs;
step four, judging whether the key interruption flag bit is set, if so, executing a step , otherwise, executing a step six;
step five, entering a key interruption program;
sixthly, delaying time K, wherein K is the discharge delay time of the sensitivity adjusting capacitor Cadj;
step seven, executing the key processing function and starting a lower key channel;
and step eight, executing other programs, and then returning to the step two.
2. The method of reducing interference between capacitive touch keys of claim 1, wherein: the key interruption program of the fifth step comprises the following steps:
(5-1) clearing the key interruption zone bit;
(5-2) starting a timer, and timing the key-press duration;
(5-3) judging whether the key pressing time length reaches the preset key pressing time length Tb, if so, pressing a key, and executing the step , otherwise, not pressing the key, and turning to the step six;
(5-4) resetting the timer and processing the key data;
and 5-5, obtaining the key value of the current key operation, and then executing the step six.
3. The method of reducing interference between capacitive touch keys of claim 2, wherein: and (5) the value range of the preset key pressing time Tb in the step (5-3) is 50 ms-150 ms.
4. The method of reducing interference between capacitive touch keys of claim 1, wherein: in the fourth step, the following method is adopted for judging whether the key interruption flag bit is set:
(4-1) whether the reference voltage on the sensitivity adjusting capacitor Cadj in the touch key circuit reaches a preset reference voltage Vref or not, if so, executing a step , otherwise, circulating the step;
and (4-2) reversing the comparator to generate a key interruption flag bit.
5. The method of reducing interference between capacitive touch keys of claim 4, wherein: the value range of the preset reference voltage Vref in the step (4-1) is 3V-5V.
6. The method of reducing interference between capacitive touch keys of claim 1, wherein: the value range of the delay time K in the sixth step is as follows: k is more than or equal to ToverWherein, ToverThe time for which the capacitor Cadj is completely discharged is adjusted for sensitivity, and ToverSatisfy the requirement ofAbove VtAdjusting the discharge voltage, V, of the capacitor Cadj for sensitivityrefIn order to generate the reference voltage of the key interruption zone bit, R is a discharge resistor, C is a discharge capacitor, and R and C jointly form a discharge circuit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910972965.XA CN110739952A (en) | 2019-10-14 | 2019-10-14 | method for reducing interference between capacitive touch keys |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910972965.XA CN110739952A (en) | 2019-10-14 | 2019-10-14 | method for reducing interference between capacitive touch keys |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110739952A true CN110739952A (en) | 2020-01-31 |
Family
ID=69269925
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910972965.XA Pending CN110739952A (en) | 2019-10-14 | 2019-10-14 | method for reducing interference between capacitive touch keys |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110739952A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101060321A (en) * | 2006-04-19 | 2007-10-24 | 北京希格玛和芯微电子技术有限公司 | Charge transport device, touch induction device and method |
US20120001678A1 (en) * | 2010-06-30 | 2012-01-05 | Holtek Semiconductor Inc. | Capacitive touching apparatus |
CN103616970A (en) * | 2013-11-07 | 2014-03-05 | 华为终端有限公司 | Touch response method and device |
CN104104375A (en) * | 2014-06-25 | 2014-10-15 | 无锡中微爱芯电子有限公司 | Method for enhancing mobile phone interference resistance of capacitive touch button and circuit thereof |
CN109039321A (en) * | 2018-10-15 | 2018-12-18 | 湖南品腾电子科技有限公司 | A kind of touch button device and sensitivity automatic adjusting method |
CN109039319A (en) * | 2018-08-13 | 2018-12-18 | 中科芯集成电路股份有限公司 | A kind of anti-interference capacitor formula touch key-press controller and implementation method |
CN110324033A (en) * | 2019-06-20 | 2019-10-11 | 杭州九阳小家电有限公司 | The key response method of cooking apparatus |
-
2019
- 2019-10-14 CN CN201910972965.XA patent/CN110739952A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101060321A (en) * | 2006-04-19 | 2007-10-24 | 北京希格玛和芯微电子技术有限公司 | Charge transport device, touch induction device and method |
US20120001678A1 (en) * | 2010-06-30 | 2012-01-05 | Holtek Semiconductor Inc. | Capacitive touching apparatus |
CN103616970A (en) * | 2013-11-07 | 2014-03-05 | 华为终端有限公司 | Touch response method and device |
CN104104375A (en) * | 2014-06-25 | 2014-10-15 | 无锡中微爱芯电子有限公司 | Method for enhancing mobile phone interference resistance of capacitive touch button and circuit thereof |
CN109039319A (en) * | 2018-08-13 | 2018-12-18 | 中科芯集成电路股份有限公司 | A kind of anti-interference capacitor formula touch key-press controller and implementation method |
CN109039321A (en) * | 2018-10-15 | 2018-12-18 | 湖南品腾电子科技有限公司 | A kind of touch button device and sensitivity automatic adjusting method |
CN110324033A (en) * | 2019-06-20 | 2019-10-11 | 杭州九阳小家电有限公司 | The key response method of cooking apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103109196B (en) | Method and device for sensing capacitance change and method and device for sensing touch | |
JP4981120B2 (en) | Method and related apparatus for detecting a touch event on a touch panel | |
US8179380B2 (en) | Method and apparatus for implementing a capacitive touch slider | |
US7230548B2 (en) | Method and apparatus for high performance key detection with key debounce | |
US20100051354A1 (en) | Capacitive touch sensor system | |
CN103389847B (en) | Touch control terminal and anti-interference method and system thereof | |
US20120256870A1 (en) | Stimulus signal for a capacitive sense array | |
CN109274363B (en) | Key judging system of capacitive touch key | |
CN1148914A (en) | Capacitance-sensitive switch and switch array | |
US9886136B2 (en) | Touch screen controller using adaptive filter control and touch screen system having the same | |
CN107040260B (en) | Asynchronous successive approximation type analog-to-digital conversion circuit | |
CN109039319B (en) | Anti-interference capacitive touch key controller and implementation method | |
US8378987B2 (en) | Sensing method and circuit for a capacitive touch panel | |
CN110739952A (en) | method for reducing interference between capacitive touch keys | |
CN104184449A (en) | Capacitive touch control apparatus, method, and system | |
CN109088619B (en) | Method and circuit for generating enable signal | |
CN111026286A (en) | Anti-interference processing method for capacitive touch keys | |
US9285932B1 (en) | Negative touch recovery for mutual capacitance scanning systems | |
CN111555736B (en) | Monostable trigger of hybrid circuit and control method thereof | |
CN107340872B (en) | Key system and control method thereof | |
CN208723872U (en) | A kind of capacitance touch button circuit | |
US9891758B2 (en) | Zoom gesture determination method and touch control chip | |
KR102548588B1 (en) | Touch screen controller using adaptive filter control and touch screen system haing the same | |
CN107305442B (en) | Input device and control method thereof | |
CN113422597B (en) | Touch key value self-adapting circuit and 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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200131 |