CN109428578B - Capacitive touch key anti-interference detection device and detection method - Google Patents

Capacitive touch key anti-interference detection device and detection method Download PDF

Info

Publication number
CN109428578B
CN109428578B CN201811463711.7A CN201811463711A CN109428578B CN 109428578 B CN109428578 B CN 109428578B CN 201811463711 A CN201811463711 A CN 201811463711A CN 109428578 B CN109428578 B CN 109428578B
Authority
CN
China
Prior art keywords
value
unit
sampling
timing
baseline value
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
Application number
CN201811463711.7A
Other languages
Chinese (zh)
Other versions
CN109428578A (en
Inventor
王浩远
陈文捷
曾培楷
邓宇斌
朱利富
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Jusheng Technology Co ltd
Original Assignee
Zhuhai Jusheng Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhuhai Jusheng Technology Co ltd filed Critical Zhuhai Jusheng Technology Co ltd
Priority to CN201811463711.7A priority Critical patent/CN109428578B/en
Publication of CN109428578A publication Critical patent/CN109428578A/en
Application granted granted Critical
Publication of CN109428578B publication Critical patent/CN109428578B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K17/00Electronic switching or gating, i.e. not by contact-making and –breaking
    • H03K17/94Electronic switching or gating, i.e. not by contact-making and –breaking characterised by the way in which the control signals are generated
    • H03K17/96Touch switches
    • H03K17/962Capacitive touch switches
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K17/00Electronic switching or gating, i.e. not by contact-making and –breaking
    • H03K17/16Modifications for eliminating interference voltages or currents
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K2217/00Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00
    • H03K2217/94Indexing scheme related to electronic switching or gating, i.e. not by contact-making or -breaking covered by H03K17/00 characterised by the way in which the control signal is generated
    • H03K2217/96Touch switches
    • H03K2217/9607Capacitive touch switches
    • H03K2217/96071Capacitive touch switches characterised by the detection principle
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses an anti-interference detection device and a detection method for a capacitive touch key, wherein the detection device comprises a timing sampling unit, a key detection unit, a baseline value updating unit, a third switch and a fourth switch; the sampling value output end of the timing sampling unit is connected with the input end of the third switch, the input end of the fourth switch and the input end of the key detection unit; the output end of the third switch is connected with the input end of the baseline value detection unit; the output end of the key detection unit is connected with the control signal input end of the third switch; the output end of the baseline value detection unit is connected with the control signal input end of the fourth switch; the output end of the fourth switch is connected with the input end of the baseline value updating unit; when the sampling value is larger than the baseline value boundary, the baseline value detection device of the invention needs to update the reference value only when the frequency of the sampling value larger than the baseline value boundary reaches the baseline value confirmation frequency, thereby reducing the risk of error update of the reference value caused by environmental interference.

Description

Capacitive touch key anti-interference detection device and detection method
[ technical field ]
The invention relates to the technical field of touch keys, in particular to an anti-interference detection device and method for a capacitive touch key.
Background art
In recent years, with the widespread use of touch technology, various types of keys are widely used in various electronic products. The capacitive touch key is the most commonly used touch key, whether the touch action is generated is judged by detecting the change of the capacitance value on the capacitive touch key, the detected capacitance value is compared with a baseline value, and the baseline value is updated along with the environmental change.
The invention application with publication number of CN104935320A discloses a detection method of a capacitive touch key state, wherein whether the capacitive touch key is effectively touched is judged by comparing the current count value of a counter with a base line value and analyzing the change amount of the current count value relative to the base line value and the duration time of the change amount. In addition, when the variation of the current count value relative to the baseline value is larger than the baseline variation threshold and smaller than the key response threshold, the baseline value needs to be updated, namely, the baseline value is influenced by the environmental temperature variation through setting the baseline variation threshold and the key response threshold, so that the baseline value is updated when the environmental temperature varies, the interference capability of resisting the environmental temperature is improved, and the detection precision is improved.
Although the above detection method can update the baseline value, the following problems still remain: environmental disturbances result in variations greater than the baseline variation threshold, resulting in false updates of the baseline value.
Summary of the invention
The first objective of the present invention is to provide a capacitive touch key anti-interference detection device, which reduces the influence of external environment interference on baseline value update.
In order to achieve the first object, the present invention provides the following technical solutions:
the capacitive touch key anti-interference detection device comprises a timing sampling unit, a key detection unit, a baseline value updating unit, a third switch and a fourth switch; the sampling value output end of the timing sampling unit is connected with the input end of the third switch, the input end of the fourth switch and the input end of the key detection unit; the output end of the third switch is connected with the input end of the baseline value detection unit; the output end of the key detection unit is connected with the control signal input end of the third switch; the output end of the baseline value detection unit is connected with the control signal input end of the fourth switch; the output end of the fourth switch is connected with the input end of the baseline value updating unit;
The timing sampling unit scans the capacitive touch keys and outputs sampling values; the key detection unit is used for detecting whether the sampling value output by the timing sampling unit is larger than a key threshold value or not, and controlling the third switch to be disconnected when the sampling value is larger than the key threshold value; the baseline value detection unit is used for detecting whether a sampling value output by the third switch is larger than a baseline value boundary or not, and controlling the fourth switch to be closed when the sampling value is smaller than or equal to the baseline value boundary or the number of times that the sampling value is larger than the baseline value boundary exceeds the baseline value confirmation number of times; and the baseline value updating unit receives the sampling value output by the fourth switch and updates the baseline value.
As a specific embodiment, the baseline value detection unit includes an eighth comparator, a ninth comparator, a tenth comparator, a second counter, and a first baseline value update determination unit; two input ends of the eighth comparator respectively receive the baseline value boundary and the sampling value output by the third switch; the output end of the eighth comparator is connected with the trigger signal input end of the second counter; the output end of the second counter is connected with one input end of the tenth comparator, and the other input end of the tenth comparator receives the base line value confirmation times; two input ends of the ninth comparator respectively receive the baseline value boundary and the sampling value output by the third switch; the output end of the ninth comparator and the output end of the tenth comparator are respectively connected with the two input ends of the first baseline value updating judging unit;
The eighth comparator is used for judging whether the sampling value exceeds a baseline value boundary or not, and triggering the second counter to count when the sampling value is larger than the baseline value boundary; the tenth comparator is used for judging whether the count value output by the second counter reaches the base line value confirmation times or not; the ninth comparator is configured to determine whether the sampling value exceeds a baseline value boundary; and when the tenth comparator judges that the count value output by the second counter reaches the baseline value confirmation number, or the ninth comparator judges that the sampling value is smaller than the baseline value boundary, the first baseline value updating judgment unit controls the fourth switch to be closed.
As a specific implementation manner, the first baseline value update judging unit is a second or gate; when the sampling value is greater than the baseline value boundary and the count value reaches the baseline value confirmation times, the tenth comparator outputs a high level; when the sampling value is smaller than or equal to a base line value boundary, the ninth comparator outputs a high level; when the second OR gate outputs high level, the fourth switch is closed;
or, the first baseline value updating judging unit is a second AND gate; when the sampling value is greater than the baseline value boundary and the count value reaches the baseline value confirmation times, the tenth comparator outputs a low level; when the sampling value is smaller than or equal to a base line value boundary, the ninth comparator outputs a low level; and when the second AND gate outputs low level, the fourth switch is closed.
As a specific embodiment, the key detection unit includes a sixth comparator; the two input ends of the sixth comparator respectively receive a key threshold value and a sampling value, and the sixth comparator compares the sampling value with the key threshold value; and when the sampling value is larger than the key threshold value, the sixth comparator controls the third switch to be disconnected.
As a specific embodiment, the key detection unit further includes a seventh comparator and a first counter; the trigger signal input end of the first counter is connected with the output end of the sixth comparator; the two input ends of the seventh comparator respectively receive the key confirmation times and the count value output by the first counter, and the output end outputs a key control signal; the sixth comparator triggers the first counter to count when the sampling value is larger than the key threshold value; the seventh comparator is configured to determine whether the count value output by the first counter reaches a key confirmation number, and output a key control signal when the count value reaches the key confirmation number, so as to control execution of key operation.
Further, when the sampling value is greater than the key threshold, the sixth comparator outputs high level/low level to trigger the first counter to count; and when the count value output by the first counter reaches the key confirmation times, the key control signal output by the seventh comparator is high level/low level, and the key operation is controlled to be executed.
Further, the detection device further comprises a timing unit and a baseline value update judging unit; the baseline value update determination unit is connected between the baseline value detection unit and the fourth switch; the two input ends of the baseline value updating judging unit are respectively connected with the output end of the baseline value detecting unit and the output end of the timing unit, and the output end is connected with the control signal input end of the fourth switch; the timing unit is used for judging whether the timing time is reached; the baseline value update judging unit is used for controlling the fourth switch to be closed or opened;
and when the baseline value detection unit detects that the sampling value output by the third switch is smaller than or equal to the baseline value boundary or the sampling value is larger than the baseline value boundary, the number of times exceeds the baseline value confirmation number, and the timing unit judges that the timing time is reached, the baseline value update judgment unit controls the fourth switch to be closed.
As a specific embodiment, the baseline value update determining unit is a first and gate, and when the baseline value detecting unit detects that the sampling value output by the third switch is less than or equal to a baseline value boundary or the number of times that the sampling value is greater than the baseline value boundary exceeds a baseline value confirmation number of times, the baseline value detecting unit outputs a high level; when the timing unit judges that the timing time is reached, the timing unit outputs a high level; when the first AND gate outputs a high level, the fourth switch is closed;
Or, the baseline value updating judging unit is a first or gate, and when the baseline value detecting unit detects that the sampling value output by the third switch is smaller than or equal to a baseline value boundary or the frequency of the sampling value being larger than the baseline value boundary exceeds the baseline value confirmation frequency, the baseline value detecting unit outputs a low level; when the timing unit judges that the timing time is reached, the timing unit outputs a low level; the fourth switch is closed when the first or gate outputs a low level.
Further, the detection device further comprises a sampling control unit; the input end of the sampling control unit receives the sampling value, and the output end outputs a sampling control signal to the control signal input end of the timing sampling unit for connection; the control signal output end of the timing sampling unit is connected with the control signal input end of the timing unit; the sampling control unit is used for judging whether the sampling value is smaller than a base line value or not, and controlling the timing sampling unit to accelerate the sampling rate when the sampling value is smaller than the base line value; when the timing sampling unit accelerates the sampling rate, the timing sampling unit controls the timing unit to shorten the timing time.
As a specific embodiment, the timing unit includes a timer, a third counter, a timing decision condition generating unit, and an eleventh comparator; the output end of the timer is connected with the input end of the third counter, the third counter counts the timer and outputs the counted value to one input end of the eleventh comparator; the input end of the timing judgment condition generating unit receives the timing control signal output by the timing sampling unit, and the output end outputs the timing judgment condition to the other input end of the eleventh comparator; the eleventh comparator is configured to determine whether the timer reaches a timing decision condition; the timing sampling unit shortens the timing time of the timing unit by controlling the timing decision condition generating unit to reduce the value of the timing decision condition.
Further, the detection device further comprises a noise detection unit and a fifth switch; the fifth switch is connected between the output end of the timing sampling unit and the input end of the sampling control unit; the input end of the noise detection unit is connected with the output end of the timing sampling unit, and the output end of the noise detection unit is connected with the control signal input end of the fifth switch; the noise detection unit is used for judging whether the sampling value output by the timing sampling unit is larger than a noise threshold value or not, and controlling the fifth switch to be switched off when the difference value is larger than the noise threshold value.
Further, the detection device further comprises a noise detection unit and a second switch; the second switch is connected between the output end of the timing sampling unit and the input end of the key detection unit; the input end of the noise detection unit is connected with the output end of the timing sampling unit, and the output end of the noise detection unit is connected with the control signal input end of the second switch; the noise detection unit is used for judging whether the sampling value output by the timing sampling unit is larger than a noise threshold value or not, and controlling the second switch to be switched off when the difference value is larger than the noise threshold value.
Further, the detection device further comprises a sampling value stability judging unit and a first switch; the first switch is connected between the output end of the timing sampling unit and the common ends of the third switch, the fourth switch and the key detection unit; the input end of the sampling value stability judging unit is connected with the output end of the timing sampling unit, and the output end of the sampling value stability judging unit is connected with the control signal input end of the second switch; the sampling value stability judging unit is used for judging whether the difference value between the maximum sampling value and the minimum sampling value in the plurality of sampling values output by the timing sampling unit is larger than a preset difference value or not, and controlling the first switch to be switched off when the difference value is larger than the preset difference value.
Further, the detection device further comprises an average filtering unit; the average filtering unit is connected between the output end of the timing sampling unit and the common ends of the third switch, the fourth switch and the key detection unit; and the average filtering unit averages the sampling values output by the timing sampling unit and outputs the average sampling values to the third switch, the fourth switch and the key detection unit.
Further, the detection device further comprises a digital filtering unit; the digital filtering unit is connected between the output end of the timing sampling unit and the common ends of the third switch, the fourth switch and the key detection unit; the digital filtering unit carries out digital filtering on the sampling value output by the timing sampling unit and outputs a filtered sampling value to the third switch, the fourth switch and the key detection unit.
As a specific embodiment, the digital filtering unit comprises a first multiplier and a second multiplierThe second multiplier, the first adder and the filter sampling value register; the two input ends of the first multiplier respectively receive average sampling values and a first multiplication factor of 1/K, K=2 q Q is a positive integer; the output end of the first multiplier and the output end of the second multiplier are respectively connected with two input ends of the first adder; the output end of the first adder is connected with the input end of the filtering sampling value register; one input end of the second multiplier receives a second multiplication factor (K-1)/K, the other input end of the second multiplier is connected with the output end of the filtering sampling value register, and the filtering sampling value register feeds back the last filtering result to the second multiplier and outputs a filtering sampling value through multiple times of filtering.
Further, the detection device further comprises a sampling value stability judging unit, an average filtering unit, a digital filtering unit, a noise detecting unit, a timing unit, a baseline value updating judging unit, a first switch, a second switch and a fifth switch; the sampling value output end of the timing sampling unit is connected with the input end of the sampling value stability judging unit and the input end of the first switch; the output end of the sampling value stability judging unit is connected with the control signal input end of the first switch; the output end of the first switch is connected with the input end of the average filtering unit; the output end of the average filtering unit is connected with the input end of the digital filtering unit and the input end of the noise detection unit; the output end of the digital filtering unit is connected with the input ends of the second switch, the third switch, the fourth switch and the fifth switch; the output end of the second switch is connected with the input end of the key detection unit; the output end of the fifth switch is connected with the input end of the sampling control unit; the output end of the noise detection unit is connected with the control signal input ends of the second switch and the fifth switch; the two input ends of the baseline value updating judging unit are respectively connected with the output end of the baseline value detecting unit and the output end of the timing unit, and the output end is connected with the control signal input end of the fourth switch; the timing unit is used for judging whether the timing time is reached; the baseline value update judging unit is used for controlling the fourth switch to be closed or opened; the control signal output end of the timing sampling unit is connected with the control signal input end of the timing unit;
The sampling value stability judging unit is used for judging whether the difference value between the maximum sampling value and the minimum sampling value in the plurality of sampling values output by the timing sampling unit is larger than a preset difference value or not, and controlling the first switch to be switched off when the difference value is larger than the preset difference value; the average filtering unit averages the sampling values output by the timing sampling unit and outputs the average sampling values to the digital filtering unit and the noise detection unit; the digital filtering unit carries out digital filtering on the average sampling value output by the average filtering unit and outputs a filtered sampling value to the second switch; the noise detection unit is used for detecting whether the average sampling value output by the average filtering unit exceeds a noise threshold value or not, and controlling the second switch to be disconnected when the average sampling value exceeds the noise threshold value; the key detection unit is further used for detecting whether the filtering sampling value output by the second switch is larger than a key threshold value or not, and controlling to execute key operation when the number of times that the filtering sampling value is larger than the key threshold value exceeds the key confirmation number of times; the sampling control unit is used for judging whether the filtering sampling value is smaller than the baseline value or not, and controlling the timing sampling unit to accelerate the sampling rate when the filtering sampling value is smaller than the baseline value; when the timing sampling unit accelerates the sampling rate, the timing sampling unit controls the timing unit to shorten the timing time.
The second objective of the present invention is to provide a capacitive touch key anti-interference detection method, which reduces the influence of external environment interference on baseline value update.
In order to achieve the second object, the present invention provides the following technical solutions:
a capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) setting a key threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key; (5) The timing sampling unit outputs a sampling value to the key detection unit; (6) The key detection unit detects whether the sampling value is larger than a key threshold value, if so, the step (7) is carried out, and if not, the step (8) is carried out; (7) The baseline value detection unit does not receive the sampling value output by the timing sampling unit, and the step (14) is performed; (8) The baseline value detection unit receives the sampling value output by the timing sampling unit; (9) The baseline value detection unit detects whether the sampling value is larger than a baseline value boundary, if so, the step (10) is carried out, and if not, the step (11) is carried out; (10) The base line value detection unit detects whether the times of the sampling value being larger than the base line value boundary reach the base line value confirmation times, if so, the step (11) is carried out, and if not, the step (13) is carried out; (11) The baseline value updating unit receives the sampling value output by the timing sampling unit; (12) The baseline value updating unit updates the baseline value and returns to the step (4); (13) The baseline value updating unit does not receive the sampling value output by the timing sampling unit; (14) The baseline value updating unit does not update the baseline value, and returns to step (4).
A capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) setting a key threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key; (5) The timing sampling unit outputs a sampling value to the key detection unit; (6) The key detection unit detects whether the sampling value is larger than a key threshold value, if so, the step (7) and the step (15) are carried out; if not, go to step (8) and step (17); (7) The baseline value detection unit does not receive the sampling value output by the timing sampling unit, and the step (14) is performed; (8) The baseline value detection unit receives the sampling value output by the timing sampling unit; (9) The baseline value detection unit detects whether the sampling value is larger than a baseline value boundary, if so, the step (10) is carried out, and if not, the step (11) is carried out; (10) The base line value detection unit detects whether the times of the sampling value being larger than the base line value boundary reach the base line value confirmation times, if so, the step (11) is carried out, and if not, the step (13) is carried out; (11) The baseline value updating unit receives the sampling value output by the timing sampling unit; (12) The baseline value updating unit updates the baseline value and returns to the step (4); (13) The baseline value updating unit does not receive the sampling value output by the timing sampling unit; (14) The baseline value updating unit does not update the baseline value and returns to the step (4); (15) The key detection unit detects whether the number of times that the sampling value is larger than the key threshold reaches the key confirmation number of times, if so, the step (16) is carried out, and if not, the step (17) is carried out; (16) The key operation unit executes key operation and returns to the step (4); (17) The key operation unit does not execute the key operation and returns to the step (4).
A capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) setting a key threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key; (5) The timing sampling unit outputs a sampling value to the key detection unit; (6) The key detection unit detects whether the sampling value is larger than a key threshold value, if so, the step (7) is carried out, and if not, the step (8) is carried out; (7) The baseline value detection unit does not receive the sampling value output by the timing sampling unit, and the step (15) is entered; (8) The baseline value detection unit receives the sampling value output by the timing sampling unit; (9) The baseline value detection unit detects whether the sampling value is larger than a baseline value boundary, if so, the step (10) is carried out, and if not, the step (11) is carried out; (10) The base line value detection unit detects whether the times of the sampling value being larger than the base line value boundary reach the base line value confirmation times, if so, the step (11) is carried out, and if not, the step (12) is carried out; (11) If the timing unit reaches the timing time, the step (12) is carried out, and if not, the step (14) is carried out; (12) The baseline value updating unit receives the sampling value output by the timing sampling unit; (13) The baseline value updating unit updates the baseline value and returns to the step (4); (14) The baseline value updating unit does not receive the sampling value output by the timing sampling unit; (15) The baseline value updating unit does not update the baseline value, and returns to step (4).
A capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) setting a key threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain the capacitance value of the touch key, and the step (5) and the step (16) are carried out; (5) The timing sampling unit outputs a sampling value to the key detection unit; (6) The key detection unit detects whether the sampling value is larger than a key threshold value, if so, the step (7) is carried out, and if not, the step (8) is carried out; (7) The baseline value detection unit does not receive the sampling value output by the timing sampling unit, and the step (15) is entered; (8) The baseline value detection unit receives the sampling value output by the timing sampling unit; (9) The baseline value detection unit detects whether the sampling value is larger than a baseline value boundary, if so, the step (10) is carried out, and if not, the step (11) is carried out; (10) The baseline value detection unit detects whether the times of the sampling value being larger than the baseline value boundary reach the baseline value confirmation times, if so, the step (11) is carried out, and if not, the step (14) is carried out; (11) If the timing unit reaches the timing time, the step (12) is carried out, and if not, the step (14) is carried out; (12) The baseline value updating unit receives the sampling value output by the timing sampling unit; (13) The baseline value updating unit updates the baseline value and returns to the step (4); (14) The baseline value updating unit does not receive the sampling value output by the timing sampling unit; (15) The baseline value updating unit does not update the baseline value and returns to the step (4); (16) The timing sampling unit outputs a sampling value to the sampling control unit; (17) The sampling control unit detects whether the sampling value is smaller than the baseline value, if yes, the step (18) is carried out, if not, the step (4) is returned; (18) The timing sampling unit increases the sampling rate and returns to the step (4); (19) The timing unit shortens the timing time and returns to step (11).
A capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) Setting a key threshold, a noise threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key; (5) The timing sampling unit outputs a sampling value to the noise detection unit; (6) The noise detection unit detects whether the sampling value is larger than a noise threshold value, if so, the step (7) is carried out, and if not, the step (8) and the step (19) are carried out; (7) The key detection unit and the sampling control unit do not receive the output sampling value of the timing sampling unit; (8) The key detection unit receives the sampling value output by the timing sampling unit; (9) The key detection unit detects whether the sampling value is larger than a key threshold value, if so, the step (10) is carried out, and if not, the step (11) is carried out; (10) The baseline value detection unit does not receive the sampling value output by the timing sampling unit; (11) The baseline value detection unit receives the sampling value output by the timing sampling unit; (12) The baseline value detection unit detects whether the sampling value is larger than a baseline value boundary, if so, the step (13) is carried out, and if not, the step (14) is carried out; (13) The baseline value detection unit detects whether the times of the sampling value being larger than the baseline value boundary reach the baseline value confirmation times, if so, the step (14) is carried out, and if not, the step (17) is carried out; (14) If the timing unit reaches the timing time, the step (15) is carried out, and if not, the step (17) is carried out; (15) The baseline value updating unit receives the sampling value output by the timing sampling unit; (16) The baseline value updating unit updates the baseline value and returns to the step (4); (17) The baseline value updating unit does not receive the sampling value output by the timing sampling unit; (18) The baseline value updating unit does not update the baseline value and returns to the step (4); (19) The sampling control unit receives the sampling value output by the timing sampling unit; (20) The sampling control unit detects whether the sampling value is smaller than the baseline value, if yes, the step (21) is carried out, and if not, the step (4) is returned; (21) The timing sampling unit increases the sampling rate and returns to the step (4); (22) The timing unit shortens the timing time and returns to step (14).
A capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) Setting a key threshold, a noise threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key; (5) The timing sampling unit outputs a sampling value to the noise detection unit; (6) The noise detection unit detects whether the sampling value is larger than a noise threshold value, if so, the step (7) is carried out, and if not, the step (8) is carried out; (7) The key detection unit does not receive the sampling value output by the timing sampling unit, and returns to the step (4); (8) The key detection unit receives the sampling value output by the timing sampling unit; (9) The key detection unit detects whether the sampling value is larger than a key threshold value, if so, the step (10) is carried out, and if not, the step (11) is carried out; (10) The baseline value detection unit does not receive the sampling value output by the timing sampling unit, and the step (17) is entered; (11) The baseline value detection unit receives the sampling value output by the timing sampling unit; (12) The baseline value detection unit detects whether the sampling value is larger than a baseline value boundary, if so, the step (13) is carried out, and if not, the step (14) is carried out; (13) The baseline value detection unit detects whether the times of the sampling value being larger than the baseline value boundary reach the baseline value confirmation times, if so, the step (14) is carried out, and if not, the step (16) is carried out; (14) The baseline value updating unit receives the sampling value output by the timing sampling unit; (15) The baseline value updating unit updates the baseline value and returns to the step (4); (16) The baseline value updating unit does not receive the sampling value output by the timing sampling unit; (17) The baseline value updating unit does not update the baseline value, and returns to step (4).
A capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) setting a key threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key; (5) The timing sampling unit outputs a plurality of sampling values to the sampling value stability judging unit; (6) The sampling value stability judging unit judges whether the difference value between the maximum sampling value and the minimum sampling value in the sampling values is larger than a preset difference value, if so, the step (7) is carried out, and if not, the step (8) is carried out; (7) The key detection unit does not receive the sampling value output by the timing sampling unit, and returns to the step (4); (8) The key detection unit receives the sampling value output by the timing sampling unit; (9) The key detection unit detects whether the sampling value is larger than a key threshold value, if so, the step (10) is carried out, and if not, the step (11) is carried out; (10) The baseline value detection unit does not receive the sampling value output by the timing sampling unit, and the step (17) is entered; (11) The baseline value detection unit receives the sampling value output by the timing sampling unit; (12) The baseline value detection unit detects whether the sampling value is larger than a baseline value boundary, if so, the step (13) is carried out, and if not, the step (14) is carried out; (13) The baseline value detection unit detects whether the times of the sampling value being larger than the baseline value boundary reach the baseline value confirmation times, if so, the step (14) is carried out, and if not, the step (16) is carried out; (14) The baseline value updating unit receives the sampling value output by the timing sampling unit; (15) The baseline value updating unit updates the baseline value and returns to the step (4); (16) The baseline value updating unit does not receive the sampling value output by the timing sampling unit; (17) The baseline value updating unit does not update the baseline value, and returns to step (4).
A capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) setting a key threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key; (5) The timing sampling unit outputs a plurality of sampling values to the average filtering unit; (6) The average filtering unit outputs an average sampling value to the key detection unit; (7) The key detection unit detects whether the average sampling value is larger than a key threshold value, if so, the step (8) is carried out, and if not, the step (9) is carried out; (8) The baseline value detection unit does not receive the average sampling value output by the average filtering unit, and the step (15) is entered; (9) The baseline value detection unit receives the average sampling value output by the average filtering unit; (10) The baseline value detection unit detects whether the average sampling value is larger than a baseline value boundary, if so, the step (11) is carried out, and if not, the step (12) is carried out; (11) The base line value detection unit detects whether the times of the average sampling value being larger than the base line value boundary reach the base line value confirmation times or not, if yes, the step (12) is carried out, and if not, the step (14) is carried out; (12) The baseline value updating unit receives the average sampling value output by the average filtering unit; (13) The baseline value updating unit updates the baseline value and returns to the step (4); (14) The baseline value updating unit does not receive the average sampling value output by the timing sampling unit; (15) The baseline value updating unit does not update the baseline value, and returns to step (4).
A capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) setting a key threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key; (5) The timing sampling unit outputs a plurality of sampling values to the digital filtering unit; (6) The digital filtering unit outputs a filtering sampling value to the key detection unit; (7) The key detection unit detects whether the filtering sampling value is larger than a key threshold value, if yes, the step (8) is carried out, and if not, the step (9) is carried out; (8) The baseline value detection unit does not receive the filtering sampling value output by the digital filtering unit, and the step (15) is performed; (9) The baseline value detection unit receives a filtering sampling value output by the digital filtering unit; (10) The baseline value detection unit detects whether the filtering sampling value is larger than a baseline value boundary, if so, the step (11) is carried out, and if not, the step (12) is carried out; (11) The baseline value detection unit detects whether the times of the filtering sampling value being larger than the baseline value boundary reach the baseline value confirmation times or not, if yes, the step (12) is carried out, and if not, the step (14) is carried out; (12) The baseline value updating unit receives the filtering sampling value output by the filtering sampling unit; (13) The baseline value updating unit updates the baseline value and returns to the step (4); (14) The baseline value updating unit does not receive the filtering sampling value output by the filtering sampling unit; (15) The baseline value updating unit does not update the baseline value, and returns to step (4).
A capacitive touch key anti-interference detection method comprises the following steps: (1) starting; (2) initializing each module; (3) Setting a noise threshold, a key threshold and a baseline value boundary; (4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key; (5) The timing sampling unit outputs a plurality of sampling values to the sampling value stability judging unit; (6) The sampling value stability judging unit judges whether the difference value between the maximum sampling value and the minimum sampling value in the sampling values is larger than a preset difference value, if so, the step (7) is carried out, and if not, the step (8) is carried out; (7) The average filtering unit does not receive the plurality of sampling values output by the timing sampling unit, and returns to the step (4); (8) The average filtering unit receives a plurality of sampling values output by the timing sampling unit; (9) The average filtering unit outputs an average sampling value to the digital filtering unit and the noise detecting unit; (10) The noise detection unit detects whether the average sampling value is larger than a noise threshold value, if so, the step (11) is carried out, and if not, the step (12) and the step (26) are carried out; (11) The key detection unit and the sampling control unit do not receive the filtering sampling value output by the digital filtering unit, and the step (4) is returned; (12) The key detection unit receives the filtering sampling value output by the digital filtering unit; (13) The key detection unit detects whether the filtered sampling value is larger than a key threshold value, if yes, the step (14) and the step (17) are carried out, and if not, the step (16) and the step (18) are carried out; (14) The key detection unit detects whether the times of the filtering sampling value larger than the key threshold value reach the key confirmation times, if so, the step (15) is carried out, and if not, the step (16) is carried out; (15) The key operation unit executes key operation and returns to the step (4); (16) The key operation unit does not execute key operation and returns to the step (4); (17) The baseline value detection unit does not receive the filtering sampling value output by the digital filtering unit, and the step (25) is performed; (18) The baseline value detection unit receives a filtering sampling value output by the digital filtering unit; (19) The baseline value detection unit detects whether the filtering sampling value is larger than a baseline value boundary, if so, the step (20) is carried out, and if not, the step (21) is carried out; (20) The baseline value detection unit detects whether the times of the filtering sampling value being larger than the baseline value boundary reach the baseline value confirmation times or not, if yes, the step (21) is carried out, and if not, the step (24) is carried out; (21) If the timing unit reaches the timing time, the step (22) is carried out, and if not, the step (24) is carried out; (22) The baseline value updating unit receives the filtering sampling value output by the digital filtering unit; (23) The baseline value updating unit updates the baseline value and returns to the step (4); (24) The baseline value updating unit does not receive the filtering sampling value output by the digital filtering unit; (25) The baseline value updating unit returns to the step (4) without updating the baseline value; (26) The sampling control unit detects whether the filtered sampling value is smaller than a baseline value, if yes, the step (27) and the step (28) are carried out, and if not, the step (4) is returned; (27) The timing sampling unit increases the sampling rate and returns to the step (4); (28) The timing unit shortens the timing time and proceeds to step (21).
The invention has the beneficial effects that:
the baseline value detection device controls the fourth switch to be closed when the sampling value is smaller than the baseline value boundary, the baseline value updating unit updates the baseline value, and when the sampling value is larger than the baseline value boundary, the baseline value is updated only when the number of times that the sampling value is larger than the baseline value boundary reaches the baseline value confirmation number of times, so that the risk of error updating of the baseline value caused by environmental interference is reduced. Furthermore, the key operation is executed only when the number of times that the sampling value is larger than the key threshold reaches the key confirmation number of times by setting the key confirmation number of times, so that the risk of detection errors caused by environmental interference is reduced. Further, when the sampling control unit detects that the sampling value is smaller than the base line value, the sampling rate of the timing sampling unit is increased, the timing time of the timing unit is shortened by the timing sampling unit, the descending speed after the base line value is increased, and the influence of continuous repeated touching of the capacitive touch keys on the base line value detection is further reduced. Further, the noise detection unit controls the fifth switch to be turned on or off by judging whether the average sampling value output by the average filter is larger than the noise threshold value, so that the sampling control unit cannot detect the sampling value exceeding the noise threshold value, and noise generated under the action of environmental interference is prevented from being carried out. According to the invention, the noise detection unit controls the second switch to be closed or opened by judging whether the sampling value is larger than the noise threshold value, so that the key detection unit can not detect the sampling value exceeding the noise threshold value, the key detection is prevented from being carried out on noise generated under the action of environmental interference, and the risk of detection errors is reduced. Further, the sampling value stability judging unit judges whether the difference value between the maximum sampling value and the minimum sampling value of the plurality of sampling values output by the timing sampling unit is larger than a preset difference value, and controls the first switch to be closed or opened, so that the first switch can only output the plurality of sampling values with the difference value smaller than the preset difference value, and the unstable sampling values generated under the action of environmental interference are prevented from being subjected to key detection and baseline value updating, and the risks of detection errors and baseline value error updating are reduced. Furthermore, the invention averages a plurality of sampling values through the average filtering unit, thereby reducing the risk of influencing the sampling values by environmental interference. According to the invention, the sampling value is subjected to digital filtering through the digital filtering unit, so that the risk of influencing the sampling value by environmental interference is reduced. Furthermore, the invention has better effect of filtering environmental interference through multistage digital filtering. Furthermore, the average filtering unit filters out the maximum sampling value and the minimum sampling value in the plurality of sampling values and then takes an average value, so that more stable average sampling values can be conveniently obtained.
Description of the drawings
In order to more clearly illustrate the embodiments of the present invention, the drawings that are used in the embodiments will be briefly described below. The drawings in the following description are only examples of the present invention and other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a block diagram of the overall structure of a capacitive touch key tamper resistant detection device of the present invention;
FIG. 2 is a block diagram showing the structure of a sample value stability judging unit according to the present invention;
FIG. 3 is a block diagram showing the construction of a maximum value determination unit of the present invention;
FIG. 4 is a block diagram showing the construction of a minimum value determination unit of the present invention;
FIG. 5 is a block diagram of the digital filter unit of the present invention;
FIG. 6 is a block diagram of the structure of the noise threshold generating unit of the present invention;
fig. 7 is a block diagram of the structure of the noise detecting unit of the present invention;
FIG. 8 is a block diagram showing the structure of a key threshold value generation unit of the present invention;
FIG. 9 is a block diagram showing the structure of a key detection unit according to the present invention;
FIG. 10 is a block diagram of the baseline value boundary generation unit of the present invention;
FIG. 11 is a block diagram of the structure of the baseline value detection unit of the present invention;
FIG. 12 is a block diagram of the timing unit of the present invention;
FIG. 13 is a block diagram of the structure of the sampling control unit of the present invention;
FIG. 14 is a timing diagram of sample values output by a timing sampling unit of the present invention when the sampling rate is not increased;
FIG. 15 is a timing diagram of sample values output by the timing sampling unit after increasing the sampling rate in accordance with the present invention;
FIG. 16 is a general flow chart of a capacitive touch key tamper detection method of the present invention.
Best mode for carrying out the invention
The present invention will be described in detail with reference to the accompanying drawings.
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions, and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
As shown in fig. 1, the capacitive touch key anti-interference detection device includes a timing sampling unit, a sampling control unit, a timing unit, a sampling value stability determination unit, an average filtering unit, a digital filtering unit, a noise detection unit, a noise threshold generation unit, a key detection unit, a key threshold generation unit, a baseline value detection unit, a baseline value boundary generation unit, a baseline value update unit, a first switch, a second switch, a third switch, a fourth switch, a fifth switch, and a baseline value update determination unit.
As shown in fig. 1, the sampling value output end of the timing sampling unit is connected with the input end of the sampling value stability judging unit and the input end of the first switch; the timing control signal output end of the timing sampling unit is connected with the timing control signal input end of the timing unit to control the timing time of the timing unit; the output end of the sampling value stability judging unit is connected with the control signal input end of the first switch to control the first switch to be closed or opened; the output end of the first switch is connected with the input end of the average filtering unit; the output end of the average filtering unit is connected with the input end of the digital filtering unit and one input end of the noise detection unit; the output end of the digital filter unit is connected with the input end of the second switch, the input end of the third switch, the input end of the fourth switch and the input end of the fifth switch; the output end of the noise detection unit is connected with the control signal input end of the second switch and the control signal input end of the fifth switch, and controls the second switch and the fifth switch to be closed or opened; the output end of the second switch is connected with one input end of the key detection unit; one output end of the key detection unit outputs a key operation signal to a key operation unit (not shown), the key operation unit executes corresponding operation, and the other output end is connected with a control signal input end of the third switch to control the third switch to be closed or opened; the output end of the third switch is connected with one input end of the baseline value detection unit; the output end of the baseline value detection unit and the output end of the timing unit are respectively connected with the two input ends of the baseline value updating judgment unit; the output end of the baseline value updating judging unit is connected with the control signal input end of the fourth switch, and the fourth switch is controlled to be closed or opened; the output end of the fourth switch is connected with the input end of the baseline value updating unit; the output end of the baseline value updating unit is connected with the input end of the noise threshold generating unit, the input end of the key threshold generating unit, the input end of the baseline value boundary generating unit and one input end of the sampling control unit; the output end of the noise threshold generating unit is connected with the other input end of the noise detecting unit; the output end of the key threshold generating unit is connected with the other input end of the key detecting unit; the output end of the baseline value boundary generating unit is connected with the other input end of the baseline value detecting unit; the output end of the fifth switch is connected with the other input end of the sampling control unit; the output end of the sampling control unit is connected with the sampling control signal input end of the timing sampling unit, and the sampling rate of the timing sampling unit is controlled.
As shown in fig. 1, the timing sampling unit outputs a plurality of sampling values C 1 ……C n ……C N (N is more than or equal to 2, N is more than or equal to 1 and less than or equal to N, N, N are integers, and the same as the following) are given to a sampling value stability judging unit and a first switch; the sampling value stabilization judging unit receives a preset difference value delta C and a plurality of sampling values C output by the timing sampling unit 1 ……C n ……C N And outputting a first control signal to the first switch to control the first switch to be closed or opened.
As shown in fig. 2, the sample value stability determination unit includes a maximum value determination unit, a minimum value determination unit, a first subtractor, and a first comparator; the maximum value judging unit is connected with one input end of the first subtracter and receives the sampling values C output by the timing sampling unit 1 ……C n ……C N Outputting the maximum sampling value C MAX Supplying the first subtracter; the minimum value judging unit is connected with the other input end of the first subtracter and receives a plurality of sampling values C output by the timing sampling unit 1 ……C n ……C N Outputting the minimum sampling value C MIN Supplying the first subtracter; the output end of the first subtracter is connected with one input end of the first comparator and outputs a maximum sampling value C MAX And the minimum sampling value C MIN Is the difference C of (2) MAX -C MIN The other input end of the first comparator receives a preset difference delta C; the first comparator outputs a difference C MAX -C MIN And comparing the first control signal with a preset difference delta C, and outputting the first control signal according to a comparison result.
In the present embodiment, when the maximum sampling value C MAX And the minimum sampling value C MIN Is the difference C of (2) MAX -C MIN When the sampling value stability judging unit outputs a first control signal which is a high level and is smaller than or equal to a preset difference value delta C, the first control signal is controlledA switch is closed; when the maximum sampling value C MAX And the minimum sampling value C MIN Is the difference C of (2) MAX -C MIN And when the sampling value is larger than the preset difference value delta C, the first control signal output by the sampling value stability judging unit is in a low level, and the first switch is controlled to be disconnected.
In other embodiments, when the maximum sample value C MAX And the minimum sampling value C MIN Is the difference C of (2) MAX -C MIN When the sampling value is smaller than or equal to a preset difference value delta C, a first control signal output by the sampling value stability judging unit is of a low level, and a first switch is closed; when the maximum sampling value C MAX And the minimum sampling value C MIN Is the difference C of (2) MAX -C MIN And when the sampling value is larger than the preset difference value delta C, the first control signal output by the sampling value stability judging unit is in a high level, and the first switch is controlled to be disconnected.
In this embodiment, the preset difference Δc is an empirical value determined by sampling multiple times by the timing sampling unit, and is required to be measured without environmental interference, such as mobile phone interference; and taking the difference value of the maximum value and the minimum value as a preset difference value delta C. In this embodiment, Δc=100-1000.
As shown in fig. 3, the maximum value determination unit includes a second comparator and a maximum sample value register; one input of the second comparator receives a plurality of sampling values C 1 ……C n ……C N The output end of the second comparator is connected with the input end of the maximum sampling value register, and the output end of the maximum sampling value register is connected with the other input end of the second comparator.
In the present embodiment, the maximum value determination unit receives a plurality of sampling values C 1 ……C n ……C N Outputting the maximum sampling value C MAX The principle of (2) is as follows: one input of the second comparator receives the first sampling value C 1 And the first sampling value C 1 Stored in a maximum sampling value register, and the first sampling value C is stored in the maximum sampling value register 1 Feedback to the other input of the second comparator; the second comparator receives a second sampling value C 2 And will be atSampling value C 1 And a second sampling value C 2 Compare and compare the first sampled value C 1 And a second sampling value C 2 The larger sampling value is stored in a maximum sampling value register, and the larger sampling value is fed back to the other input end of the second comparator by the maximum sampling value register; the second comparator receives a third sampling value C 3 And the third sampling value C 3 Comparing with the feedback value, storing the larger sampling value after the comparison again in a maximum sampling value register, feeding back the larger sampling value to the other input end of the second comparator by the maximum sampling value register, and; and so on, the maximum sampling value register finally outputs a plurality of sampling values C 1 ……C n ……C N Maximum sampling value C of (2) MAX
As shown in fig. 4, the minimum value determination unit includes a third comparator and a minimum sampling value register; one input of the third comparator receives a plurality of sampling values C 1 ……C n ……C N The output end of the third comparator is connected with the input end of the minimum sampling value register, and the output end of the minimum sampling value register is connected with the other input end of the second comparator.
In the present embodiment, the minimum value determination unit receives a plurality of sampling values C 1 ……C n ……C N Outputting the minimum sampling value C MIN The principle of (2) is as follows: one input of the third comparator receives the first sampling value C 1 And the first sampling value C 1 Stored in a minimum sampling value register, and the first sampling value C is stored in the minimum sampling value register 1 Feedback to the other input of the third comparator; the third comparator receives a second sampling value C 2 And the first sampling value C 1 And a second sampling value C 2 Compare and compare the first sampled value C 1 And a second sampling value C 2 The smaller sampling value is stored in a minimum sampling value register, and the minimum sampling value register feeds back the smaller sampling value to the other input end of the third comparator; the third comparator receives a third sampling value C 3 And the third is adopted Sample C 3 Comparing the small sampling value with the feedback value, storing the small sampling value after the comparison again in a minimum sampling value register, and feeding back the small sampling value to the minimum sampling value register at the other input end of the third comparator by the minimum sampling value register; and so on, the minimum sampling value register outputs a plurality of sampling values C at last 1 ……C n ……C N Minimum sample value C of (2) MIN
In this embodiment, when the first switch is closed, the averaging filter unit receives a plurality of sampling values C 1 ……C n ……C N And to remove the maximum sampling value C MAX And the minimum sampling value C MIN A plurality of sampling values C 1 ……C n ……C N Average value is taken and average sampling value C is output AVE I.e. average sampled value C AVE =(C 1 +……C n ……+C N -C MAX -C MIN ) N; when the first switch is turned off, the average filter unit stops receiving the sampled value output by the timing sampling unit and stops outputting the average sampled value C AVE To the digital filtering unit.
As shown in fig. 1, the digital filtering unit receives the average sampling value C output by the average filtering unit AVE Output filtered sample value C F The method comprises the steps of carrying out a first treatment on the surface of the Digital filter unit averages sampling value C AVE Digital filtering is performed. In this embodiment, the digital filtering unit is used for performing multiple filtering, C F,i+1 =C AVE /K+(K-1)*C F,i /K,K=2 q Q and i are positive integers; c (C) F,i C is the result of the ith filtering of the digital filtering unit F,i+1 The i+1th filtering result of the digital filtering unit; c (C) F Is the result of the last filtering by the digital filtering unit. In this embodiment, q=1, 2, 3, 4, 5, 6, 7, 8.
As shown in fig. 5, the digital filtering unit includes a first multiplier, a second multiplier, a first adder, and a filtered sample value register; the two input ends of the first multiplier respectively receive the average sampling value C AVE A first multiplication factor of 1/K; the output end of the first multiplier and the second multiplierThe output ends of the law are respectively connected with the two input ends of the first adder; the output end of the first adder is connected with the input end of the filtering sampling value register; the output end of the filtering sampling value register is connected with one input end of the second multiplier to filter the result C of the last time F,i The second multiplier is fed back, the other input end of the second multiplier receives the second multiplication factor (K-1)/K, and the first adder outputs the result C of the next filtering F,i+1 Storing in a filtered sample value register; the output end of the filter sampling value register outputs a filter sampling value C at last F
As shown in fig. 1, the noise threshold generation unit receives the baseline value C output by the baseline value update unit B Output noise upper threshold C NU Noise lower threshold C ND Giving the noise detection unit; the noise detection unit receives the noise upper threshold C output by the noise threshold unit NU Lower noise threshold C ND Average sampling value C output by average filtering unit AVE Average sampling value C AVE And upper threshold C of noise NU Noise lower threshold C ND And comparing, and outputting a second control signal to the second switch and the fifth switch according to the comparison result to control the second switch and the fifth switch to be closed or opened.
As shown in fig. 6, in the present embodiment, the noise threshold generation unit includes a second subtractor, a second adder, and a third multiplier; the two input ends of the third multiplier respectively receive the baseline value C B Coefficient a 1 The output end is connected with one input end of the second subtracter and one input end of the second adder and outputs a 1 *C B Supplying a second subtractor and a second adder; the other input of the second subtracter and the other input of the second adder each receive the baseline value C B The method comprises the steps of carrying out a first treatment on the surface of the Output end of the second subtracter outputs C B -a 1 *C B I.e. output noise lower threshold C ND The method comprises the steps of carrying out a first treatment on the surface of the The output end of the second adder outputs C NU =C B +a 1 *C B I.e. output noise upper threshold C NU
As shown in fig. 7, noiseThe sound detection unit comprises a fourth comparator, a fifth comparator and a noise judgment unit; two input ends of the fourth comparator respectively receive the noise lower threshold C output by the noise threshold generating unit ND Average sampling value C output by average filtering unit AVE The output end is connected with one input end of the noise judgment unit; two input ends of the fifth comparator respectively receive the noise upper threshold C output by the noise threshold generating unit NU Average sampling value C output by average filtering unit AVE The output end is connected with the other input end of the noise judgment unit; the output end of the noise decision unit outputs a second control signal.
In this embodiment, the noise decision unit is a third and gate; when the average sampling value is larger than or equal to the noise lower threshold value, the fourth comparator outputs a high level; when the average sampling is smaller than the noise lower threshold value, the fourth comparator outputs a low level; when the average sampling value is smaller than or equal to the noise upper threshold value, the fifth comparator outputs a high level; when the average sampling value is larger than the noise upper threshold value, the fifth comparator outputs a low level; when the fourth comparator and the fifth comparator both output high level, the third AND gate outputs high level, and the second switch and the fifth switch are controlled to be closed; when the fourth comparator or the fifth comparator outputs a low level, the third AND gate outputs a low level, and the second switch and the fifth switch are controlled to be opened.
In other embodiments, the noise decision unit is a third or gate; when the average sampling value is larger than or equal to the noise lower threshold value, the fourth comparator outputs a low level; when the average sampling is smaller than the noise lower threshold value, the fourth comparator outputs a high level; when the average sampling value is smaller than or equal to the noise upper threshold value, the fifth comparator outputs a low level; when the average sampling value is larger than the noise upper threshold value, the fifth comparator outputs a high level; when the fourth comparator and the fifth comparator both output a low level, the third OR gate outputs a low level, and the second switch and the fifth switch are controlled to be closed; when the fourth comparator or the fifth comparator outputs high level, the third OR gate outputs high level, and the second switch and the fifth switch are controlled to be opened.
In this embodiment, when the second switch is closed, the switch is pressedThe key detection unit receives the filtered sampling value C output by the digital filtering unit F And filtering the sampled value C by detection F Judging whether the capacitive touch key is in a touch state or not; when the second switch is turned off, the key detection unit stops receiving the filtered sampling value C output by the digital filtering unit F The method comprises the steps of carrying out a first treatment on the surface of the When the fifth switch is closed, the sampling control unit receives the filtered sampling value C output by the digital filtering unit F The method comprises the steps of carrying out a first treatment on the surface of the When the second switch is turned off, the sampling control unit stops receiving the filtered sampling value C output by the digital filtering unit F
In the present embodiment, the noise lower threshold C ND =C B -a 1 *C B Upper noise threshold C NU =C B +a 1 *C B ;a 1 =0.001-0.1。
In the present embodiment, only when the noise detection unit detects the average sampling value C AVE Not noise, i.e. average sampled value C AVE Greater than or equal to the lower noise threshold C ND And is less than or equal to the noise upper threshold C NU When the second switch is closed, the key detection unit detects the average sampling value C AVE And the interference of noise on key detection is avoided.
As shown in fig. 1, the key threshold generation unit receives the baseline value C output by the baseline value update unit B Output key threshold C TK The key detection unit is given; the key detection unit receives the key threshold C output by the key threshold generation unit TK The filtered sampling value C of the second switch output F Will filter the sampled value C F And key threshold C TK And comparing, outputting a key operation signal to control the operation of the key operation unit according to the comparison result, and outputting a third control signal to control the third switch to be closed or opened.
As shown in fig. 8, the key threshold generation unit includes a third adder and a fifth multiplier; the two input ends of the fifth multiplier respectively receive the baseline value C B And coefficient b, the output end of the fifth multiplier is connected with one input end of the third adder, and outputs b B Giving the third adder; another input of the third adderThe access terminal receives the base line value C B Output end outputs C B +b*C B I.e. output key threshold C TK
As shown in fig. 9, the key detection unit includes a sixth comparator, a seventh comparator, and a first counter; the two input ends of the sixth comparator respectively receive the key threshold C output by the key threshold generating unit TK Filtered sampling value C output by digital filtering unit F The sixth comparator will filter the sampled value C F And key threshold C TK Comparing, outputting a third control signal to the third switch according to the comparison result, controlling the third switch to be closed or opened, outputting a first trigger signal to the first counter, and controlling the first counter to count; the two input ends of the seventh comparator respectively receive the key confirmation times N TK And the seventh comparator compares the count value output by the first counter with the key confirmation number N TK And comparing and outputting a key operation signal according to the comparison result.
In the present embodiment, when the sampling value C is filtered F Greater than key threshold C TK And filter the sampled value C F Greater than key threshold C TK The number of times reaches the key confirmation number of times N TK When the key operation signal output by the key detection unit is at a high level, the third control signal output by the key detection unit is at a high level; when filtering the sampling value C F Greater than key threshold C TK And filter the sampled value C F Greater than key threshold C TK The number of times not reaching the key confirmation number N TK When the key operation signal output by the key detection unit is at a low level, the third control signal output by the key detection unit is at a high level; when filtering the sampling value C F Less than the key threshold C TK When the key operation signal output by the key detection unit is at a low level, the third control signal output by the key detection unit is at a low level. In the present embodiment, when the sampling value C is filtered F Greater than key threshold C TK The sixth comparator outputs high level to trigger the first counter to count, and the count value output by the first counter is greater than the key confirmation number N TK I.e. filtering the sampled valuesC F Greater than key threshold C TK The number of times reaches the key confirmation number of times N TK When the key operation signal output by the seventh comparator is at a high level, the key detection unit judges that the corresponding capacitive touch key is in a touch state; when filtering the sampling value C F Less than the key threshold C TK The sixth comparator outputs a low level, the first counter does not count, or the filtered sample value C F Greater than key threshold C TK The sixth comparator outputs a high level to trigger the first counter to count, but the sampled value C is filtered F Greater than key threshold C TK The number of times not reaching the key confirmation number N TK When the key operation signal output by the seventh comparator is at a low level, the key detection unit determines that the corresponding capacitive touch key is in an untouched state.
In this embodiment, when the key operation signal output by the key unit is at a high level, the key operation unit performs an operation of the corresponding capacitive touch key; when the key operation signal output by the key unit is at a low level, the key operation unit does not execute the operation of the corresponding capacitive touch key; when the sixth comparator outputs a high level, namely the third control signal is at a high level, the third switch is turned off; when the sixth comparator outputs a low level, i.e. the third control signal is low, the third switch is closed.
In other embodiments, when the sampled value C is filtered F Greater than key threshold C TK The sixth comparator outputs a low level to trigger the first counter to count, and the count value output by the first counter is greater than the key confirmation number N TK I.e. filtered sample value C F Greater than key threshold C TK The number of times reaches the key confirmation number of times N TK When the key operation signal output by the seventh comparator is at a low level, the key detection unit judges that the corresponding capacitive touch key is in a touch state; when filtering the sampling value C F Less than the key threshold C TK The sixth comparator outputs a high level, the first counter does not count, or the filtered sample value C F Greater than key threshold C TK The sixth comparator outputs a low level triggering the first counter to count, but the sampled value C is filtered F Greater than key threshold C TK The number of times not reaching the key confirmation number N TK When the key operation signal output by the seventh comparator is at a high level, the key detection unit determines that the corresponding capacitive touch key is in an untouched state.
In other embodiments, when the key operation signal output by the key unit is at a low level, the key operation unit performs an operation of the corresponding capacitive touch key; when the key operation signal output by the key unit is at a high level, the key operation unit does not execute the operation of the corresponding capacitive touch key; when the sixth comparator outputs a high level, namely the third control signal is at a high level, the third switch is turned off; when the sixth comparator outputs a low level, i.e. the third control signal is low, the third switch is closed.
In this embodiment, when the third switch is closed, the baseline value detection unit receives the filtered sampling value C output by the digital filtering unit F The method comprises the steps of carrying out a first treatment on the surface of the When the third switch is turned off, the baseline value detection unit stops receiving the filtered sampling value C output by the digital filtering unit F
In the present embodiment, the key threshold C TK =C B +b*C B The method comprises the steps of carrying out a first treatment on the surface of the b=0.001-0.1, and b < a 2 The method comprises the steps of carrying out a first treatment on the surface of the Number of key confirmation C TK The method comprises the steps of determining an experience value after a capacitive touch key is touched for a plurality of times; when multiple times of touch capacitive touch keys are counted, sampling value C is filtered F Greater than key threshold C TK The lowest value of the number of times of (C) is used as the key confirmation number of times TK The method comprises the steps of carrying out a first treatment on the surface of the Number of key confirmation times N TK The number range of (2) is 1 to 8.
As shown in fig. 1, the baseline value boundary generation unit receives the baseline value C output by the baseline value update unit B Output baseline value boundary C BB Giving the baseline value detection unit; the baseline value detection unit receives the baseline value boundary C output by the baseline value boundary generation unit BB Filtered sample value C of third switch output F Will filter the sampled value C F Boundary with baseline value C BB And comparing, and outputting a first baseline value updating signal to a baseline value updating judging unit according to the comparison result.
As shown in the figure10, the baseline value boundary generation unit includes a fourth adder and a sixth multiplier; the two input ends of the sixth multiplier respectively receive the baseline value C B And coefficient C, the output end of the sixth multiplier is connected with one input end of the fourth adder, and outputs C B Giving the fourth adder; the other input of the fourth adder receives the baseline value C B Output end outputs C B +c*C B I.e. output baseline value boundary C BB
As shown in fig. 11, the baseline value detection unit includes an eighth comparator, a ninth comparator, a tenth comparator, a second counter, and a first baseline value update determination unit; the two input ends of the eighth comparator respectively receive the filtered sampling value C output by the third switch F Baseline value boundary C output by baseline value boundary generation unit BB The eighth comparator filters the sampled value C F Boundary with baseline value C BB Comparing, outputting a second trigger signal to the second counter according to the comparison result, and triggering the second counter to count; the two input ends of the tenth comparator respectively receive the base line value confirmation times N B The output end of the count value output by the second counter is connected with one input end of the first baseline value updating judging unit; the tenth comparator confirms the count value output by the second counter with the baseline value by the number N B Comparing and outputting a high level or a low level to the first baseline value updating judging unit according to the comparison result; the two input ends of the ninth comparator respectively receive the filtered sampling value C output by the third switch F Baseline value boundary C output by baseline value boundary generation unit BB The output end is connected with the other input end of the first baseline value updating judging unit; the ninth comparator will filter the sampled value C F Boundary with baseline value C BB Comparing and outputting a high level or a low level to the first baseline value updating judging unit according to the comparison result; the output terminal of the first baseline value update determination unit outputs a first baseline value update signal.
In this embodiment, the first baseline value update determination unit is a second or gate; when filtering the sampling value C F Greater than baseline value boundary C BB In the time-course of which the first and second contact surfaces,the ninth comparator outputs a low level, and the eighth comparator outputs a high level to trigger the second counter to count; when the count value output by the second counter is greater than the baseline value confirmation number N B I.e. filtered sample value C F Greater than baseline value boundary C BB Number of times to reach baseline value confirmation number of times N B When the first baseline value updating signal output by the second OR gate is at a high level, the count value output by the second counter is less than the baseline value confirmation number N B I.e. filtered sample value C F Greater than baseline value boundary C BB Number of times of not reaching baseline value confirmation number of times N B When the first baseline value updating signal is at a low level, the tenth comparator outputs a low level, and the second OR gate outputs a first baseline value updating signal at a low level; when filtering the sampling value C F Less than or equal to baseline value boundary C BB When the first baseline value updating signal is in a high level, the ninth comparator outputs a high level, the eighth comparator outputs a low level, the second counter is not triggered to count, the tenth comparator outputs a low level, and the first baseline value updating signal output by the second OR gate is in a high level. In the present embodiment, the baseline value boundary C BB =C B +c*C B The method comprises the steps of carrying out a first treatment on the surface of the c=0.001-0.1, and c < b; number of baseline value confirmations N B The number range of (2) is 1 to 32.
As shown in fig. 1, the timing unit receives the timing control signal output by the timing sampling unit, and outputs a second baseline value update signal to the baseline value update decision unit. As shown in fig. 12, the timing unit includes a timer, a third counter, a timing decision condition generating unit, and an eleventh comparator; the output end of the timer is connected with the input end of the third counter, the third counter counts the timer and outputs the counted value to one input end of the eleventh comparator; the timing judgment condition receiving sampling unit outputs a timing control signal and outputs a timing judgment condition to the other input end of the eleventh comparator; the timing control signal is used for controlling the numerical value of the timing judgment condition; the eleventh comparator outputs a second baseline value update signal.
In the present embodiment, when the count value output by the third counter is smaller than the timing judgment condition output by the timing judgment condition, that is, the base line value updating unit has not reached the timing update time, the second base line value updating signal output by the eleventh comparator is at a low level; when the count value output by the third counter is equal to the timing judgment condition output by the timing judgment condition, namely the timing unit reaches the timing time, the second baseline value updating signal output by the eleventh comparator is high level.
In this embodiment, the baseline value update determination unit is a first and gate; when the first reference updating signal output by the baseline value detection unit and the second reference updating signal output by the timing unit are both in high level, the first AND gate outputs high level; when the first reference update signal or the second reference update signal is at a low level, the first and gate outputs a low level; when the first AND gate outputs a high level, the fourth control signal output by the first AND gate is a high level, the fourth switch is closed, and the baseline value updating unit receives a filtered sampling value C output by the digital filtering unit F Updating the baseline value, and changing the output baseline value into a filtering sampling value C F The method comprises the steps of carrying out a first treatment on the surface of the When the first AND gate outputs a low level, the fourth control signal output by the first AND gate is a low level, the fourth switch is turned off, the baseline value updating unit does not update the baseline value, and the output baseline value is unchanged.
In the present embodiment, the baseline value updating unit needs to update the baseline value to satisfy the following conditions: (1) The noise detection unit detects the average sampling value C AVE Not noise; (2) The filtered sampling value C detected by the base line value detection unit F Reaching the update condition, i.e. filtering the sampled value C F Less than or equal to baseline value boundary C BB Or, filter sample value C F Number of confirmations greater than baseline value N B Number of times of reaching baseline value N B And filter the sampled value C F Less than the key threshold C TK The method comprises the steps of carrying out a first treatment on the surface of the (3) the timing unit reaches a timing time; reducing the effect of noise on baseline value detection; for less than or equal to baseline value boundary C BB Is a filtered sample value C of (2) F The baseline value is directly updated without multiple confirmation, so that the updating speed of the baseline value is improved; for greater than baseline value boundary C BB Is a filtered sample value C of (2) F The baseline value can be updated after multiple confirmations are carried out, so that the capacitance value of the capacitive touch key is prevented from being suddenly changed in environmentAn effect resulting in erroneous updates of the baseline value.
In this embodiment, the baseline value output by the baseline value updating unit for the first time is a capacitance value of the capacitive touch key when the capacitive touch key is not interfered by the environment and is not touched, and the capacitance value is obtained by scanning by the timing sampling unit.
As shown in fig. 1, the sampling control unit receives a filtered sampling value C output by the fifth switch F Baseline value C output by baseline value updating unit B The sampling control signal is output to the timing sampling unit. As shown in fig. 13, the sampling control unit includes a twelfth comparator; the two input terminals of the twelfth comparator respectively receive the filtered sampling value C F Baseline value C B The twelfth comparator will filter the sampled value C F Baseline value C B And comparing and outputting a sampling control signal according to the comparison result.
In the present embodiment, when the sampling value C is filtered F Greater than or equal to baseline value C B When the sampling control signal output by the twelfth comparator is low level, the timing sampling unit maintains the original sampling rate, and the timing control signal output by the timing sampling unit controls the numerical value of the timing judgment condition output by the timing unit to be unchanged, namely the updating speed of the baseline value updating unit is unchanged; when filtering the sampling value C F Less than baseline value C B When the sampling control signal output by the twelfth comparator is at a high level, the sampling rate is increased by the timing sampling unit, and the timing control signal output by the timing sampling unit controls the timing unit to reduce the value of the timing judgment condition, namely, the timing time of the timing unit is shortened, and the updating speed of the baseline value updating unit is increased.
As shown in fig. 14, a plurality of continuous touches on the capacitive touch key will cause the value of the capacitive touch key to continuously rise and then fall; when the sampling rate of the timing sampling unit is low, the sampling values output by the timing sampling unit are larger values, so that the filtered sampling value C output by the digital filtering unit is caused F Greater than baseline value boundary C BB Number of times to reach baseline value confirmation number of times N B The baseline value updating unit updates the baseline value to cause the baseline value to rise abnormally.
In the present embodiment, the sampling control unit detects the filtered sample value C F Less than baseline value C B In this case, the timing sampling unit is controlled to increase the sampling rate (as shown in fig. 15), the sampling value output by the timing sampling unit becomes smaller, and the filtered sampling value C output by the digital filtering unit is further obtained F Also becomes smaller, preventing an abnormal rise in the baseline value due to a low sampling rate; on the other hand, the timing sampling unit accelerates the sampling rate, and simultaneously controls the timing unit to reduce the value of the timing judgment condition, namely controls the timing unit to shorten the timing time, accelerates the descending speed after the baseline value is increased, and further reduces the influence of continuous multi-touch capacitive touch keys on the detection of the baseline value.
As shown in fig. 16, a capacitive touch key anti-interference detection method includes the following steps:
(1) Starting;
(2) Initializing each module;
(3) Setting a noise threshold, a key threshold and a baseline value boundary;
(4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key;
(5) The timing sampling unit outputs a plurality of sampling values to the sampling value stability judging unit;
(6) The sampling value stability judging unit judges whether the difference value between the maximum sampling value and the minimum sampling value in the sampling values is larger than a preset difference value, if so, the step (7) is carried out, and if not, the step (8) is carried out;
(7) The average filtering unit does not receive the plurality of sampling values output by the timing sampling unit, and returns to the step (4):
(8) The average filtering unit receives a plurality of sampling values output by the timing sampling unit;
(9) The average filtering unit outputs an average sampling value to the digital filtering unit and the noise detecting unit;
(10) The noise detection unit detects whether the average sampling value is larger than a noise threshold value, if so, the step (11) is carried out, and if not, the step (12) and the step (26) are carried out;
(11) The key detection unit and the sampling control unit do not receive the filtering sampling value output by the digital filtering unit, and the step (4) is returned;
(12) The key detection unit receives the filtering sampling value output by the digital filtering unit;
(13) The key detection unit detects whether the filtered sampling value is larger than a key threshold value, if yes, the step (14) and the step (17) are carried out, and if not, the step (16) and the step (18) are carried out;
(14) The key detection unit detects whether the times of the filtering sampling value larger than the key threshold value reach the key confirmation times, if so, the step (15) is carried out, and if not, the step (16) is carried out;
(15) The key operation unit executes key operation and returns to the step (4);
(16) The key operation unit does not execute key operation and returns to the step (4);
(17) The baseline value detection unit does not receive the filtering sampling value output by the digital filtering unit, and the step (25) is performed;
(18) The baseline value detection unit receives a filtering sampling value output by the digital filtering unit;
(19) The baseline value detection unit detects whether the filtering sampling value is larger than a baseline value boundary, if so, the step (20) is carried out, and if not, the step (21) is carried out;
(20) The baseline value detection unit detects whether the times of the filtering sampling value being larger than the baseline value boundary reach the baseline value confirmation times or not, if yes, the step (21) is carried out, and if not, the step (24) is carried out;
(21) If the timing unit reaches the timing time, the step (22) is carried out, and if not, the step (24) is carried out;
(22) The baseline value updating unit receives the filtering sampling value output by the digital filtering unit;
(23) The baseline value updating unit updates the baseline value and returns to the step (4);
(24) The baseline value updating unit does not receive the filtering sampling value output by the digital filtering unit;
(25) The baseline value updating unit does not update the baseline value and returns to the step (4);
(26) The sampling control unit detects whether the filtered sampling value is smaller than a baseline value, if yes, the step (27) and the step (28) are carried out, and if not, the step (4) is returned;
(27) The timing sampling unit increases the sampling rate and returns to the step (4);
(28) The timing unit shortens the timing time and proceeds to step (21).
In this embodiment, step (3) includes the following steps;
(31) The baseline value updating unit outputs a baseline value to the noise threshold generating unit, the key threshold generating unit, the baseline value boundary generating unit and the sampling control unit;
(32) The noise threshold generating unit outputs a noise threshold to the noise detecting unit, the key threshold generating unit outputs a key threshold to the key detecting unit, and the baseline value boundary generating unit outputs a baseline value boundary to the baseline value detecting unit.
Example two
The difference between this embodiment and the first embodiment is that: the first baseline value updating judging unit is a second AND gate; the baseline value updating judging unit is a first OR gate; when the filtering sampling value output by the digital filtering unit is larger than the baseline value boundary and the count value output by the second counter reaches the baseline value confirmation times, the tenth comparator outputs a low level; when the filter sampling value output by the digital filter unit is smaller than or equal to the baseline value boundary, the ninth comparator outputs a low level; when the second AND gate outputs a low level, the fourth switch is closed; when the baseline value detection unit detects that the frequency of the filter sampling value output by the third switch is smaller than or equal to the baseline value boundary or the frequency of the filter sampling value larger than the baseline value boundary exceeds the baseline value confirmation frequency, the baseline value detection unit outputs a low level; when the timing unit judges that the timing time is reached, the timing unit outputs a low level; the fourth switch is closed when the first or gate outputs a low level.
Example III
The difference between this embodiment and the first embodiment is that: the noise threshold generating unit comprises a second subtracter, a second adder, a third multiplier and a fourth multiplier; the two input ends of the third multiplier respectively receive the baseline value C B Coefficient a 1 One of the output end and the second subtracterThe input ends are connected and output a 1 *C B Supplying a second subtracter; the two input ends of the fourth multiplier respectively receive the baseline value C B Coefficient a 2 The output end is connected with one input end of the second adder and outputs a 2 *C B Giving the second adder; the other input of the second subtracter and the other input of the second adder each receive the baseline value C B The method comprises the steps of carrying out a first treatment on the surface of the Output end of the second subtracter outputs C B -a 1 *C B I.e. output noise lower threshold C ND The method comprises the steps of carrying out a first treatment on the surface of the The output end of the second adder outputs C NU =C B +a 2 *C B I.e. output noise upper threshold C NU
In the present embodiment, a 1 =0.001-0.1,a 2 =0.001-0.1。
The above-mentioned embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above-mentioned embodiments, and all technical solutions belonging to the concept of the present invention belong to the protection scope of the present invention. It should be noted that modifications and adaptations to the present invention may occur to one skilled in the art without departing from the principles of the present invention and are intended to be within the scope of the present invention.

Claims (14)

1. The utility model provides a capacitive touch button anti-interference detection device which characterized in that: the device comprises a timing sampling unit, a key detection unit, a baseline value updating unit, a third switch and a fourth switch; the sampling value output end of the timing sampling unit is connected with the input end of the third switch, the input end of the fourth switch and the input end of the key detection unit; the output end of the third switch is connected with the input end of the baseline value detection unit; the output end of the key detection unit is connected with the control signal input end of the third switch; the output end of the baseline value detection unit is connected with the control signal input end of the fourth switch; the output end of the fourth switch is connected with the input end of the baseline value updating unit;
the timing sampling unit scans the capacitive touch keys and outputs sampling values; the key detection unit is used for detecting whether the sampling value output by the timing sampling unit is larger than a key threshold value or not, and controlling the third switch to be disconnected when the sampling value is larger than the key threshold value; the baseline value detection unit is used for detecting whether a sampling value output by the third switch is larger than a baseline value boundary or not, and controlling the fourth switch to be closed when the sampling value is smaller than or equal to the baseline value boundary or the number of times that the sampling value is larger than the baseline value boundary exceeds the baseline value confirmation number of times; and the baseline value updating unit receives the sampling value output by the fourth switch and updates the baseline value.
2. The capacitive touch key tamper resistant detection device of claim 1, wherein: the baseline value detection unit comprises an eighth comparator, a ninth comparator, a tenth comparator, a second counter and a first baseline value update judgment unit; two input ends of the eighth comparator respectively receive the baseline value boundary and the sampling value output by the third switch; the output end of the eighth comparator is connected with the trigger signal input end of the second counter; the output end of the second counter is connected with one input end of the tenth comparator, and the other input end of the tenth comparator receives the base line value confirmation times; two input ends of the ninth comparator respectively receive the baseline value boundary and the sampling value output by the third switch; the output end of the ninth comparator and the output end of the tenth comparator are respectively connected with the two input ends of the first baseline value updating judging unit;
the eighth comparator is used for judging whether the sampling value exceeds a baseline value boundary or not, and triggering the second counter to count when the sampling value is larger than the baseline value boundary; the tenth comparator is used for judging whether the count value output by the second counter reaches the base line value confirmation times or not; the ninth comparator is configured to determine whether the sampling value exceeds a baseline value boundary; and when the tenth comparator judges that the count value output by the second counter reaches the baseline value confirmation number, or the ninth comparator judges that the sampling value is smaller than the baseline value boundary, the first baseline value updating judgment unit controls the fourth switch to be closed.
3. The capacitive touch key tamper resistant detection device of claim 2, wherein: the first baseline value updating judging unit is a second OR gate; when the sampling value is greater than the baseline value boundary and the count value reaches the baseline value confirmation times, the tenth comparator outputs a high level; when the sampling value is smaller than or equal to a base line value boundary, the ninth comparator outputs a high level; when the second OR gate outputs high level, the fourth switch is closed;
or, the first baseline value updating judging unit is a second AND gate; when the sampling value is greater than the baseline value boundary and the count value reaches the baseline value confirmation times, the tenth comparator outputs a low level; when the sampling value is smaller than or equal to a base line value boundary, the ninth comparator outputs a low level; and when the second AND gate outputs low level, the fourth switch is closed.
4. A capacitive touch key tamper resistant detection device according to any one of claims 1 to 3, wherein: the key detection unit comprises a sixth comparator; the two input ends of the sixth comparator respectively receive a key threshold value and a sampling value, and the sixth comparator compares the sampling value with the key threshold value; and when the sampling value is larger than the key threshold value, the sixth comparator controls the third switch to be disconnected.
5. The capacitive touch key tamper resistant detection device of claim 4, wherein: the key detection unit further comprises a seventh comparator and a first counter; the trigger signal input end of the first counter is connected with the output end of the sixth comparator; the two input ends of the seventh comparator respectively receive the key confirmation times and the count value output by the first counter, and the output end outputs a key control signal; the sixth comparator triggers the first counter to count when the sampling value is larger than the key threshold value; the seventh comparator is configured to determine whether the count value output by the first counter reaches a key confirmation number, and output a key control signal when the count value reaches the key confirmation number, so as to control execution of key operation.
6. The capacitive touch key tamper resistant detection device of claim 5, wherein: when the sampling value is larger than the key threshold value, the sixth comparator outputs high level/low level and triggers the first counter to count; and when the count value output by the first counter reaches the key confirmation times, the key control signal output by the seventh comparator is high level/low level, and the key operation is controlled to be executed.
7. A capacitive touch key tamper resistant detection device according to any one of claims 1 to 3, wherein: the device also comprises a timing unit and a baseline value updating judging unit; the baseline value update determination unit is connected between the baseline value detection unit and the fourth switch; the two input ends of the baseline value updating judging unit are respectively connected with the output end of the baseline value detecting unit and the output end of the timing unit, and the output end is connected with the control signal input end of the fourth switch; the timing unit is used for judging whether the timing time is reached; the baseline value update judging unit is used for controlling the fourth switch to be closed or opened;
and when the baseline value detection unit detects that the sampling value output by the third switch is smaller than or equal to the baseline value boundary or the sampling value is larger than the baseline value boundary, the number of times exceeds the baseline value confirmation number, and the timing unit judges that the timing time is reached, the baseline value update judgment unit controls the fourth switch to be closed.
8. The capacitive touch key tamper resistant detection device of claim 7, wherein: the baseline value updating judging unit is a first AND gate, and when the baseline value detecting unit detects that the sampling value output by the third switch is smaller than or equal to a baseline value boundary or the frequency of the sampling value being larger than the baseline value boundary exceeds the baseline value confirmation frequency, the baseline value detecting unit outputs a high level; when the timing unit judges that the timing time is reached, the timing unit outputs a high level; when the first AND gate outputs a high level, the fourth switch is closed;
Or, the baseline value updating judging unit is a first or gate, and when the baseline value detecting unit detects that the sampling value output by the third switch is smaller than or equal to a baseline value boundary or the frequency of the sampling value being larger than the baseline value boundary exceeds the baseline value confirmation frequency, the baseline value detecting unit outputs a low level; when the timing unit judges that the timing time is reached, the timing unit outputs a low level; the fourth switch is closed when the first or gate outputs a low level.
9. The capacitive touch key tamper resistant detection device of claim 7, wherein: the device also comprises a sampling control unit; the input end of the sampling control unit receives the sampling value, and the output end outputs a sampling control signal to the control signal input end of the timing sampling unit for connection; the control signal output end of the timing sampling unit is connected with the control signal input end of the timing unit; the sampling control unit is used for judging whether the sampling value is smaller than a base line value or not, and controlling the timing sampling unit to accelerate the sampling rate when the sampling value is smaller than the base line value; when the timing sampling unit accelerates the sampling rate, the timing sampling unit controls the timing unit to shorten the timing time.
10. The capacitive touch key tamper resistant detection device of claim 9, wherein: the timing unit comprises a timer, a third counter, a timing judgment condition generating unit and an eleventh comparator; the output end of the timer is connected with the input end of the third counter, the third counter counts the timer and outputs the counted value to one input end of the eleventh comparator; the input end of the timing judgment condition generating unit receives the timing control signal output by the timing sampling unit, and the output end outputs the timing judgment condition to the other input end of the eleventh comparator; the eleventh comparator is configured to determine whether the timer reaches a timing decision condition; the timing sampling unit shortens the timing time of the timing unit by controlling the timing decision condition generating unit to reduce the value of the timing decision condition.
11. The capacitive touch key tamper resistant detection device of claim 9, wherein: the device also comprises a sampling value stability judging unit, an average filtering unit, a digital filtering unit, a noise detecting unit, a timing unit, a baseline value updating judging unit, a first switch, a second switch and a fifth switch; the sampling value output end of the timing sampling unit is connected with the input end of the sampling value stability judging unit and the input end of the first switch; the output end of the sampling value stability judging unit is connected with the control signal input end of the first switch; the output end of the first switch is connected with the input end of the average filtering unit; the output end of the average filtering unit is connected with the input end of the digital filtering unit and the input end of the noise detection unit; the output end of the digital filtering unit is connected with the input ends of the second switch, the third switch, the fourth switch and the fifth switch; the output end of the second switch is connected with the input end of the key detection unit; the output end of the fifth switch is connected with the input end of the sampling control unit; the output end of the noise detection unit is connected with the control signal input ends of the second switch and the fifth switch; the two input ends of the baseline value updating judging unit are respectively connected with the output end of the baseline value detecting unit and the output end of the timing unit, and the output end is connected with the control signal input end of the fourth switch; the timing unit is used for judging whether the timing time is reached; the baseline value update judging unit is used for controlling the fourth switch to be closed or opened; the control signal output end of the timing sampling unit is connected with the control signal input end of the timing unit;
The sampling value stability judging unit is used for judging whether the difference value between the maximum sampling value and the minimum sampling value in the plurality of sampling values output by the timing sampling unit is larger than a preset difference value or not, and controlling the first switch to be switched off when the difference value is larger than the preset difference value; the average filtering unit averages the sampling values output by the timing sampling unit and outputs the average sampling values to the digital filtering unit and the noise detection unit; the digital filtering unit carries out digital filtering on the average sampling value output by the average filtering unit and outputs a filtered sampling value to the second switch; the noise detection unit is used for detecting whether the average sampling value output by the average filtering unit exceeds a noise threshold value or not, and controlling the second switch to be disconnected when the average sampling value exceeds the noise threshold value; the key detection unit is further used for detecting whether the filtering sampling value output by the second switch is larger than a key threshold value or not, and controlling to execute key operation when the number of times that the filtering sampling value is larger than the key threshold value exceeds the key confirmation number of times; the sampling control unit is used for judging whether the filtering sampling value is smaller than the baseline value or not, and controlling the timing sampling unit to accelerate the sampling rate when the filtering sampling value is smaller than the baseline value; when the timing sampling unit accelerates the sampling rate, the timing sampling unit controls the timing unit to shorten the timing time.
12. The capacitive touch key tamper resistant detection device of claim 11, wherein: the digital filtering unit comprises a first multiplier, a second multiplier, a first adder and a filtering sampling value register; the two input ends of the first multiplier respectively receive average sampling values and a first multiplication factor of 1/K, K=2 q Q is a positive integer; the output end of the first multiplier and the output end of the second multiplier are respectively connected with two input ends of the first adder; the output end of the first adder is connected with the input end of the filtering sampling value register; one input end of the second multiplier receives a second multiplication factor (K-1)/K, and the other input end is connected with the output end of the sampling value filtering registerAnd the filtering sampling value register feeds back the last filtering result to the second multiplier, and the filtering sampling value is output through multiple times of filtering.
13. A detection method using the capacitive touch key anti-interference detection device according to any one of claims 1 to 12, characterized by comprising the steps of:
(1) Starting;
(2) Initializing each module;
(3) Setting a key threshold and a base line value boundary;
(4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key;
(5) The timing sampling unit outputs a sampling value to the key detection unit;
(6) The key detection unit detects whether the sampling value is larger than a key threshold value, if so, the step (7) is carried out, and if not, the step (8) is carried out;
(7) The baseline value detection unit does not receive the sampling value output by the timing sampling unit, and the step (14) is performed;
(8) The baseline value detection unit receives the sampling value output by the timing sampling unit;
(9) The baseline value detection unit detects whether the sampling value is larger than a baseline value boundary, if so, the step (10) is carried out, and if not, the step (11) is carried out;
(10) The base line value detection unit detects whether the times of the sampling value being larger than the base line value boundary reach the base line value confirmation times, if so, the step (11) is carried out, and if not, the step (13) is carried out;
(11) The baseline value updating unit receives the sampling value output by the timing sampling unit;
(12) The baseline value updating unit updates the baseline value and returns to the step (4);
(13) The baseline value updating unit does not receive the sampling value output by the timing sampling unit;
(14) The baseline value updating unit does not update the baseline value, and returns to step (4).
14. A detection method using the capacitive touch key anti-interference detection device according to any one of claims 11 or 12, comprising the steps of:
(1) Starting;
(2) Initializing each module;
(3) Setting a noise threshold, a key threshold and a baseline value boundary;
(4) The timing sampling unit scans the touch key to obtain a capacitance value of the touch key;
(5) The timing sampling unit outputs a plurality of sampling values to the sampling value stability judging unit;
(6) The sampling value stability judging unit judges whether the difference value between the maximum sampling value and the minimum sampling value in the sampling values is larger than a preset difference value, if so, the step (7) is carried out, and if not, the step (8) is carried out;
(7) The average filtering unit does not receive the plurality of sampling values output by the timing sampling unit, and returns to the step (4);
(8) The average filtering unit receives a plurality of sampling values output by the timing sampling unit;
(9) The average filtering unit outputs an average sampling value to the digital filtering unit and the noise detecting unit;
(10) The noise detection unit detects whether the average sampling value is larger than a noise threshold value, if so, the step (11) is carried out, and if not, the step (12) and the step (26) are carried out;
(11) The key detection unit and the sampling control unit do not receive the filtering sampling value output by the digital filtering unit, and the step (4) is returned;
(12) The key detection unit receives the filtering sampling value output by the digital filtering unit;
(13) The key detection unit detects whether the filtered sampling value is larger than a key threshold value, if yes, the step (14) and the step (17) are carried out, and if not, the step (16) and the step (18) are carried out;
(14) The key detection unit detects whether the times of the filtering sampling value larger than the key threshold value reach the key confirmation times, if so, the step (15) is carried out, and if not, the step (16) is carried out;
(15) The key operation unit executes key operation and returns to the step (4);
(16) The key operation unit does not execute key operation and returns to the step (4);
(17) The baseline value detection unit does not receive the filtering sampling value output by the digital filtering unit, and the step (25) is performed;
(18) The baseline value detection unit receives a filtering sampling value output by the digital filtering unit;
(19) The baseline value detection unit detects whether the filtering sampling value is larger than a baseline value boundary, if so, the step (20) is carried out, and if not, the step (21) is carried out;
(20) The baseline value detection unit detects whether the times of the filtering sampling value being larger than the baseline value boundary reach the baseline value confirmation times or not, if yes, the step (21) is carried out, and if not, the step (24) is carried out;
(21) If the timing unit reaches the timing time, the step (22) is carried out, and if not, the step (24) is carried out;
(22) The baseline value updating unit receives the filtering sampling value output by the digital filtering unit;
(23) The baseline value updating unit updates the baseline value and returns to the step (4);
(24) The baseline value updating unit does not receive the filtering sampling value output by the digital filtering unit;
(25) The baseline value updating unit returns to the step (4) without updating the baseline value;
(26) The sampling control unit detects whether the filtered sampling value is smaller than a baseline value, if yes, the step (27) and the step (28) are carried out, and if not, the step (4) is returned;
(27) The timing sampling unit increases the sampling rate and returns to the step (4);
(28) The timing unit shortens the timing time and proceeds to step (21).
CN201811463711.7A 2018-11-30 2018-11-30 Capacitive touch key anti-interference detection device and detection method Active CN109428578B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811463711.7A CN109428578B (en) 2018-11-30 2018-11-30 Capacitive touch key anti-interference detection device and detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811463711.7A CN109428578B (en) 2018-11-30 2018-11-30 Capacitive touch key anti-interference detection device and detection method

Publications (2)

Publication Number Publication Date
CN109428578A CN109428578A (en) 2019-03-05
CN109428578B true CN109428578B (en) 2023-08-08

Family

ID=65514653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811463711.7A Active CN109428578B (en) 2018-11-30 2018-11-30 Capacitive touch key anti-interference detection device and detection method

Country Status (1)

Country Link
CN (1) CN109428578B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113126814B (en) * 2021-03-01 2023-06-20 卧安科技(深圳)有限公司 Key non-response correction method and device, terminal equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101968530A (en) * 2010-09-30 2011-02-09 江苏惠通集团有限责任公司 Key detection method and device
CN102594327A (en) * 2011-01-14 2012-07-18 苏州路之遥科技股份有限公司 Capacitive sensing key and key detection method
CN102667690A (en) * 2009-11-21 2012-09-12 飞思卡尔半导体公司 Methods and apparatus for performing capacitive touch sensing and proximity detection
CN103023476A (en) * 2012-11-21 2013-04-03 中山华帝燃具股份有限公司 Response method and control system of capacitive sensing type touch key
CN103197817A (en) * 2012-01-09 2013-07-10 美国博通公司 Fast touch detection in a mutual capacitive touch system
CN103762986A (en) * 2014-01-16 2014-04-30 四川和芯微电子股份有限公司 Sampling hold switch circuit
JP2014106829A (en) * 2012-11-29 2014-06-09 Mitsubishi Electric Corp Touch panel apparatus
CN104104375A (en) * 2014-06-25 2014-10-15 无锡中微爱芯电子有限公司 Method for enhancing mobile phone interference resistance of capacitive touch button and circuit thereof
CN203951459U (en) * 2014-07-02 2014-11-19 无锡和晶科技股份有限公司 A kind of self-defined touch key-press switch
CN104935320A (en) * 2014-03-20 2015-09-23 安凯(广州)微电子技术有限公司 Method for detecting state of capacitive touch key
CN106656204A (en) * 2016-11-28 2017-05-10 杭州九阳小家电有限公司 Method and device for implementing interference resistance of touch key

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7847614B2 (en) * 2007-05-30 2010-12-07 Kyocera Corporation Switch noise reduction device and method using counter
US8508493B2 (en) * 2010-06-21 2013-08-13 Pixart Imaging Inc. Reduction of electromagnetic interference in a capacitive touchscreen system
US9811220B2 (en) * 2015-06-19 2017-11-07 NXA USA, Inc. Signal adaptive filtering for touch detection

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102667690A (en) * 2009-11-21 2012-09-12 飞思卡尔半导体公司 Methods and apparatus for performing capacitive touch sensing and proximity detection
CN101968530A (en) * 2010-09-30 2011-02-09 江苏惠通集团有限责任公司 Key detection method and device
CN102594327A (en) * 2011-01-14 2012-07-18 苏州路之遥科技股份有限公司 Capacitive sensing key and key detection method
CN103197817A (en) * 2012-01-09 2013-07-10 美国博通公司 Fast touch detection in a mutual capacitive touch system
CN103023476A (en) * 2012-11-21 2013-04-03 中山华帝燃具股份有限公司 Response method and control system of capacitive sensing type touch key
JP2014106829A (en) * 2012-11-29 2014-06-09 Mitsubishi Electric Corp Touch panel apparatus
CN103762986A (en) * 2014-01-16 2014-04-30 四川和芯微电子股份有限公司 Sampling hold switch circuit
CN104935320A (en) * 2014-03-20 2015-09-23 安凯(广州)微电子技术有限公司 Method for detecting state of capacitive touch key
CN104104375A (en) * 2014-06-25 2014-10-15 无锡中微爱芯电子有限公司 Method for enhancing mobile phone interference resistance of capacitive touch button and circuit thereof
CN203951459U (en) * 2014-07-02 2014-11-19 无锡和晶科技股份有限公司 A kind of self-defined touch key-press switch
CN106656204A (en) * 2016-11-28 2017-05-10 杭州九阳小家电有限公司 Method and device for implementing interference resistance of touch key

Also Published As

Publication number Publication date
CN109428578A (en) 2019-03-05

Similar Documents

Publication Publication Date Title
CN109428579B (en) Capacitive touch key anti-interference detection device and detection method
CN109643200B (en) Electronic device, touch detection circuit, and method for updating reference value of touch screen
US20130120053A1 (en) Touch pad capacitive sensor circuit
CN108259044B (en) Touch key scanning method and device and computer readable storage medium
CN111352534B (en) Touch key touch threshold correction method, wire controller, electric appliance and computer readable storage medium
CN109428578B (en) Capacitive touch key anti-interference detection device and detection method
CN109564481A (en) Update method, device, touch screen and the electric terminal of touch screen present reference value
CN110739953B (en) Scene type signal self-adaptive processing method of capacitive touch key and electronic device
CN108512542B (en) Touch key signal processing method and device and computer readable storage medium
KR100859669B1 (en) Touch sensor
WO2017197574A1 (en) Capacitance detection device
CN103513834A (en) Sensing circuit of touch panel and method for operating sensing circuit of touch panel
JP2018116631A (en) Touch detection device
US11863174B2 (en) Detection chip capable of cancelling baseline voltage
CN209419594U (en) A kind of anti-interference detection device of capacitance type touch key
CN113541668A (en) Touch sensing method, circuit and electronic equipment
CN209419593U (en) A kind of anti-interference detection device of capacitance type touch key
KR100531800B1 (en) Noise filtering method for touch screen
JP2012216028A (en) Input unit for electronic device and input method
JP2018116630A (en) Touch detection device
CN110531641B (en) Method for controlling terminal equipment, control device and terminal equipment
CN111106820B (en) Touch key control system and control method thereof
CN113126814A (en) Key no-response correction method and device, terminal equipment and storage medium
CN107153489B (en) Touch detection method
CN113220168B (en) Multi-mode operation method of capacitive touch panel

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