Detection circuit and signal detection method
By introducing closed-loop feedback regulation of calibration and detection states into the detection circuit, the reference signal is automatically adjusted to calibrate the threshold voltage, solving the problem of inconsistent comparator threshold voltages and achieving high-precision and robust signal detection.
Patent Information
- Application Number
- CN202511449921.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-03-03
AI Technical Summary
In the existing technology, the differential threshold detection circuit suffers from inconsistent comparator threshold voltages due to factors such as process deviations, temperature changes and device aging, which affects the signal detection accuracy. Furthermore, existing calibration methods rely on external equipment or manual intervention, lacking automation and high precision.
Design a detection circuit that includes calibration and detection states. Through a closed-loop feedback adjustment circuit, the calibration module automatically adjusts the reference signal to calibrate the threshold voltage of the detection module, thereby achieving fully automatic and high-precision calibration.
It achieves high-precision signal detection under different processes and environments, eliminates the interference of internal component parameter deviations on detection accuracy, improves circuit robustness and detection accuracy, and requires no manual intervention.
Smart Images

Figure CN121595983A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic circuit technology, and in particular to a detection circuit and a signal detection method. Background Technology
[0002] In the field of high-speed differential signal detection (such as USB 2.0, high-speed serial transceivers, etc.), the detection circuit needs to distinguish whether the signal on the bus is noise or valid data, and the accuracy of the comparator's threshold voltage directly affects the validity of the signal and the accuracy of noise identification.
[0003] However, in existing technologies, differential threshold detection circuits typically use a fixed reference voltage to set the comparator threshold voltage. This design faces significant technical problems in practical applications: due to factors such as process variations, temperature changes, and device aging, inconsistencies in the comparator's offset voltage (Vos) and gain can cause a large deviation between the actual threshold voltage and the design target, thereby reducing detection accuracy. Furthermore, in existing technologies, the calibration of the comparator threshold voltage usually relies on external equipment or manual intervention for threshold adjustment.
[0004] Therefore, how to achieve fully automatic and high-precision calibration of the comparator threshold voltage has become an urgent technical problem to be solved. Summary of the Invention
[0005] This invention provides a detection circuit and signal detection method to overcome the deficiencies in the prior art and achieve fully automatic and high-precision calibration of the comparator threshold voltage.
[0006] This invention provides a detection circuit, including a calibration module and a detection module, wherein the detection module includes a differential input unit and a reference input unit; When the detection circuit is in calibration state, the output terminal of the detection module is connected to the input terminal of the calibration module, and the output terminal of the calibration module is connected to the reference input unit of the detection module. The calibration module is used to adjust the reference signal of the reference input unit of the detection module to the target reference signal according to the output signal of the detection module; When the detection circuit is in the detection state, the differential input unit is used to receive the signal to be detected; the detection module is used to detect the signal to be detected according to the target reference signal to obtain the detection result.
[0007] According to a detection circuit provided by the present invention, the calibration module includes a control unit and a reference signal generation unit; When the detection circuit is in calibration state, the input terminal of the control unit is connected to the output terminal of the detection module, the output terminal of the control unit is connected to the input terminal of the reference signal generation unit, and the output terminal of the reference signal generation unit is connected to both the differential input unit and the reference input unit. The control unit is used to generate a control signal based on the output signal of the detection module; The reference signal generation unit is used to adjust the reference signal of the reference input unit to the target reference signal according to the control signal; The detection module is used to generate a comparison signal based on the output signal of the reference signal generation unit.
[0008] According to a detection circuit provided by the present invention, the reference signal generation unit includes a signal generation unit and a multiplexer; When the detection circuit is in calibration state, the first output terminal of the signal generation unit is connected to the differential input unit, the first input terminal of the multiplexer is connected to the second output terminal of the signal generation unit, the second input terminal of the multiplexer is connected to the output terminal of the control unit, and the output terminal of the multiplexer is connected to the reference input unit. The signal generation unit is used to generate a reference signal to the differential input unit and to generate multiple adjustment signals with different voltage values to the multiplexer. The multiplexer is used to adjust the reference signal of the reference input unit to the target reference signal according to a plurality of adjustment signals under the action of the control signal.
[0009] According to a detection circuit provided by the present invention, the detection module includes a first amplifier and a second amplifier, wherein the input terminal of the first amplifier serves as the differential input unit and the input terminal of the second amplifier serves as the reference input unit. When the detection circuit is in calibration state, the reference signal includes a first reference signal and a second reference signal. The signal generation unit outputs the first reference signal and the second reference signal to the first amplifier, and outputs the first reference signal to an input terminal of the second amplifier. The multiplexer is specifically used to gradually adjust the reference signal at the other input of the second amplifier to the target reference signal, so as to calibrate the threshold voltage of the detection module to a preset value according to the target reference signal; The detection module is specifically used to compare the output of the first amplifier and the output of the second amplifier, and generate the comparison signal; wherein the voltage difference between the first reference signal and the second reference signal is equal to the preset value.
[0010] According to a detection circuit provided by the present invention, when the detection circuit is in a calibration state, one control terminal of the control unit receives a first voltage, another input terminal of the control unit is connected to the output terminal of the detection module, and the control terminal of the control unit receives a clock signal. The control unit is specifically configured to latch the comparison signal to generate the control signal under the action of the clock signal and the first voltage.
[0011] According to a detection circuit provided by the present invention, the control unit includes a selection unit and an output unit; When the detection circuit is in calibration state, the input terminal of the selection unit receives the first voltage, the control terminal of the selection unit receives the clock signal, and the output terminal of the selection unit is connected to the control terminal of the output unit; the input terminal of the output unit is connected to the output terminal of the detection module, and the output terminal of the output unit is connected to the input terminal of the reference signal generation unit. The selection unit is configured to generate a selection signal under the action of the clock signal and the first voltage to enable the output unit; The output unit is used to sample the output signal of the detection module to obtain the control signal when enabled by the selection signal.
[0012] According to a detection circuit provided by the present invention, the selection unit includes N first flip-flops, and the output unit includes N second flip-flops; wherein N is a positive integer; When the detection circuit is in calibration state, the input terminal of the first flip-flop receives the first voltage, the control terminals of the first flip-flop all receive the clock signal, and the output terminal of the first flip-flop is connected to the control terminal of the corresponding second flip-flop and the input terminal of the next adjacent first flip-flop; the input terminal of the second flip-flop is connected to the output terminal of the detection module, and the output terminal of the second flip-flop is connected to the input terminal of the multiplexer. The first flip-flop is used to generate a selection signal to enable the corresponding second flip-flop; The second trigger is used to generate sampling results based on the selection signal; wherein the sampling results are arranged in a preset order to form the control signal.
[0013] According to a detection circuit provided by the present invention, when the detection circuit is in a calibration state and the output signal of the detection module is high, the calibration module reduces the voltage of the reference signal output to an input terminal of the reference input unit; When the detection circuit is in calibration state and the output signal of the detection module is low, the calibration module increases the voltage of the reference signal output to one input terminal of the reference input unit; When the detection circuit is in the detection state, the threshold voltage of the detection module is a preset value, and the detection module is used to detect the signal to be detected according to the threshold voltage to obtain the detection result.
[0014] The present invention also provides a signal detection method applied to a detection circuit, the detection circuit including a calibration module and a detection module, the detection method comprising: When the detection circuit is in calibration state, the differential input unit of the detection module receives the reference signal output by the calibration module, and the reference input unit of the detection module receives the reference signal output by the calibration module. The calibration module adjusts the reference signal output to the reference input unit of the detection module to the target reference signal according to the output signal of the detection module; The detection module generates a comparison signal based on the reference signal and the benchmark signal; When the detection circuit is in the detection state, the differential input unit receives the signal to be detected; the detection module detects the signal to be detected according to the target reference signal to obtain the detection result.
[0015] According to a signal detection method provided by the present invention, the calibration module includes a control unit and a reference signal generation unit. When the detection circuit is in a calibration state, the calibration module adjusts the reference signal output to the reference input unit of the detection module to a target reference signal based on the output signal of the detection module, including: The control unit generates a control signal based on the comparison signal; The reference signal generation unit adjusts the reference signal of the reference input unit to the target reference signal according to the control signal.
[0016] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: This invention achieves pre-calibration of the circuit before performing actual testing by designing the detection circuit to include both calibration and detection states. In calibration state, the output of the detection module is connected to the input of the calibration module, and the output of the calibration module is connected to the reference input unit of the detection module, creating a closed-loop feedback adjustment circuit. This allows the circuit to automatically adjust its internal reference signal based on its comparison results. The calibration module continuously adjusts the reference signal based on the output signal of the detection module until it becomes a target reference signal capable of offsetting inherent errors within the circuit, thus mitigating the effects of non-ideal factors such as amplifier offset voltage and gain mismatch. Finally, in detection state, the target reference signal is used to detect the signal to be tested, ensuring that the final detection threshold (i.e., threshold voltage) is accurately stabilized at a preset value. This fundamentally eliminates the interference of internal component parameter deviations on detection accuracy, significantly improving the circuit's detection accuracy and robustness to process, voltage, and temperature variations. Furthermore, the entire calibration process is completed automatically without manual intervention. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is one of the structural schematic diagrams of a detection circuit provided by the present invention.
[0019] Figure 2 This is the second schematic diagram of a detection circuit provided by the present invention.
[0020] Figure 3 This is the third schematic diagram of a detection circuit provided by the present invention.
[0021] Figure 4 This is a schematic diagram of the structure of a control unit provided by the present invention.
[0022] Figure 5 This is the fourth schematic diagram of a detection circuit provided by the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0024] It should be noted that in the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0025] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "electrical connection," "electrical connection," or "communication electrical connection" should be interpreted broadly. For example, "electrical connection," "electrical connection," or "communication electrical connection" can refer not only to a physical electrical connection, but also to an electrical connection or a signal electrical connection. For instance, it can be a direct electrical connection, i.e., a physical electrical connection, or an indirect electrical connection through at least one intermediate component, as long as the circuit is connected. It can also refer to the internal connection between two components. A signal electrical connection can refer not only to a signal electrical connection through a circuit, but also to a signal electrical connection through a medium, such as radio waves. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0026] The following is combined Figures 1 to 5 This invention describes the detection circuit and signal detection method provided by the present invention.
[0027] This invention provides a detection circuit. The detection circuit includes a calibration module and a detection module, the detection module including a differential input unit and a reference input unit; When the detection circuit is in calibration mode, the output terminal of the detection module is connected to the input terminal of the calibration module, and the output terminal of the calibration module is connected to the reference input unit of the detection module. The calibration module is used to adjust the reference signal of the reference input unit of the detection module to the target reference signal based on the output signal of the detection module; When the detection circuit is in the detection state, the differential input unit is used to receive the signal to be detected; the detection module is used to detect the signal to be detected according to the target reference signal to obtain the detection result.
[0028] To address the problems of low detection accuracy and poor stability in existing differential detection circuits due to inherent amplifier offset voltage and gain mismatch, as well as variations in process technology, voltage, and temperature (PVT), this invention provides a detection circuit. This circuit introduces a circuit structure that includes both calibration and detection states. Calibration first achieves automatic compensation for internal non-ideal factors and errors caused by process and voltage deviations. Then, the detection state enables the detection of external signals, such as determining whether a signal on the bus is noise or valid data.
[0029] Reference Figure 1 , Figure 1 This is one of the structural schematic diagrams of a detection circuit provided by the present invention. The detection circuit of this embodiment mainly includes a detection module and a calibration module. The detection module is the part that performs the core comparison function, and it internally includes a differential input unit and a reference input unit.
[0030] In the specific circuit implementation, the differential input unit can correspond to the two input terminals of the first amplifier A1. In the detection state, this differential input unit receives the differential signal to be detected; in the calibration state, it receives the signal to be detected, which is the signal output from the calibration module to the detection module. The reference input unit can correspond to the two input terminals of the second amplifier A2, and is used to receive a set of reference signals that provide a reference for comparing the voltage difference of the signals received in the differential input unit. The calibration module is the core component introduced to achieve high-precision differential threshold detection. It is used to generate and precisely adjust the signal output to the reference input unit. The calibration module adjusts the reference signal applied to the reference input unit of the detection module according to the output signal of the detection module, thereby adjusting the reference signal of the reference input unit of the detection module to the target reference signal, and calibrating the threshold voltage of the detection module to a preset value.
[0031] The detection circuit has two switchable operating states: calibration state and detection state. It can be switched by control signals or switches. This embodiment does not limit this, as long as the switching between the calibration state and the detection state of the circuit can be realized.
[0032] When the circuit is in calibration mode, such as during power-on initialization, the detection module and calibration module form a closed feedback loop for self-calibration. Specifically, the output terminal Vout of the detection module is connected to the input terminal of the calibration module, allowing the calibration module to acquire the comparison result of the detection module. Simultaneously, the output terminal of the calibration module is connected to the reference input unit and differential input unit of the detection module; while in detection mode, the output terminal of the calibration module is connected to the reference input unit of the detection module. When the circuit is in calibration mode, the calibration module continuously and incrementally adjusts the reference signal output to the reference input unit of the detection module based on the output signal Vout of the detection module. This adjustment process continues until the reference signal of the reference input unit is adjusted to the target reference signal, and the threshold voltage of the detection module is calibrated to a preset value. This process effectively compensates for errors introduced by the offset voltage and gain differences of amplifiers A1 and A2.
[0033] Once the calibration process is complete, the circuit switches to detection mode to perform its primary signal detection function, determining whether the received signal is valid or noise.
[0034] Reference Figure 2 , Figure 2 This is a second schematic diagram of a detection circuit provided by the present invention. In the detection state, the internal connections of the circuit change, and the aforementioned feedback loop is disconnected. At this time, the differential input unit of the detection module, i.e., the input terminal of the first amplifier A1, is connected to an external source of the signal to be detected, such as the differential signal pair Vip and Vin on a high-speed serial bus. The output of the calibration module is locked and no longer adjusted; instead, it continuously outputs the target reference signal determined during the calibration phase to the reference input unit of the detection module. Therefore, the detection module accurately compares the voltage difference between the signals to be detected, Vip and Vin, based on this target reference signal and outputs the detection result. This detection result can characterize whether the signal to be detected is a noise signal or a valid signal.
[0035] By establishing two operating states—calibration and detection—the circuit, in calibration mode, quantifies its inherent non-ideal characteristics (such as offset voltage) that could cause errors through a feedback self-adjustment process. This gradually adjusts the reference signal output by the calibration module to the target reference signal, thereby achieving precise compensation for the detection circuit and calibrating its comparison threshold to a preset value. In detection mode, the detection circuit accurately detects the differential signal to be detected based on the target reference signal. Thus, regardless of the offset voltage and gain of the amplifiers in the detection module, or whether the gains of multiple amplifiers are consistent, the final threshold voltage of the detection circuit can be effectively calibrated to the preset value Vth. This structure fundamentally compensates for the impact of internal component parameter deviations on detection accuracy, enabling the circuit to maintain high detection accuracy and stability under different process and operating environments.
[0036] In one possible implementation, the calibration module includes a control unit and a reference signal generation unit; When the detection circuit is in calibration mode, the input terminal of the control unit is connected to the output terminal of the detection module, the output terminal of the control unit is connected to the input terminal of the reference signal generation unit, and the output terminal of the reference signal generation unit is connected to both the differential input unit and the reference input unit. The control unit is used to generate control signals based on the output signals of the detection module. A reference signal generation unit is used to adjust the reference signal of the reference input unit to the target reference signal according to the control signal; The detection module is used to generate a comparison signal based on the output signal of the reference signal generation unit.
[0037] To achieve the aforementioned self-calibration function, refer to Figure 3 , Figure 3 This is the third schematic diagram of a detection circuit provided by the present invention. When the detection circuit enters the calibration state, the output signal Vout of the detection module is connected to the input of the control unit, and its level represents the comparison result of the current detection module. After receiving the comparison signal, the control unit performs logical operations on the comparison signal to generate a digital control signal, and outputs the control signal to the input of the reference signal generation unit. The reference signal generation unit adjusts its output voltage according to the received control signal. This adjusted voltage serves as a reference signal, which is sent to the reference input unit of the detection module (e.g., one input of the second amplifier A2); on the other hand, in the calibration state, the reference signal generation unit also provides a reference voltage to the differential input unit (e.g., the input of the first amplifier A1) to provide differential input for the calibration process. After receiving these signals provided by the reference signal generation unit, the detection module performs a new round of comparison and generates a new comparison signal Vout. This comparison signal is output to the control unit again, thus completing one closed-loop iteration.
[0038] The control unit is the core of the calibration logic, used to calibrate the threshold voltage of the detection circuit to a preset value Vth based on the signal output by the detection module. For example, when the detection module outputs a high level, it indicates that the actual threshold voltage Vth2 of the detection circuit is less than Vth, and the control unit generates a control signal to lower the reference signal based on the output of the detection module; when the output is low, it indicates that the actual threshold voltage Vth2 of the detection circuit is greater than Vth, and the control unit generates a control signal to raise the reference signal based on the output of the detection module. The reference signal generation unit performs the calibration action, and it can be composed of a multiplexer (MUX) and a corresponding voltage source. It receives digital control signals from the control unit and selects or generates an analog voltage value as the output accordingly. The entire calibration process involves the coordinated work of the control unit and the reference signal generation unit, iteratively converging the reference signal to the target reference signal.
[0039] To specifically implement the function of the reference signal generation unit, this invention provides an implementation scheme based on a multiplexer. In one possible implementation, the reference signal generation unit includes a signal generation unit and a multiplexer; When the detection circuit is in calibration state, the first output terminal of the signal generation unit is connected to the differential input unit, the first input terminal of the multiplexer is connected to the second output terminal of the signal generation unit, the second input terminal of the multiplexer is connected to the output terminal of the control unit, and the output terminal of the multiplexer is connected to the reference input unit. The signal generation unit is used to generate a reference signal to the differential input unit and to generate multiple adjustment signals with different voltage values to the multiplexer. A multiplexer is used to adjust the reference signal of a reference input unit to a target reference signal according to multiple adjustment signals under the action of a control signal. The second output terminal of the signal generation unit includes multiple signal output terminals, and the first input terminal of the multiplexer includes multiple signal input terminals corresponding to the signal output terminals of the signal generation unit, so as to adjust the reference signal output by the reference input unit to the target reference signal according to the multiple adjustment signals under the action of the control signal.
[0040] Specifically, the signal generation unit provides the reference signal required for calibration. This unit generates two sets of output signals. The first set of output signals is a pair of reference signals used to connect to the differential input unit of the detection module in calibration mode. For example, ... Figure 3 As shown, reference signals Vref2+Vth and Vref2 are connected to the inverting and non-inverting inputs of the first amplifier A1, respectively, thereby applying a differential voltage equal to the preset value Vth to the differential input unit. The second set of outputs consists of multiple adjustment signals with different voltage values, connected to multiple signal inputs of the multiplexer, forming a selectable voltage pool.
[0041] The multiplexer, acting as the voltage selection actuator, connects its signal input to multiple adjustment signals output by the signal generation unit. Its control input is connected to the output of the control unit to receive control signals. The multiplexer's output is connected to the reference input unit of the detection module to provide the adjusted reference signal Vref1. In calibration mode, the signal generation unit provides a differential voltage of magnitude Vth to the differential input unit, while simultaneously providing multiple adjustment voltages with different values to the multiplexer. The control unit generates and updates the control signal based on feedback from the detection module. Responding to the control signal, the multiplexer selects a suitable adjustment signal from the received adjustment signals as the current reference signal output. In this way, the control unit drives the multiplexer to perform step adjustments on the output reference signal to find a target reference signal that can balance the effects of internal circuit offsets.
[0042] To effectively perform calibration and testing functions, the testing module of this invention can employ a differential structure with dual amplifiers. In one possible implementation, the testing module includes a first amplifier and a second amplifier, with the input terminal of the first amplifier serving as a differential input unit and the input terminal of the second amplifier serving as a reference input unit. When the detection circuit is in calibration state, the reference signal includes a first reference signal and a second reference signal. The signal generation unit outputs the first reference signal and the second reference signal to the first amplifier, and outputs the first reference signal to an input terminal of the second amplifier. The multiplexer is specifically used to progressively adjust the reference signal at the other input of the second amplifier to the target reference signal, so as to calibrate the threshold voltage of the detection module to a preset value according to the target reference signal; The detection module is specifically used to compare the outputs of the first amplifier and the second amplifier, and generate a comparison signal; wherein the voltage difference between the first reference signal and the second reference signal is equal to a preset value.
[0043] like Figure 3 As shown, the detection module includes a first amplifier A1 and a second amplifier A2, which are preferably differential amplifiers. The input terminals of the first amplifier A1 form a differential input unit, and the input terminals of the second amplifier A2 form a reference input unit. When the circuit is in calibration mode, a first reference signal and a second reference signal generated by the signal generation unit are applied to the non-inverting input terminal and the inverting input terminal of the first amplifier A1, respectively. The voltage difference between the first reference signal and the second reference signal is equal to a preset value Vth. Simultaneously, the second reference signal Vref2 is also connected to one input terminal of the second amplifier A2, and the other input terminal of the second amplifier A2 is connected to the output terminal of a multiplexer to receive the gradually adjusted reference signal Vref1.
[0044] The detection module compares the output of the first amplifier A1 with the output of the second amplifier A2 and generates a comparison signal Vout. During calibration, the circuit continuously fine-tunes the reference signal Vref1 applied to the input of the second amplifier A2 via a multiplexer, and generates corresponding control signals to adjust the reference signal Vref1 based on changes in the comparison signal Vout. This calibration process continues until the reference signal Vref1 is adjusted to the target reference signal, gradually calibrating the threshold voltage of the detection circuit to the preset value Vth. At this point, the determined Vref1 value is used as the target reference signal containing offset compensation information. After the circuit calibration is complete, the circuit switches to the detection state. Now, using the target reference signal as a reference, the threshold voltage can be accurately stabilized at the preset value Vth, thus helping to eliminate the interference of the amplifier's own non-ideal characteristics on the detection accuracy.
[0045] In one possible implementation, when the detection circuit is in calibration state, one control terminal of the control unit receives a first voltage, another input terminal of the control unit is connected to the output terminal of the detection module, and the control terminal of the control unit receives a clock signal. The control unit is specifically used to latch the comparison signal to generate a control signal under the action of a clock signal and a first voltage.
[0046] Specifically, such as Figure 3 As shown, when the circuit is in calibration mode, one input terminal of the control unit is connected to the output terminal of the detection module to receive the comparison signal Vout.
[0047] To synchronize the calibration process, one control terminal of the control unit receives a clock signal CLK. Additionally, another control terminal of the control unit receives a first voltage, such as the power supply voltage VDD, thereby presetting the internal components of the control unit when the circuit begins calibration, and sampling the first voltage according to the clock signal to generate a control signal.
[0048] Driven by a clock signal, the control unit latches the input comparison signal and generates a control signal based on the latch result. This synchronous latching mechanism ensures that even if the comparison signal Vout fluctuates momentarily between two clock samples, the generated control signal remains stable, thus providing a stable time for signal establishment in other circuit sections. Through synchronous latching operations, the control unit gradually constructs a multi-bit digital control signal to improve the stability and reliability of the calibration process.
[0049] In one possible implementation, the control unit includes a selection unit and an output unit; When the detection circuit is in calibration state, the input terminal of the selection unit receives the first voltage, the control terminal of the selection unit receives the clock signal, and the output terminal of the selection unit is connected to the control terminal of the output unit. The input terminal of the output unit is connected to the output terminal of the detection module, and the output terminal of the output unit is connected to the input terminal of the reference signal generation unit. The selection unit is used to generate a selection signal under the action of a clock signal and a first voltage to enable the output unit; The output unit is used to sample the output signal of the detection module to obtain the control signal when the selected signal is enabled.
[0050] Specifically, refer to Figure 4 , Figure 4 This is a schematic diagram of a control unit provided by the present invention. When the circuit is in calibration state, the input terminal of the selection unit receives a first voltage VDD, the control terminal of the selection unit receives a clock signal CLK, and the output terminal of the selection unit is connected to the control terminal of the output unit. The input terminal of the output unit is connected to the output terminal Vout of the detection module, and the output terminal of the output unit is connected to the input terminal of the reference signal generation unit.
[0051] Driven by a clock signal, the selection unit generates a timing selection signal. Within each clock cycle, this timing selection signal sequentially activates different parts of the output unit in a predetermined order. Upon receiving the selection signal from the selection unit, the enabled portion of the output unit samples the current comparison signal Vout and latches the sampled result. Therefore, throughout the entire calibration cycle, the selection unit sequentially enables each bit of the output unit, thus completing the sequential sampling of a series of comparison results. These bit-latched sampled results are combined to form the final multi-bit digital control signal output.
[0052] In one possible implementation, the selection unit includes N first flip-flops, and the output unit includes N second flip-flops, where N is a positive integer; When the detection circuit is in calibration mode, the input terminal of the first flip-flop receives the first voltage, and the control terminal receives the clock signal. The output of the first flip-flop is connected to the control terminal of the corresponding second flip-flop and the input terminal of the next adjacent first flip-flop. The input of the second trigger is connected to the output of the detection module, and the output of the second trigger is connected to the input of the multiplexer. The first flip-flop is used to generate a selection signal to enable the corresponding second flip-flop; The second trigger is used to generate sampling results based on the selection signal, and to assemble the sampling results into control signals in a preset order.
[0053] Specifically, such as Figure 4As shown, this embodiment uses six first flip-flops (e.g., DFF6 to DFF11) and six second flip-flops (e.g., DFF0 to DFF5) as examples. The selection unit is composed of six first flip-flops (e.g., DFF6 to DFF11) connected in series, while the output unit is composed of six second flip-flops (e.g., DFF0 to DFF5).
[0054] When the circuit is in calibration mode, the input of the first flip-flop DFF11 in the first flip-flop array is connected to the first voltage VDD. The input of each first flip-flop is connected to the output of the previous first flip-flop to form a cascaded structure. The clock input of all first flip-flops is connected to the clock signal CLK. The output of each first flip-flop is also connected to the control input of its corresponding second flip-flop. The inputs of all second flip-flops are connected to the comparator signal Vout. The outputs of all second flip-flops in the second flip-flop array together form an N-bit bus; in the example above, the outputs D0 to D5 of the six second flip-flops together form a 6-bit bus. The outputs of all second flip-flops are connected to a multiplexer.
[0055] In this circuit connection configuration, the first flip-flop array generates a single-bit high-level scan pulse as a selection signal. This scan pulse is shifted within the first flip-flop array under the drive of a clock signal. The second flip-flop array then samples the comparison signal output by the detection module based on this selection signal. For any second flip-flop, when enabled by the selection signal output by its corresponding first flip-flop, the second flip-flop samples the comparison signal Vout at its input and latches the value of the comparison signal at its output. Within N clock cycles, N second flip-flops are sequentially enabled, latching their corresponding comparison signals and generating sampling results, which are then combined in a preset order to form an N-bit digital control signal provided to the multiplexer.
[0056] In one possible implementation, when the detection circuit is in calibration state and the output signal of the detection module is high, the calibration module reduces the voltage of the reference signal output to one input terminal of the reference input unit; When the detection circuit is in calibration state and the output signal of the detection module is low, the calibration module increases the voltage of the reference signal output to one input terminal of the reference input unit; When the detection circuit is in the detection state, the threshold voltage of the detection module is a preset value. The detection module is used to detect the signal to be detected according to the threshold voltage to obtain the detection result.
[0057] Specifically, when the detection circuit is in calibration mode, a reference signal with a voltage difference of Vth is applied to the differential input unit of the detection module. Under this condition, if the output signal of the detection module is high, it indicates that the actual threshold voltage Vth2 of the detection circuit is less than Vth. To correct the deviation, the calibration module performs an operation that increases the actual threshold voltage of the circuit, i.e., reduces the voltage of the reference signal output to the reference input unit (i.e., one input terminal of the second amplifier A2). Therefore, when the control unit detects that the output signal is high, it generates a corresponding control code (e.g., logic '1') to drive the multiplexer to select the adjustment signal with a lower voltage value as the new reference signal.
[0058] Conversely, when the detection circuit is in calibration mode and the output signal of the detection module is low, it indicates that the actual threshold voltage Vth2 of the detection circuit is greater than Vth. To correct this deviation, the calibration module performs an operation that reduces the actual threshold voltage of the circuit, i.e., increases the voltage of a reference signal output to the reference input unit (this reference signal can be either Vref1 or Vref2). Therefore, when the control unit detects that the output signal is low, it will generate a corresponding control code (e.g., logic '0') to drive the multiplexer to select the adjustment signal with the higher voltage value as the new reference signal.
[0059] The entire iterative process is driven by the clock signal CLK. The iterative process proceeds bit by bit from the most significant bit to the least significant bit, so that the reference signal gets closer to the target reference signal in each iteration.
[0060] Once all N iterations are completed, the calibration process ends, and the circuit switches to the detection state. (Refer to...) Figure 5 , Figure 5 This is the fourth schematic diagram of a detection circuit provided by the present invention. In the detection state, the multiplexer continuously outputs a target reference signal, disconnecting the connection between the signal generation unit and the differential input unit. The differential input unit of the detection module is connected to an external signal to be detected. Since the target reference signal has compensated for internal non-ideal factors, the flip-th threshold voltage of the detection module is precisely calibrated to a preset value Vth. Therefore, in the detection state, the detection module can quickly perform a high-precision comparison of the input signal to be detected based on the threshold voltage and output the final detection result, thereby solving the problem of poor detection accuracy and stability in the prior art and effectively improving the performance and reliability of the detection circuit.
[0061] The specific working principle of the calibration status detection circuit is as follows: When the first amplifier A1 and the second amplifier A2 have no offset voltage and their gains are equal, i.e., A1 = A2: (1) If Vout=0, Vref2-Vref1=Vth, then: (2) (3) The threshold voltage of the detection circuit is Vth, meaning that the circuit flips when Vip - Vin = Vth. However, since both the first amplifier A1 and the second amplifier A2 have offset voltages and inherent errors, and A1 is not exactly equal to A2, Vout may flip to a low level or a high level relative to its initial value. Ideally, the threshold voltage of the detection circuit is: (4) Therefore, the threshold voltage of the detection circuit will vary around Vth. So this application adds a control unit and a reference signal generation unit to adjust the voltage of the reference signal (Vref1 can be adjusted or Vref2 can be selected to adjust) to achieve the calibration of the threshold voltage.
[0062] Before the detection circuit begins detection, it first enters calibration mode. The circuit connection method is as follows: Figure 3 As shown, the reference signals Vref2+Vth and Vref2 are connected to A1, with Vref2+Vth connected to the positive terminal of A1 and Vref2 connected to the negative terminal of A1. At this time, the voltage difference across the differential input unit is Vth. In calibration mode, this embodiment adjusts the reference signal Vref1 based on the voltage change of Vout. If the output Vout of the detection module is high during the first comparison (i.e., Vout becomes high relative to the initial state level), it indicates that the actual threshold voltage Vth2 of the detection circuit is less than Vth. At this time, Vout=1, and the clock signal CLK latches the first voltage VDD into DFF11, making the selection signal output by DFF11 high. This rising edge will store the first comparison result Vout into DFF5, making D5=1, causing the multiplexer to select a smaller voltage Vref1, thus increasing Vth2. Similarly, when Vout is low, it indicates that the actual threshold voltage Vth2 of the detection circuit is greater than Vth. At this time, Vout is pulled low. When the first rising edge of CLK arrives, DFF11 samples and latches the level state of VDD and outputs the selection signal to DFF5. The output of DFF11 latches Vout=0 into DFF5, making D5=0, causing the multiplexer to select a larger voltage Vref1 as the reference signal, thus decreasing Vth2. The calibration process continues until the reference signal Vref1 is adjusted to the target reference signal, or the target reference signal is locked after all the triggers have been compared, thereby calibrating the threshold voltage of the detection circuit to the preset value Vth, or calibrating the threshold voltage to the point where the difference between the threshold voltage and the preset value Vth is less than or equal to the preset threshold.
[0063] In practical circuits, although Vos2 and Vos1 are random, they are usually on the order of mV. Therefore, in practical applications, the search range of Vref1 can be set as follows: (5) The voltage search range at this time is 2Vs, when the multiplexer is 2 6 When using a bit selector, the voltage difference between each adjacent bit is 2Vs / 2. 6 That is, when the control signal is 2'b111111, the minimum voltage is selected; when it is 2'b000000, the maximum voltage is selected. The maximum error of the final threshold voltage is... .
[0064] At this point, disconnect the first amplifier A1 from the signal generation unit and connect the signal to be detected. If Vout=0, then: (6) So: (7) Even if both A1 and A2 are offset and the gains of the two amplifiers are different, after calibration, when the detection circuit is working normally, the threshold voltage of the detection circuit is still the accurate Vth (that is, after calibration, substituting formula (7) into formula (6) will give Vip-Vin=Vth). That is, when the voltage difference of the signal to be detected is greater than or equal to Vth, the output Vout of the detection module will immediately flip, thereby quickly and accurately characterizing whether the signal to be detected is a valid signal or a noise signal, and eliminating the interference of offset voltage and different gains on the threshold voltage, thus improving the detection accuracy of the detection circuit.
[0065] The present invention also provides a signal detection method applied to a detection circuit, the detection circuit including a calibration module and a detection module, the detection method including the following steps: When the detection circuit is in calibration mode, the differential input unit of the detection module receives the reference signal output by the calibration module, and the reference input unit of the detection module receives the reference signal output by the calibration module. The calibration module adjusts the reference signal output to the reference input unit of the detection module to the target reference signal based on the output signal of the detection module; The detection module generates a comparison signal based on the reference signal and the baseline signal; When the detection circuit is in the detection state, the differential input unit receives the signal to be detected; the detection module detects the signal to be detected based on the target reference signal to obtain the detection result.
[0066] Specifically, first, the detection circuit is placed in calibration mode. In this mode, the circuit performs a self-calibration process. Specifically, the differential input unit of the detection module receives a reference signal output by the calibration module. This reference signal is preferably a differential signal with a preset voltage difference, which corresponds to the final desired threshold voltage. Simultaneously, the reference input unit of the detection module receives an adjustable reference signal output by the calibration module.
[0067] The detection module performs an internal comparison based on the received reference signal and baseline signal, generating a comparison signal. This comparison signal is output to the calibration module. Upon receiving this comparison signal, the calibration module adjusts the baseline signal output to the reference input unit of the detection module according to the signal's level change. For example, when the comparison signal indicates that the current actual threshold voltage is lower than the preset value Vth, the calibration module decreases the baseline signal voltage; conversely, it increases the baseline signal voltage. This process is repeated cyclically, gradually adjusting the baseline signal until it continuously approaches and eventually stabilizes at the target baseline signal, thereby compensating for circuit errors.
[0068] Once the calibration process is complete, the detection circuit is switched to detection mode. In this mode, the calibration module stops adjusting and continuously outputs the target reference signal. The differential input unit of the detection module is disconnected from the calibration module and instead receives the external signal to be detected. The detection module then detects the signal to be detected based on the target reference signal, ultimately obtaining a high-precision detection result.
[0069] Using the above method, before formally detecting external signals, the circuit first uses a closed-loop feedback calibration process to adjust the reference signal to a target reference signal capable of offsetting inherent errors within the circuit, thereby calibrating the threshold voltage of the detection circuit to a preset value Vth. In the detection state, the target reference signal is used to detect the signal to be detected. This method decouples the accuracy of the detection threshold from the non-ideal characteristics of the internal components of the circuit, thus effectively ensuring the accuracy and reliability of the detection results.
[0070] In one possible implementation, the aforementioned calibration method is further defined. The calibration module includes a control unit and a reference signal generation unit. When the detection circuit is in calibration mode, the calibration module adjusts the reference signal output to the reference input unit of the detection module to the target reference signal based on the output signal of the detection module, including: The control unit generates a control signal based on the comparison signal; The reference signal generation unit adjusts the reference signal of the reference input unit to the target reference signal according to the control signal.
[0071] Specifically, this adjustment process is completed collaboratively by the control unit and the reference signal generation unit within the calibration module. First, the control unit receives a comparison signal from the detection module, which reflects the comparison result between the reference signal and the reference signal under the current reference signal setting, thereby characterizing the magnitude of the actual threshold voltage of the current detection circuit.
[0072] The control unit generates a corresponding control signal based on the received comparison signal and its internally preset calibration logic. This control signal is usually in digital code form and contains instructions on how to adjust the reference signal next. Based on the control signal, the multiplexer selects the corresponding adjustment signal. That is, after receiving the control signal, the reference signal generation unit will perform a specific voltage adjustment operation, causing the voltage of its output reference signal to change accordingly.
[0073] The control unit generates a control signal, and the reference signal generation unit adjusts the voltage of the reference signal according to the control signal, thus completing an iterative adjustment of the reference signal. This process is repeated in calibration mode, and each iteration makes the reference signal closer to the final target reference signal, thereby achieving precise and gradual adjustment of the reference signal.
[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A detection circuit, characterized in that, It includes a calibration module and a detection module, wherein the detection module includes a differential input unit and a reference input unit; When the detection circuit is in calibration state, the output terminal of the detection module is connected to the input terminal of the calibration module, and the output terminal of the calibration module is connected to the reference input unit of the detection module. The calibration module is used to adjust the reference signal of the reference input unit of the detection module to the target reference signal according to the output signal of the detection module; When the detection circuit is in the detection state, the differential input unit is used to receive the signal to be detected; The detection module is used to detect the signal to be detected based on the target reference signal to obtain the detection result.
2. The detection circuit according to claim 1, characterized in that, The calibration module includes a control unit and a reference signal generation unit; When the detection circuit is in calibration state, the input terminal of the control unit is connected to the output terminal of the detection module, the output terminal of the control unit is connected to the input terminal of the reference signal generation unit, and the output terminal of the reference signal generation unit is connected to both the differential input unit and the reference input unit. The control unit is used to generate a control signal based on the output signal of the detection module; The reference signal generation unit is used to adjust the reference signal of the reference input unit to the target reference signal according to the control signal; The detection module is used to generate a comparison signal based on the output signal of the reference signal generation unit.
3. The detection circuit according to claim 2, characterized in that, The reference signal generation unit includes a signal generation unit and a multiplexer; When the detection circuit is in calibration state, the first output terminal of the signal generation unit is connected to the differential input unit, the first input terminal of the multiplexer is connected to the second output terminal of the signal generation unit, the second input terminal of the multiplexer is connected to the output terminal of the control unit, and the output terminal of the multiplexer is connected to the reference input unit. The signal generation unit is used to generate a reference signal to the differential input unit and to generate multiple adjustment signals with different voltage values to the multiplexer. The multiplexer is used to adjust the reference signal of the reference input unit to the target reference signal according to a plurality of adjustment signals under the action of the control signal.
4. The detection circuit according to claim 3, characterized in that, The detection module includes a first amplifier and a second amplifier, wherein the input terminal of the first amplifier serves as the differential input unit and the input terminal of the second amplifier serves as the reference input unit. When the detection circuit is in calibration state, the reference signal includes a first reference signal and a second reference signal. The signal generation unit outputs the first reference signal and the second reference signal to the first amplifier, and outputs the first reference signal to an input terminal of the second amplifier. The multiplexer is specifically used to gradually adjust the reference signal at the other input of the second amplifier to the target reference signal, so as to calibrate the threshold voltage of the detection module to a preset value according to the target reference signal; The detection module is specifically used to compare the output of the first amplifier and the output of the second amplifier, and generate the comparison signal; wherein the voltage difference between the first reference signal and the second reference signal is equal to the preset value.
5. The detection circuit according to claim 2, characterized in that, When the detection circuit is in calibration state, one control terminal of the control unit receives a first voltage, the other input terminal of the control unit is connected to the output terminal of the detection module, and the control terminal of the control unit receives a clock signal. The control unit is specifically configured to latch the comparison signal to generate the control signal under the action of the clock signal and the first voltage.
6. The detection circuit according to claim 5, characterized in that, The control unit includes a selection unit and an output unit; When the detection circuit is in calibration state, the input terminal of the selection unit receives the first voltage, the control terminal of the selection unit receives the clock signal, and the output terminal of the selection unit is connected to the control terminal of the output unit; the input terminal of the output unit is connected to the output terminal of the detection module, and the output terminal of the output unit is connected to the input terminal of the reference signal generation unit. The selection unit is configured to generate a selection signal under the action of the clock signal and the first voltage to enable the output unit; The output unit is used to sample the output signal of the detection module to obtain the control signal when enabled by the selection signal.
7. The detection circuit according to claim 6, characterized in that, The selection unit includes N first flip-flops, and the output unit includes N second flip-flops; where N is a positive integer; When the detection circuit is in calibration state, the input terminal of the first flip-flop receives the first voltage, the control terminals of the first flip-flop all receive the clock signal, and the output terminal of the first flip-flop is connected to the control terminal of the corresponding second flip-flop and the input terminal of the next adjacent first flip-flop; the input terminal of the second flip-flop is connected to the output terminal of the detection module, and the output terminal of the second flip-flop is connected to the input terminal of the multiplexer. The first flip-flop is used to generate a selection signal to enable the corresponding second flip-flop; The second trigger is used to generate sampling results based on the selection signal; wherein the sampling results are arranged in a preset order to form the control signal.
8. The detection circuit according to claim 1, characterized in that, When the detection circuit is in calibration state and the output signal of the detection module is high, the calibration module reduces the voltage of the reference signal output to one input terminal of the reference input unit; When the detection circuit is in calibration state and the output signal of the detection module is low, the calibration module increases the voltage of the reference signal output to one input terminal of the reference input unit; When the detection circuit is in the detection state, the threshold voltage of the detection module is a preset value, and the detection module is used to detect the signal to be detected according to the threshold voltage to obtain the detection result.
9. A signal detection method, characterized in that, The detection circuit is applied to a detection circuit, which includes a calibration module and a detection module, and the detection method includes: When the detection circuit is in calibration state, the differential input unit of the detection module receives the reference signal output by the calibration module, and the reference input unit of the detection module receives the reference signal output by the calibration module. The calibration module adjusts the reference signal output to the reference input unit of the detection module to the target reference signal according to the output signal of the detection module; The detection module generates a comparison signal based on the reference signal and the benchmark signal; When the detection circuit is in the detection state, the differential input unit receives the signal to be detected; the detection module detects the signal to be detected according to the target reference signal to obtain the detection result.
10. The signal detection method according to claim 9, characterized in that, The calibration module includes a control unit and a reference signal generation unit. When the detection circuit is in calibration mode, the calibration module adjusts the reference signal output to the reference input unit of the detection module to the target reference signal according to the output signal of the detection module, including: The control unit generates a control signal based on the comparison signal; The reference signal generation unit adjusts the reference signal of the reference input unit to the target reference signal according to the control signal.