Touch detection circuit, method and electronic device
By constructing a dual-channel touch detection circuit and utilizing synchronous control and differential processing techniques, the noise interference and baseline drift problems of capacitive touch detection in complex electromagnetic environments were solved, achieving touch detection with high signal-to-noise ratio and high reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PUYA SEMICON SHANGHAI CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-26
AI Technical Summary
Existing capacitive touch detection technology struggles to accurately capture minute capacitance changes in complex electromagnetic environments, leading to false touches or detection failures. This is especially true in harsh power environments and with temperature variations, where noise interference and baseline drift are severe.
It adopts a dual-channel architecture, including an external sensing capacitor circuit and an internal reference capacitor circuit. The two are driven to charge and discharge synchronously through synchronous control logic, and the difference in the number of charge and discharge cycles is processed by a differential circuit to cancel common-mode interference and retain the differential signal caused by touch.
It significantly improves the signal-to-noise ratio and reliability of touch detection, reduces false touches and detection failures, and enhances the accuracy of touch detection in complex environments.
Smart Images

Figure CN122092849A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of touch detection technology, and more particularly to a touch detection circuit, method, and electronic device. Background Technology
[0002] Capacitive touch sensing technology is widely used in consumer electronics, smart homes, and automotive electronics. In the signal processing flow of a capacitive touch detection system, accurate capture of minute capacitance changes caused by finger touches is crucial for reliable human-computer interaction. Typically, touch detection can be performed by measuring the charging and discharging characteristics or frequency changes of the sensing electrodes to determine the touch state. However, with increasingly complex application scenarios, existing conventional touch designs often struggle to detect weak signal changes in complex electromagnetic environments. For example, in harsh power supply environments or rapidly changing temperature environments, direct interference from power supply noise and drift in the detection baseline often lead to false touches or detection failures. Therefore, improving the reliability of touch detection under complex electromagnetic and environmental interference conditions is a critical issue. Summary of the Invention
[0003] In view of the above, embodiments of this disclosure provide a touch detection circuit, method, and electronic device to improve the reliability of touch detection. In a first aspect, a touch detection circuit is provided, comprising: a reference capacitor circuit; a first detection circuit connected to a sensing capacitor circuit and configured to perform a first charge-discharge operation on the sensing capacitor circuit; a second detection circuit connected to the reference capacitor circuit and configured to perform a second charge-discharge operation on the reference capacitor circuit; a synchronization circuit connected to the first and second detection circuits and configured to synchronously control the first detection circuit to perform the charge-discharge operation on the sensing capacitor circuit based on a preset clock signal, and the second detection circuit to perform the charge-discharge operation on the reference capacitor circuit; the first detection circuit is further configured to determine a first charge-discharge cycle number of the sensing capacitor circuit based on the first charge-discharge operation; the second detection circuit is further configured to determine a second charge-discharge cycle number of the reference capacitor circuit based on the second charge-discharge operation; and a differential circuit connected to the first and second detection circuits and configured to determine a touch detection signal based on the first and second charge-discharge cycle numbers.
[0004] Optionally, the reference capacitor circuit includes: a capacitor array and a configuration register; the capacitor array includes at least one fixed capacitor unit and multiple switched capacitor units connected in parallel, configured to provide a first capacitance value to match the initial capacitance value of the sensing capacitor circuit; the switched capacitor unit includes a first capacitor and a first switch connected in series; the configuration register is connected to the capacitor array and configured to control the on and off of the multiple switched capacitor units based on register configuration parameters to adjust the first capacitance value of the reference capacitor circuit.
[0005] Optionally, the first detection circuit includes a first current mirror, and the second detection circuit includes a second current mirror; the first current mirror and the second current mirror are configured as a common source and common gate structure and connected to a reference current source, and are configured to charge the sensing capacitor circuit and the reference capacitor circuit based on the bias current provided by the reference current source.
[0006] Optionally, the first detection circuit further includes: a first hysteresis comparator; the second detection circuit further includes: a second hysteresis comparator; the first inverting input terminal of the first hysteresis comparator and the second inverting input terminal of the second hysteresis comparator are respectively connected to a reference voltage source, the first non-inverting input terminal of the first hysteresis comparator is connected to an inductive capacitor circuit, and the second non-inverting input terminal of the second hysteresis comparator is connected to a reference capacitor circuit.
[0007] Optionally, the first detection circuit further includes a first counter, and the second detection circuit further includes a second counter; the first counter is connected to the output of the first hysteresis comparator and is configured to count the rising edges of the first comparison result signal to obtain the first charge-discharge cycle number; the second counter is connected to the output of the second hysteresis comparator and is configured to count the rising edges of the second comparison result signal to obtain the second charge-discharge cycle number.
[0008] Optionally, the first detection circuit further includes a first charge / discharge control circuit and a first switching unit, and the second detection circuit further includes a second charge / discharge control circuit and a second switching unit. The first charge / discharge control circuit is connected to the output of the first hysteresis comparator and is configured to receive a first comparison result signal output by the first hysteresis comparator, wherein the first comparison result signal is used to indicate whether the voltage on the inductive capacitor circuit reaches the voltage threshold of the reference voltage source. The first charge / discharge control circuit is also configured to generate a first switching control command based on the comparison result signal, and the first switching unit is configured to control the inductive capacitor circuit to switch between a charging state and a discharging state in response to the first switching control command. The second charge / discharge control circuit is connected to the output of the second hysteresis comparator and is configured to receive a second comparison result signal output by the second hysteresis comparator, wherein the second comparison result signal is used to indicate whether the voltage on the reference capacitor circuit reaches the voltage threshold of the reference voltage source. The second charge / discharge control circuit is also configured to generate a second switching control command based on the second comparison result signal, and the second switching unit is configured to control the reference capacitor circuit to switch between a charging state and a discharging state in response to the second switching control command.
[0009] Optionally, the synchronization circuit includes a timer configured to generate a counting enable signal with a preset time window width based on a preset clock signal; a first detection circuit and a second detection circuit are configured to perform a counting operation during the validity period of the counting enable signal, the sampling duration of the first detection circuit and the second detection circuit being determined based on a preset time window width.
[0010] Optionally, it also includes: a calibration circuit, connected to the first detection circuit and the second detection circuit, configured to compare the first charge-discharge cycle count with the second charge-discharge cycle count in the non-touch state of the sensing capacitor circuit, and update the value of the configuration register based on the comparison result until the difference between the first charge-discharge cycle count and the second charge-discharge cycle count is less than a preset tolerance.
[0011] In a second aspect, a touch detection method is provided, applied to the touch detection circuit provided in the first aspect above, comprising: synchronously executing a first charging and discharging operation for a sensing capacitor circuit and a second charging and discharging operation for a reference capacitor circuit based on a preset clock signal; counting the number of first charging and discharging cycles generated by the first charging and discharging operation and the number of second charging and discharging cycles generated by the second charging and discharging operation; and determining a touch detection signal based on the difference between the number of first charging and discharging cycles and the number of second charging and discharging cycles.
[0012] Thirdly, an electronic device is provided, including the touch detection circuit provided in the first aspect above. Attached Figure Description
[0013] The accompanying drawings used in the description of the embodiments of this disclosure are briefly introduced below: Figure 1 The diagram shows a schematic representation of a touch detection circuit provided in some embodiments of this application. Figure 2 This paper shows a schematic diagram of another touch detection circuit provided in some embodiments of the present application; Figure 3 A flowchart illustrating a touch detection method provided in some embodiments of this application is shown. Detailed Implementation
[0014] To more clearly illustrate the technical solutions in the embodiments of this disclosure, examples of implementation methods of this disclosure will be described below with reference to the accompanying drawings. The accompanying drawings described below are merely some embodiments of this disclosure. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without creative effort. Adjustments and improvements made without departing from the concept of this disclosure are all within the protection scope of this disclosure.
[0015] To keep the drawings simple, each figure only schematically shows the parts relevant to the embodiment, and they do not represent the actual structure of the product. In addition, for the sake of clarity and ease of understanding, some figures only schematically show parts of components with the same structure or function, and there may actually be more or fewer components with the same structure or function.
[0016] In this disclosure, unless otherwise expressly specified and limited, ordinal numbers, such as “first”, “second”, etc., are used only to distinguish and describe related objects, and should not be construed as indicating or implying the relative importance or order between related objects; furthermore, they do not represent the quantity of related objects. “Multiple” includes two or more, and other quantifiers are similar. “ / ” is used to describe the relationship between related objects, indicating an “or” relationship between them. “And / or” is used to describe the relationship between related objects, including any combination relationship between them, such as “a and / or b” including: “a alone”, “b alone”, or “a and b”. “One or more” or “at least one” of multiple objects refers to any object or any combination of multiple objects, such as “one or more of a1, a2, a3” or “at least one of a1, a2, a3” including: “a1 alone”, “a2 alone”, “a3 alone”, “a1 and a2”, “a1 and a3”, “a2 and a3”, or “a1, a2 and a3”.
[0017] Capacitive touch buttons, as a core component of human-computer interaction in modern electronic devices, primarily identify user commands by detecting changes in parasitic capacitance generated when a human finger touches the screen. In practical applications, the system obtains a digital measurement value characterizing the capacitance by charging and discharging external sensing electrodes and recording the charging and discharging cycle or time. However, this conventional approach, relying on a single channel for absolute value measurement, faces significant challenges in dynamic scenarios with high interference or complex environments. On one hand, in low-sensitivity product structures, the capacitance change caused by touch is extremely small, and conventional touch designs often struggle to effectively extract touch features from the background signal due to high background noise, leading to detection failure. On the other hand, in harsh power supply environments, power supply noise can directly couple to the detection circuit, or rapid changes in ambient temperature can cause circuit parameter drift. These common-mode interferences can directly cause fluctuations in the touch baseline, leading to accidental touches. Since the signal-to-noise ratio and anti-interference performance of current solutions are entirely limited by the chip's power supply quality and the inherent characteristics of external components, there is a clear ceiling to performance improvement. To address the aforementioned noise interference problem, this application provides a touch detection circuit and method. By constructing a dual-channel architecture comprising an external sensing channel and an internal reference channel, and utilizing an internal reference capacitor circuit, the internal reference capacitor circuit is dynamically adjusted to match the initial value of the external sensing capacitor circuit in a non-touch state. Based on this, synchronous control logic drives the two channels to synchronously charge, discharge, and count. Differential processing actively cancels out common system noise, power supply interference, and temperature drift effects, while preserving and highlighting the differential signal caused by touch, thereby significantly improving the signal-to-noise ratio and reliability of the touch detection process.
[0018] The following description is in conjunction with the accompanying drawings: Please refer to Figure 1The diagram shows a schematic of the structure of a touch detection circuit provided in some embodiments of this application. The touch detection circuit 100 includes: a reference capacitor circuit 110; a first detection circuit 120 connected to the sensing capacitor circuit 10 and configured to perform a first charge-discharge operation on the sensing capacitor circuit; a second detection circuit 130 connected to the reference capacitor circuit 110 and configured to perform a second charge-discharge operation on the reference capacitor circuit 110; a synchronization circuit 140 connected to the first detection circuit 120 and the second detection circuit 130 and configured to synchronously control the first detection circuit 120 to perform charge-discharge operations on the sensing capacitor circuit 10 and the second detection circuit 130 to perform charge-discharge operations on the reference capacitor circuit 110 based on a preset clock signal; the first detection circuit 120 is further configured to determine the first charge-discharge cycle number of the sensing capacitor circuit 10 based on the first charge-discharge operation; the second detection circuit 130 is further configured to determine the second charge-discharge cycle number of the reference capacitor circuit 110 based on the second charge-discharge operation; and a differential circuit 150 connected to the first detection circuit 120 and the second detection circuit 130 and configured to determine a touch detection signal based on the first charge-discharge cycle number and the second charge-discharge cycle number.
[0019] In the above embodiments, the touch detection circuit 100 can be used to implement capacitive touch detection under complex electromagnetic environments or fluctuating temperature conditions. The sensing capacitor circuit 10 typically corresponds to the external capacitive sensor that the user actually contacts, such as a touch button pad. The reference capacitor circuit 110 is located inside the circuit to provide a stable capacitance reference for subsequent differential comparison. The first detection circuit 120 serves as the external sensing channel of the system, and its input is connected to the sensing capacitor circuit 10. During operation, the first detection circuit 120 is configured to perform a first charge-discharge operation on the sensing capacitor circuit 10, that is, to drive the sensing capacitor circuit 10 to perform periodic charging and discharging, and to monitor its voltage change process in real time. Based on the fact that the sensing capacitor circuit 10 can complete charging and discharging within a specific time window, the first detection circuit 120 can determine the number of the first charge-discharge cycles, which directly reflects the current equivalent capacitance of the sensing capacitor circuit 10. Corresponding to the first detection circuit 120, the second detection circuit 130 serves as the internal reference channel of the circuit and is connected to the reference capacitor circuit 110. The second detection circuit 130 can adopt a circuit structure and control logic symmetrical to the first detection circuit 120 to perform a second charge-discharge operation on the reference capacitor circuit 110. By performing the same periodic charge-discharge cycle on the reference capacitor circuit 110, the second detection circuit 130 counts and determines the number of the second charge-discharge cycle. Since the reference capacitor circuit 110 is not directly affected by external finger touch, the number of cycles it generates is mainly affected by the inherent parameters of the circuit and environmental common-mode factors, so it can serve as a dynamic background reference. To ensure that the data of the two channels are strictly comparable, the synchronization circuit 140 plays a key coordinating role and generates synchronization control commands based on a preset clock signal to synchronously control the charge-discharge operation of the first detection circuit 120 on the sensing capacitor circuit 10 and the charge-discharge operation of the second detection circuit 130 on the reference capacitor circuit 110. This control mechanism ensures that the two channels start at the same time and operate under the same time reference, thereby ensuring that the charge-discharge actions of the two channels are strictly aligned on the time axis. The differential circuit 150 can perform the final signal calculation based on the number of the first charge-discharge cycle and the number of the second charge-discharge cycle, and calculate the difference between the two cycle counts. Since common-mode interference such as ambient temperature drift or power supply voltage fluctuations often affect the charging and discharging rates of both channels equally, causing the number of cycles to increase or decrease simultaneously, the differential circuit 150 can effectively cancel these common-mode variations through subtraction. The value obtained after differential processing is the touch detection signal, which can remove ambient noise and retain only the capacitance change characteristics caused by the finger touch sensing capacitor circuit 10, thereby achieving accurate touch recognition.
[0020] The touch detection circuit provided in this embodiment constructs symmetrical sensing and reference channels, uses a synchronization circuit to ensure strict synchronization between the two during charging, discharging, and sampling processes, and combines the digital subtraction processing mechanism of the differential circuit. It can effectively utilize the consistent response characteristics of the dual channels to common-mode noise to suppress system noise such as ambient temperature changes and power supply voltage fluctuations. At the same time, it accurately retains and highlights the differential signal changes caused by touch, thereby improving the signal-to-noise ratio and anti-interference capability of the touch detection system and reducing the problem of accidental touches or failures in harsh environments.
[0021] Figure 2 A schematic diagram of another touch detection circuit provided in some embodiments of this application is shown. The reference capacitor circuit 110 includes: a capacitor array 111 and a configuration register 112; the capacitor array 111 includes at least one fixed capacitor unit 1111 and multiple switched capacitor units 1112 connected in parallel, configured to provide a first capacitance value to match the initial capacitance value of the sensing capacitor circuit 10; the switched capacitor unit 1112 includes a first capacitor and a first switch connected in series; the configuration register 112 is connected to the capacitor array 111 and configured to control the on / off state of the multiple switched capacitor units based on register configuration parameters to adjust the first capacitance value of the reference capacitor circuit 110.
[0022] To ensure the reference channel accurately simulates the physical characteristics of the sensing channel, the capacitor array 111 can employ a combination of a fixed base and fine-tuning architecture. The fixed capacitor unit 1111 serves as the reference, and its capacitance value is typically designed to approximate the estimated parasitic capacitance base of the sensing capacitor circuit 10 (i.e., the external touch button) in a non-touch state. Multiple switched capacitor units 1112 serve as the adjustment section, connected in parallel across the fixed capacitor unit 1111. To achieve a wide range and high-precision capacitance adjustment, the capacitance values of the multiple switched capacitor units 1112 can be configured using a binary weighted method, for example, set to C, 2C, 4C...2 respectively. nC. The first capacitor inside each switched capacitor unit 1112 is connected in series with the first switch. When the first switch is in the on state, the corresponding first capacitor is connected to the circuit to participate in charging and discharging. When the first switch is off, this branch is bypassed. The configuration register 112 serves as the digital control core, and its output is connected one-to-one with the control terminal of each switched capacitor unit 1112, such as the gate or control bit of the first switch. By writing different register configuration parameters to the configuration register 112, the on / off combinations of these first switches can be controlled. For example, writing all "0"s disconnects all regulating capacitors, while writing all "1"s connects all regulating capacitors. During system power-on initialization or environmental calibration, the circuit control logic can dynamically adjust the parameters in the configuration register 112 based on the difference in the output count values of the first detection circuit 120 and the second detection circuit 130. By changing the combination of the number of switched capacitor units 1112 connected to the circuit, the total equivalent capacitance (i.e., the first capacitance value) of the reference capacitor circuit 110 is finely adjusted until it achieves a high degree of matching with the initial capacitance value of the sensing capacitor circuit 10.
[0023] In some embodiments of this application, the first detection circuit 120 includes a first current mirror 121, and the second detection circuit 130 includes a second current mirror 131; the first current mirror 121 and the second current mirror 131 are configured as a common source and common gate structure and connected to a reference current source 20, and are configured to charge the sensing capacitor circuit 10 and the reference capacitor circuit 110 based on the bias current provided by the reference current source 20.
[0024] In some embodiments of this application, the first detection circuit 120 further includes a first hysteresis comparator 122; the second detection circuit 130 further includes a second hysteresis comparator 132; the first inverting input terminal of the first hysteresis comparator 122 and the second inverting input terminal of the second hysteresis comparator 132 are respectively connected to the reference voltage source 20, the first non-inverting input terminal of the first hysteresis comparator 122 is connected to the sensing capacitor circuit 10, and the second non-inverting input terminal of the second hysteresis comparator 132 is connected to the reference capacitor circuit 110.
[0025] To ensure the accuracy and consistency of voltage detection, the first detection circuit 120 and the second detection circuit 130 employ a highly symmetrical hardware design in their comparator stages. The first hysteresis comparator 122 and the second hysteresis comparator 132 are not only identical in circuit topology but also in layout, in order to minimize mismatch caused by device manufacturing process errors.
[0026] The first inverting input of the first hysteresis comparator 122 and the second inverting input of the second hysteresis comparator 132 are both connected to the same reference voltage source 20. This shared reference source design is crucial because when the reference voltage source 20 experiences voltage jitter due to power supply fluctuations or temperature drift, this disturbance acts as a common-mode signal simultaneously on the inverting inputs of both comparators. Meanwhile, the first non-inverting input of the first hysteresis comparator 122 monitors the charging and discharging voltage on the sensing capacitor circuit 10 in real time, while the second non-inverting input of the second hysteresis comparator 132 monitors the voltage on the reference capacitor circuit 110 in real time. This differential input configuration ensures that the voltage comparison operation of the two channels is based on the exact same reference level. Furthermore, both comparators integrate a positive feedback network to introduce hysteresis characteristics (e.g., a preset 50mV hysteresis window), and the comparator's output state only flips when the voltage change on the sensing capacitor or reference capacitor exceeds this hysteresis threshold. For example, the first hysteresis comparator 122 and the second hysteresis comparator 132 can be implemented using a shared finite state machine or a synchronization signal generator. The hysteresis comparator architecture with a shared reference current source, as described above, ensures high consistency of electrical characteristics between the two channels by utilizing a shared reference voltage source, making power supply noise appear as common-mode interference and thus canceled out by subsequent differential calculations. On the other hand, the introduction of hysteresis effectively suppresses high-frequency glitches and minor noise in the input signal, preventing the comparator from frequently flipping erroneously near the threshold critical point, thereby improving the stability and anti-interference capability of the touch detection circuit during the analog signal sampling stage.
[0027] In practical applications, rapid changes in ambient temperature or fluctuations in power supply voltage typically manifest as common-mode interference. Since the first detection circuit 120 and the second detection circuit 130 employ symmetrical circuit structures and share a reference current source, the aforementioned common-mode interference will affect the circuit parameters of both channels in the same way and to the same extent. For example, it will change the mirror current value of the current source or the toggling threshold of the comparator to the same degree. The direct impact of this common-mode interference on the counting result is that it causes a synchronous drift in the charge-discharge cycles of the two channels, thereby affecting the first charge-discharge cycle count N. sense The second charge / discharge cycle number N ref They exhibit a tendency to increase or decrease simultaneously. Based on this characteristic, the differential circuit 150 is configured to perform subtraction operations, such as ΔN = N. sense -N ref In this calculation process, the first charge-discharge cycle number N is included. sense The second charge / discharge cycle number N refIn this circuit, identical changes caused by common-mode interference cancel each other out. Therefore, the calculated difference ΔN is insensitive to common-mode interference such as ambient temperature and power supply fluctuations, thus ensuring the stability of the detection baseline. Simultaneously, the differential circuit 150 can sensitively extract the differential signal caused by the touch action. When a touch occurs, the proximity of a human finger only causes the equivalent capacitance C of the sensing capacitor circuit 10 to... sense The increase in the number of charging and discharging cycles leads to a longer charging and discharging cycle for the first detection circuit 120, thus increasing the number of charging and discharging cycles N. sense The number of charge-discharge cycles N is significantly reduced; while at this time, the reference capacitor circuit 110 is not affected by the touch, and its corresponding second charge-discharge cycle number N ref The basic structure remains unchanged. Therefore, the difference ΔN output by the differential circuit 150 will produce a significant negative jump. By detecting whether the jump amplitude exceeds a preset threshold, valid touch actions can be accurately identified while suppressing noise.
[0028] In some embodiments of this application, the first detection circuit 120 further includes a first counter 123, and the second detection circuit 130 further includes a second counter 133; the first counter 123 is connected to the output terminal of the first hysteresis comparator 122 and is configured to record the level time of the first comparison result signal to obtain the first charge-discharge cycle count; the second counter 133 is connected to the output terminal of the second hysteresis comparator 132 and is configured to record the level time of the second comparison result signal to obtain the second charge-discharge cycle count.
[0029] In some embodiments of this application, the first detection circuit 120 further includes a first charge / discharge control circuit 124, a first switching unit 125, and a third capacitor 126; the second detection circuit 130 further includes a second charge / discharge control circuit 134, a second switching unit 135, and a fourth capacitor 136. The first charge / discharge control circuit 124 is connected to the output of the first hysteresis comparator 122 and is configured to receive a first comparison result signal output by the first hysteresis comparator 122, wherein the first comparison result signal is used to indicate whether the voltage on the sensing capacitor circuit 10 reaches the voltage threshold of the reference voltage source 20. The first charge / discharge control circuit 124 is also configured to generate a first switching control command based on the comparison result signal, and the first switching unit 125 is configured to control the sensing capacitor circuit 10 to switch between a charging state and a discharging state in response to the first switching control command, wherein when the first switching unit 125 is turned on, the third... Capacitor 126 is charged through a reference voltage source. When the first switching unit 125 is turned off, the third capacitor 126 discharges into the inductive capacitor circuit 10. The second charge-discharge control circuit 134 is connected to the output of the second hysteresis comparator 132 and is configured to receive the second comparison result signal output by the second hysteresis comparator 132. The second comparison result signal is used to indicate whether the voltage on the reference capacitor circuit 110 reaches the voltage threshold of the reference voltage source. The second charge-discharge control circuit 134 is also configured to generate a second switching control command based on the second comparison result signal. The second switching unit 135 is configured to control the reference capacitor circuit 110 to switch between charging and discharging states in response to the second switching control command. When the second switching unit 135 is turned on, the fourth capacitor 136 is charged through the reference voltage source. When the second switching unit 135 is turned off, the fourth capacitor 136 discharges into the reference capacitor circuit 110.
[0030] To convert the simulated capacitor charging and discharging process into discrete values that can be processed by a digital system, this embodiment integrates a digital counting unit into the detection circuit. For example... Figure 2As shown, the first detection circuit 120 is also equipped with a first counter 123, the input of which is directly connected to the output of the first hysteresis comparator 122. For example, it can record the signal duration of the high-level signal output by the first hysteresis comparator 122. Simultaneously, the first counter 123 captures how many waveforms exist in the system time within the signal duration of the high-level signal. For instance, if each waveform of the system time is 1 / 10 of a second, the first counter 123 records 10 times, thus determining the signal duration of the high-level signal to be 1 second. By counting the number of times within a preset time window, the first counter 123 can accurately obtain the first charge-discharge cycle count. Similarly, the second detection circuit 130 is also symmetrically equipped with a second counter 133, which is connected to the second hysteresis comparator 132, used to capture and count the pulse signals generated by the reference channel, thereby obtaining the second charge-discharge cycle count. Furthermore, the first comparison result signal reflects the current voltage state of the sensing capacitor circuit 10 in real time, i.e., whether it has been charged to the high threshold set by the reference voltage source 20, or discharged to the low threshold. Based on this real-time voltage feedback, the first charge / discharge control circuit 124 can generate a corresponding logic level or pulse as a first switch control command and send it to the first switch unit 125. The first switch unit 125 is typically composed of an analog switching transistor (such as a MOSFET), which responds to the command to change the circuit's on / off state, thereby controlling the sensing capacitor circuit 10 to switch quickly and accurately between the charging circuit being on (charging state) and the discharging circuit being on (discharging state). Corresponding to the above structure, the second detection circuit 130 also integrates the second charge / discharge control circuit 134 and the second switch unit 135. The second charge / discharge control circuit 134 determines whether the voltage on the reference capacitor circuit 110 has reached a threshold based on the second comparison result signal fed back by the second hysteresis comparator 132, and generates a second switch control command accordingly to drive the second switch unit 135 to operate. In the above process, the third capacitor 126 and the fourth capacitor 136 have the same charging and discharging process. Taking the third capacitor 126 as an example, when the first hysteresis comparator 122 outputs high, the first switching unit 125 is turned off, and the first current mirror 121 stops charging the third capacitor 126. When the first hysteresis comparator 122 outputs low, the first switching unit 125 is turned off, and the first current mirror 121 charges the third capacitor 126. The discharging process of the third capacitor 126 is to discharge to the inductive capacitor circuit 10 through the first charging and discharging control circuit 124. The inductive capacitor circuit 10 also has a charging and discharging process. The charging process is that the third capacitor 126 charges the inductive capacitor circuit 10, and the discharging process is that the inductive capacitor circuit 10 discharges to ground.
[0031] In some embodiments of this application, the synchronization circuit includes a timer configured to generate a counting enable signal with a preset time window width based on a preset clock signal, and to generate a charge / discharge synchronization control signal based on the preset clock signal; a first detection circuit and a second detection circuit are configured to perform a counting operation during the validity period of the counting enable signal, and the sampling duration of the first detection circuit and the second detection circuit is determined based on a preset time window width; a first charge / discharge control circuit and a second charge / discharge control circuit are configured to synchronously control the charging and discharging of a reference capacitor circuit and an induction capacitor circuit based on the charge / discharge synchronization control signal.
[0032] In some embodiments of this application, a calibration circuit is also included, connected to the first detection circuit and the second detection circuit, configured to compare the first charge-discharge cycle count with the second charge-discharge cycle count in the non-touch state of the sensing capacitor circuit, and update the value of the configuration register based on the comparison result until the difference between the first charge-discharge cycle count and the second charge-discharge cycle count is less than a preset tolerance.
[0033] Furthermore, to eliminate initial channel imbalance caused by differences in parasitic capacitance in the circuit board or deviations in chip manufacturing processes, this application can also introduce an automatic calibration mechanism. The calibration circuit can perform the calibration process during the system initialization phase (e.g., after power-on reset) or during a specific maintenance cycle. During this phase, the system defaults to a non-touch state of the sensing capacitor circuit 10. The calibration circuit first controls the simultaneous activation of the first detection circuit 120 and the second detection circuit 130 to obtain the first charge-discharge cycle number N under the current environment. sense With the second charge-discharge cycle number N ref Subsequently, the calibration circuit compares these two values and calculates the absolute value of the difference. If the difference exceeds the preset tolerance range, it indicates that the initial capacitive load of the external sensing channel and the internal reference channel is mismatched. At this time, the calibration circuit generates an updated digital configuration signal and writes it to the configuration register 112 based on the polarity and magnitude of the difference. The configuration register 112 then adjusts the conduction combination of the switched capacitor units 1112 in the capacitor array 111, thereby changing the equivalent capacitance value of the reference capacitor circuit 110. This ensures that the subsequent output touch detection signal can purely reflect the capacitance change caused by the touch, without being overwhelmed by the initial system error, thus guaranteeing the high accuracy and reliability of differential detection from the source.
[0034] Figure 3 The diagram illustrates a flowchart of a touch detection method provided in some embodiments of this application, applied to the touch detection circuit provided in the above embodiments, including: S310: Based on a preset clock signal, synchronously execute the first charging and discharging operation for the sensing capacitor circuit and the second charging and discharging operation for the reference capacitor circuit. S320: Count the number of first charge-discharge cycles generated by the first charge-discharge operation and the number of second charge-discharge cycles generated by the second charge-discharge operation; S330: Determine the touch detection signal based on the difference between the number of the first charge-discharge cycles and the number of the second charge-discharge cycles.
[0035] The specific implementation and beneficial effects of the above touch detection methods can be found in the touch detection circuit description, and will not be repeated here.
[0036] Based on the same technical concept, this application also provides an electronic device, including the touch detection circuit provided in the above embodiments.
[0037] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not described in detail or in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Furthermore, the above embodiments can be freely combined as needed.
Claims
1. A touch detection circuit, characterized in that, include: Reference capacitor circuit; A first detection circuit, connected to an inductive capacitor circuit, is configured to perform a first charge-discharge operation on the inductive capacitor circuit. The second detection circuit is connected to the reference capacitor circuit and is configured to perform a second charge-discharge operation on the reference capacitor circuit. A synchronization circuit, connected to the first detection circuit and the second detection circuit, is configured to synchronously control the first detection circuit to perform charging and discharging operations on the inductive capacitor circuit and the second detection circuit to perform charging and discharging operations on the reference capacitor circuit based on a preset clock signal. The first detection circuit is also configured to determine the first charge-discharge cycle number of the sensing capacitor circuit based on the first charge-discharge operation; The second detection circuit is further configured to determine the second charge-discharge cycle number of the reference capacitor circuit based on the second charge-discharge operation; A differential circuit, connected to the first detection circuit and the second detection circuit, is configured to determine a touch detection signal based on the first charge-discharge cycle number and the second charge-discharge cycle number.
2. The touch detection circuit according to claim 1, characterized in that, The reference capacitor circuit includes: a capacitor array and a configuration register; The capacitor array includes at least one fixed capacitor unit and a plurality of switched capacitor units connected in parallel, configured to provide a first capacitance value such that the first capacitance value matches the initial capacitance value of the sensing capacitor circuit. The switched capacitor unit includes a first capacitor and a first switch connected in series; The configuration register is connected to the capacitor array and is configured to control the on and off of multiple switched capacitor units based on register configuration parameters, so as to adjust the first capacitance value of the reference capacitor circuit.
3. The touch detection circuit according to claim 2, characterized in that, The first detection circuit includes a first current mirror, and the second detection circuit includes a second current mirror; The first current mirror and the second current mirror are configured as a common source and common gate structure and connected to a reference current source. They are configured to charge the inductive capacitor circuit and the reference capacitor circuit based on the bias current provided by the reference current source.
4. The touch detection circuit according to claim 3, characterized in that, The first detection circuit further includes: a first hysteresis comparator; the second detection circuit further includes: a second hysteresis comparator; The first inverting input of the first hysteresis comparator and the second inverting input of the second hysteresis comparator are respectively connected to a reference voltage source. The first non-inverting input of the first hysteresis comparator is connected to the sensing capacitor circuit, and the second non-inverting input of the second hysteresis comparator is connected to the reference capacitor circuit.
5. The touch detection circuit according to claim 4, characterized in that, The first detection circuit further includes a first counter, and the second detection circuit further includes a second counter; The first counter is connected to the output of the first hysteresis comparator and is configured to record the level time of the first comparison result signal in order to obtain the first charge-discharge cycle count. The second counter is connected to the output of the second hysteresis comparator and is configured to record the level time of the second comparison result signal to obtain the second charge-discharge cycle count.
6. The touch detection circuit according to claim 4, characterized in that, The first detection circuit further includes a first charge-discharge control circuit, a first switching unit, and a third capacitor; the second detection circuit further includes a second charge-discharge control circuit, a second switching unit, and a fourth capacitor. The first charge-discharge control circuit is connected to the output of the first hysteresis comparator and is configured to receive a first comparison result signal output by the first hysteresis comparator, wherein the first comparison result signal is used to indicate whether the voltage on the sensing capacitor circuit reaches the voltage threshold of the reference voltage source. The first charge-discharge control circuit is further configured to generate a first switch control command based on the comparison result signal. The first switch unit is configured to control the sensing capacitor circuit to switch between a charging state and a discharging state in response to the first switch control command. When the first switch unit is turned on, the third capacitor is charged through the reference voltage source. When the first switch unit is turned off, the third capacitor discharges to the sensing capacitor circuit. The second charge / discharge control circuit is connected to the output of the second hysteresis comparator and is configured to receive a second comparison result signal output by the second hysteresis comparator, wherein the second comparison result signal is used to indicate whether the voltage on the reference capacitor circuit reaches the voltage threshold of the reference voltage source; The second charge / discharge control circuit is further configured to generate a second switch control command based on the second comparison result signal. The second switch unit is configured to control the reference capacitor circuit to switch between a charging state and a discharging state in response to the second switch control command. When the second switch unit is turned on, the fourth capacitor is charged through the reference voltage source. When the second switch unit is turned off, the fourth capacitor discharges to the inductive capacitor circuit.
7. The touch detection circuit according to claim 6, characterized in that, The synchronization circuit includes a timer configured to generate a counting enable signal with a preset time window width based on the preset clock signal, and to generate a charging and discharging synchronization control signal based on the preset clock signal. The first detection circuit and the second detection circuit are configured to perform a counting operation during the period when the counting enable signal is valid, and the sampling duration of the first detection circuit and the second detection circuit is determined based on the preset window width; The first charge / discharge control circuit and the second charge / discharge control circuit are configured to synchronously control the charging and discharging of the reference capacitor circuit and the inductive capacitor circuit based on the charge / discharge synchronization control signal.
8. The touch detection circuit according to claim 7, characterized in that, Also includes: A calibration circuit, connected to the first detection circuit and the second detection circuit, is configured to compare the first charge-discharge cycle count with the second charge-discharge cycle count in the non-touch state of the sensing capacitor circuit, and update the value of the configuration register based on the comparison result until the difference between the first charge-discharge cycle count and the second charge-discharge cycle count is less than a preset tolerance.
9. A touch detection method, characterized in that, The touch detection circuit according to any one of claims 1 to 7 comprises: Based on the preset clock signal, the first charging and discharging operation for the sensing capacitor circuit and the second charging and discharging operation for the reference capacitor circuit are executed synchronously. The number of the first charge-discharge cycles generated by the first charge-discharge operation and the number of the second charge-discharge cycles generated by the second charge-discharge operation are counted. The touch detection signal is determined based on the difference between the first charge-discharge cycle number and the second charge-discharge cycle number.
10. An electronic device, characterized in that, Includes the touch detection circuit as described in any one of claims 1 to 8.