Square wave generating circuit

By cascading the initial waveform circuit and the hysteresis comparator circuit, the problem of clutter signals on the output side of the square wave generating circuit is solved, the target square wave signal output without clutter is achieved, and the signal quality is improved.

CN120825151APending Publication Date: 2025-10-21CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410438005.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-11
Publication Date
2025-10-21

AI Technical Summary

Technical Problem

The existing square wave generating circuit has a clutter signal on the output side, which affects the signal quality.

Method used

A cascade structure of an initial waveform circuit and a hysteresis comparator circuit is adopted. The initial waveform circuit generates an initial square wave signal and charges and discharges the energy storage unit according to the level state. The hysteresis comparator circuit compares the intermediate waveform signal with the preset threshold voltage to increase the circuit noise tolerance and finally outputs a target square wave signal without noise.

Benefits of technology

The signal quality of the square wave signal is improved, ensuring that the output side provides the target square wave signal without noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120825151A_ABST
    Figure CN120825151A_ABST
Patent Text Reader

Abstract

The invention discloses a square wave generating circuit which comprises an initial waveform circuit and a hysteresis comparator circuit, the initial waveform circuit is connected with the hysteresis comparator circuit, the initial waveform circuit is used for generating an initial square wave signal, and the hysteresis comparator circuit is used for generating a hysteresis comparator; an energy storage unit in the initial waveform circuit is charged or discharged according to the level state of the initial square wave signal, so that a first end of the energy storage unit generates an intermediate waveform signal; and the hysteresis comparator circuit is used for receiving the intermediate waveform signal, comparing the intermediate waveform signal with a preset threshold voltage, and generating a target square wave signal according to a comparison result. Therefore, the square wave generating circuit can improve the condition that the output waveform has clutters, and improves the signal quality of the target square wave signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic circuits, and in particular to a square wave generating circuit. Background Art

[0002] A square wave signal is a non-sinusoidal waveform commonly encountered in electronics and signal processing. It also serves as a control signal for many electronic systems. Square wave signals are generally the same, differing only in frequency, amplitude, and duty cycle depending on the specific application.

[0003] In related technologies, square wave generator circuits primarily use comparators as their core, combined with resistors and capacitors, to produce high-frequency square waves with a simple circuit structure that eliminates the need for complex digital circuits. However, in practical applications, square wave generator circuits built with comparators still exhibit a small amount of noise on the output side, affecting the signal quality of the square wave. Summary of the Invention

[0004] The present application proposes a square wave generating circuit, which can improve the situation where the output waveform has noise and enhance the signal quality of the target square wave signal.

[0005] To achieve the above objectives, the technical solution of this application is implemented as follows:

[0006] An embodiment of the present application provides a square wave generating circuit, which includes an initial waveform circuit and a hysteresis comparator circuit, and the initial waveform circuit is connected to the hysteresis comparator circuit, wherein:

[0007] An initial waveform circuit, configured to generate an initial square wave signal and charge or discharge an energy storage unit in the initial waveform circuit according to a level of the initial square wave signal, so that a first end of the energy storage unit generates an intermediate waveform signal;

[0008] The hysteresis comparator circuit is used to receive the intermediate waveform signal, compare the intermediate waveform signal with a preset threshold voltage, and generate a target square wave signal according to the comparison result.

[0009] Through the above-mentioned technical means, the initial waveform circuit and the hysteresis comparator circuit are cascaded to form a square wave generating circuit. First, an initial square wave signal is generated by the initial waveform circuit, and the energy storage unit is charged or discharged according to the level state of the initial square wave signal, so that the energy storage unit generates an intermediate waveform signal. The intermediate waveform signal is compared with a preset threshold voltage using a hysteresis comparator circuit, so that the square wave generating circuit can increase the circuit noise tolerance and ultimately output a target square wave signal without noise, thereby solving the problem of the square wave generating circuit outputting noise in the related art. In this way, by utilizing the cascade circuit structure of the initial waveform circuit and the hysteresis comparator circuit, the output side of the square wave generating circuit can provide a target square wave signal without noise, thereby improving the signal quality of the target square wave signal.

[0010] In some embodiments, the initial waveform circuit includes a first comparison circuit and a charge-discharge circuit, and the first comparison circuit is connected to the charge-discharge circuit, wherein: the first comparison circuit is used to generate an initial square wave signal; the charge-discharge circuit is used to receive the initial square wave signal and charge or discharge the energy storage unit according to the level state of the initial square wave signal, so that the first end of the energy storage unit generates an intermediate waveform signal.

[0011] Through the above-mentioned technical means, an initial square wave signal can be generated by using the first comparison circuit, and the energy storage unit can be charged or discharged according to the level state of the initial square wave signal, thereby generating an intermediate waveform signal at the first end of the energy storage unit, and then inputting the intermediate waveform signal into the hysteresis comparator circuit, so that the hysteresis comparator circuit can ultimately output a target square wave signal without noise, thereby solving the problem of the square wave generating circuit in the related art outputting noise.

[0012] In some embodiments, the first comparison circuit includes a first comparator, a first voltage divider unit and a first feedback unit, wherein: the first end of the first voltage divider unit is connected to the first power supply, the second end of the first voltage divider unit is respectively connected to the non-inverting input end of the first comparator and the first end of the first feedback unit, the second end of the first feedback unit is connected to the output end of the first comparator, and the inverting input end of the first comparator is connected to the output end of the first comparator through a charge and discharge circuit, so as to generate an initial square wave signal at the output end of the first comparator.

[0013] Through the above-mentioned technical means, the power supply voltage obtained by the first power supply and the first voltage divider unit is superimposed on the feedback voltage of the output end of the first comparator via the first feedback unit to jointly provide a non-inverting input voltage for the non-inverting input end of the first comparator, and the output end of the first comparator is used to provide a reverse input voltage for the reverse input end of the first comparator via the charge and discharge circuit. Then, an initial square wave signal can be generated according to the comparison result of the non-inverting input voltage and the reverse input voltage of the first comparator.

[0014] In some embodiments, the charge and discharge circuit includes a discharge unit and an energy storage unit, wherein: the inverting input terminal of the first comparator is respectively connected to the first terminal of the energy storage unit and the first terminal of the discharge unit, the second terminal of the energy storage unit is grounded, and the second terminal of the discharge unit is connected to the output terminal of the first comparator, for generating an intermediate waveform signal at the first terminal of the energy storage unit.

[0015] Through the above technical means, when the non-inverting input voltage of the first comparator is greater than the inverting input voltage, the initial square wave signal is at a high level, and the energy storage unit is charged at this time; when the inverting input voltage of the first comparator is greater than the non-inverting input voltage, the initial square wave signal is at a low level, and the energy storage unit is discharged through the discharge unit, thereby generating an intermediate waveform signal.

[0016] In some embodiments, the first voltage divider unit includes a first resistor and a second resistor, the first feedback unit includes a third resistor, the discharge unit includes a fourth resistor, and the energy storage unit includes a first capacitor, wherein: the first end of the first resistor is connected to the first power supply, the second end of the first resistor is respectively connected to the first end of the second resistor, the first end of the third resistor and the non-inverting input end of the first comparator, the second end of the second resistor is grounded, and the second end of the third resistor is connected to the output end of the first comparator; the inverting input end of the first comparator is respectively connected to the first end of the first capacitor and the first end of the fourth resistor, the second end of the first capacitor is grounded, and the second end of the fourth resistor is connected to the output end of the first comparator, for generating an intermediate waveform signal at the first end of the first capacitor.

[0017] Through the above-mentioned technical means, according to the initial waveform circuit composed of the first comparator, the first resistor, the second resistor, the third resistor, the fourth resistor and the first capacitor, an initial square wave signal can be generated at the output end of the first comparator; then, according to the level state of the initial square wave signal, the first capacitor is charged and discharged, thereby generating the required intermediate waveform signal, so that the intermediate waveform signal can be input into the hysteresis comparator circuit.

[0018] In some embodiments, the hysteresis comparator circuit includes a second comparison circuit and a reference source circuit, and the second comparison circuit is respectively connected to the first end of the energy storage unit and the reference source circuit, wherein: the reference source circuit is used to provide a reference power supply to the second comparison circuit; the second comparison circuit is used to receive the intermediate waveform signal and the reference power supply, and compare the intermediate waveform signal with a preset threshold voltage, and generate a target square wave signal according to the comparison result; wherein the value of the preset threshold voltage is correlated with the reference power supply.

[0019] Through the above-mentioned technical means, by setting an appropriate preset threshold voltage, the intermediate waveform signal is compared with the preset threshold voltage using the second comparison circuit. In this way, accurate comparison and judgment of the intermediate waveform signal can be achieved, and a target square wave signal without noise can be generated based on the comparison result, thereby solving the problem of noise in the output of the square wave generating circuit in the related art and improving the signal quality of the target square wave signal.

[0020] In some embodiments, the second comparison circuit includes a second comparator, a second voltage divider unit and a second feedback unit, wherein: the first end of the second voltage divider unit is connected to the first end of the energy storage unit, the second end of the second voltage divider unit is respectively connected to the non-inverting input end of the second comparator and the first end of the second feedback unit, the second end of the second feedback unit is connected to the output end of the second comparator, and the inverting input end of the second comparator is connected to the reference source circuit, for generating a target square wave signal at the output end of the second comparator.

[0021] Through the above-mentioned technical means, the intermediate waveform signal and the signal voltage obtained by the second voltage divider unit are superimposed on the output end of the second comparator via the feedback voltage of the second feedback unit to jointly provide a non-inverting input voltage for the non-inverting input end of the second comparator, and a reference source circuit is used to provide a constant inverting input voltage for the inverting input end of the second comparator, so that the preset threshold voltage of the second comparator can be determined; due to the introduction of the second comparator, the noise tolerance of the circuit is increased, and finally a target square wave signal without noise can be generated at the output end of the second comparator.

[0022] In some embodiments, the reference source circuit includes a second power supply and a third voltage divider unit, wherein: the first end of the third voltage divider unit is connected to the second power supply, and the second end of the third voltage divider unit is connected to the inverting input end of the second comparator, for providing a reference power supply to the inverting input end of the second comparator.

[0023] Through the above-mentioned technical means, the second power supply and the third voltage divider unit in the reference source circuit can provide a constant inverting input voltage for the inverting input terminal of the second comparator, so as to determine the preset threshold voltage of the second comparator, thereby generating a target square wave signal without noise at the output terminal of the second comparator, thereby improving the signal quality of the target square wave signal.

[0024] In some embodiments, the third voltage divider unit includes a fifth resistor and a sixth resistor, the second voltage divider unit includes a seventh resistor, and the second feedback unit includes an eighth resistor, wherein: the first end of the fifth resistor is connected to the second power supply, the second end of the fifth resistor is respectively connected to the first end of the sixth resistor and the inverting input end of the second comparator, and the second end of the sixth resistor is grounded; the first end of the seventh resistor is connected to the first end of the energy storage unit, the second end of the seventh resistor is respectively connected to the non-inverting input end of the second comparator and the first end of the eighth resistor, and the second end of the eighth resistor is connected to the output end of the second comparator, for generating a target square wave signal at the output end of the second comparator.

[0025] Through the above-mentioned technical means, a hysteresis comparator circuit is formed by the second comparator, the fifth resistor, the sixth resistor, the seventh resistor and the eighth resistor. The second comparator here serves as a hysteresis comparator, which can increase the noise tolerance of the circuit. By comparing the intermediate waveform signal with the preset threshold voltage, a target square wave signal without noise can be generated at the output end of the second comparator, thereby improving the signal quality of the target square wave signal.

[0026] In some embodiments, the preset threshold voltage includes an upper threshold voltage and a lower threshold voltage; the hysteresis comparator circuit is also used to output a first level signal at the output end of the second comparator when the voltage value of the intermediate waveform signal is greater than the upper threshold voltage; and output a second level signal at the output end of the second comparator when the voltage value of the intermediate waveform signal is less than the lower threshold voltage.

[0027] Through the above-mentioned technical means, the voltage value of the intermediate waveform signal is compared with the upper threshold voltage and the lower threshold voltage respectively, and the output end of the second comparator is controlled to output a waveform signal of alternating first level and second level, so that the output end of the second comparator can provide a target square wave signal without noise, thereby improving the signal quality of the target square wave signal.

[0028] In some embodiments, the upper threshold voltage and the lower threshold voltage are within the voltage range of the intermediate waveform signal, including: the upper threshold voltage is less than the non-inverting input terminal voltage of the first comparator in the initial waveform circuit corresponding to when the initial square wave signal is in the first level state; the lower threshold voltage is greater than the non-inverting input terminal voltage of the first comparator in the initial waveform circuit corresponding to when the initial square wave signal is in the second level state.

[0029] Through the above technical means, by setting appropriate preset threshold voltages, the upper threshold voltage and the lower threshold voltage are within the voltage range of the intermediate waveform signal; in this way, the hysteresis comparator circuit can be used to accurately compare and judge the intermediate waveform signal, thereby generating a target square wave signal without noise, thereby improving the signal quality of the target square wave signal.

[0030] In some embodiments, the square wave generating circuit further includes a third power supply, wherein: the first power supply end of the first comparator and the first power supply end of the second comparator are both connected to the third power supply, and the second power supply end of the first comparator and the second power supply end of the second comparator are both grounded.

[0031] By means of the above technical means, the first power supply terminals of the first comparator and the second comparator are both connected to the third power supply, and the second power supply terminals of the first comparator and the second comparator are both grounded, that is, a single power rail is used to power the first comparator and the second comparator, which can simplify the circuit structure of the square wave generating circuit and improve the safety of the square wave generating circuit.

[0032] The embodiment of the present application proposes a square wave generating circuit, which includes an initial waveform circuit and a hysteresis comparator circuit, and the initial waveform circuit is connected to the hysteresis comparator circuit. First, an initial square wave signal is generated by the initial waveform circuit, and the energy storage unit is charged or discharged according to the level state of the initial square wave signal, so that the energy storage unit generates an intermediate waveform signal. The intermediate waveform signal is compared with a preset threshold voltage by the hysteresis comparator circuit, so that the square wave generating circuit can increase the circuit noise tolerance and finally output a target square wave signal without noise, thereby solving the problem of the square wave generating circuit outputting noise in the related art. In this way, by utilizing the cascade circuit structure of the initial waveform circuit and the hysteresis comparator circuit, the output side of the square wave generating circuit can provide a target square wave signal without noise, thereby improving the signal quality of the target square wave signal. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A schematic diagram of the structure of a square wave generating circuit provided in an embodiment of the present application;

[0034] Figure 2 A schematic diagram of the structure of an initial waveform circuit provided in an embodiment of the present application Figure 1 ;

[0035] Figure 3 A schematic diagram of the structure of an initial waveform circuit provided in an embodiment of the present application Figure 2 ;

[0036] Figure 4 A schematic diagram of the structure of an initial waveform circuit provided in an embodiment of the present application Figure 3 ;

[0037] Figure 5 A schematic diagram of the structure of an initial waveform circuit provided in an embodiment of the present application Figure 4 ;

[0038] Figure 6 A schematic diagram of the structure of a hysteresis comparator circuit provided in an embodiment of the present application Figure 1 ;

[0039] Figure 7 A schematic diagram of the structure of a hysteresis comparator circuit provided in an embodiment of the present application Figure 2 ;

[0040] Figure 8 A schematic diagram of the structure of a hysteresis comparator circuit provided in an embodiment of the present application Figure 3 ;

[0041] Figure 9 A schematic diagram of the structure of a hysteresis comparator circuit provided in an embodiment of the present application Figure 4 ;

[0042] Figure 10 A schematic diagram of the detailed composition structure of a square wave generating circuit provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0045] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0046] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0047] A square wave signal is a non-sinusoidal waveform commonly encountered in electronics and signal processing. It also serves as a control signal for many electronic systems. Square wave signals are generally the same, differing only in frequency, amplitude, and duty cycle depending on the specific application.

[0048] In related technologies, square wave generator circuits primarily use comparators as their core, combined with resistors and capacitors (such as resistors and capacitors), to generate high-frequency square waves with a simple circuit structure that eliminates the need for complex digital circuits. However, in practical applications, square wave generator circuits built with comparators still exhibit a small amount of noise on the output side, affecting the signal quality of the square wave.

[0049] One possible implementation uses a comparator as the core, along with resistors and capacitors. The comparator's voltage input is connected to a power supply voltage source, while the comparator's logic ground and output ground are grounded. This approach can generate higher-frequency square waves with a simple structure and without the need for complex digital circuitry. However, during actual hardware testing, the square wave generator circuit based on the comparator exhibits a small amount of noise on the output side, affecting the square wave signal quality.

[0050] In order to solve the above problems, the embodiment of the present application provides a square wave generating circuit, which can be specifically a new circuit structure of an initial waveform circuit cascaded with a hysteresis comparator circuit. More specifically, an initial square wave signal is first generated by the initial waveform circuit, and the energy storage unit is charged or discharged according to the level state of the initial square wave signal, so that the energy storage unit generates an intermediate waveform signal, and the intermediate waveform signal is compared with a preset threshold voltage using a hysteresis comparator circuit, so that the square wave generating circuit can increase the circuit noise tolerance and ultimately output a target square wave signal without noise, thereby solving the problem of the square wave generating circuit outputting noise in the related art; thus, using the cascade circuit structure of the initial waveform circuit and the hysteresis comparator circuit, the output side of the square wave generating circuit can provide a target square wave signal without noise, thereby improving the signal quality of the target square wave signal.

[0051] The various embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0052] In one embodiment of the present application, Figure 1 This is a schematic diagram of the structure of a square wave generating circuit provided in an embodiment of the present application. Figure 1 As shown, the square wave generating circuit 10 includes an initial waveform circuit 101 and a hysteresis comparator circuit 102, and the initial waveform circuit 101 is connected to the hysteresis comparator circuit 102. The initial waveform circuit 101 includes an energy storage unit.

[0053] In an embodiment of the present application, the initial waveform circuit 101 is used to generate an initial square wave signal and charge or discharge the energy storage unit in the initial waveform circuit 101 according to the level state of the initial square wave signal, so that the first end of the energy storage unit generates an intermediate waveform signal; the hysteresis comparator circuit 102 is used to receive the intermediate waveform signal and compare the intermediate waveform signal with a preset threshold voltage, and generate a target square wave signal according to the comparison result.

[0054] In some embodiments, for the initial waveform circuit 101, as shown in FIG. Figure 2 As shown, the initial waveform circuit 101 includes a first comparison circuit 201 and a charge-discharge circuit 202, and the first comparison circuit 201 is connected to the charge-discharge circuit 202; wherein, the first comparison circuit 201 is used to generate an initial square wave signal; the charge-discharge circuit 202 is used to receive the initial square wave signal and charge or discharge the energy storage unit 402 according to the level state of the initial square wave signal, so that the first end of the energy storage unit 402 generates an intermediate waveform signal.

[0055] In an embodiment of the present application, the first comparison circuit 201 can be used to generate an initial square wave signal, and the energy storage unit is charged or discharged according to the level state of the initial square wave signal, thereby generating an intermediate waveform signal at the first end of the energy storage unit, and then inputting the intermediate waveform signal into the hysteresis comparator circuit 102, so that the hysteresis comparator circuit 102 can finally output a target square wave signal without noise.

[0056] In some embodiments, Figure 2 On the basis of Figure 3 As shown, the first comparison circuit 201 includes a first comparator U1 , a first voltage dividing unit 301 and a first feedback unit 302 .

[0057] In the embodiment of the present application, the specific connection relationship of the first comparison circuit 201 is as follows: the first end of the first voltage divider unit 301 is connected to the first power supply V1, the second end of the first voltage divider unit 301 is respectively connected to the non-inverting input end (+) of the first comparator U1 and the first end of the first feedback unit 302, the second end of the first feedback unit 302 is connected to the output end (out1) of the first comparator U1, and the inverting input end (-) of the first comparator U1 is connected to the output end (out1) of the first comparator U1 through the charge and discharge circuit 202, so as to generate an initial square wave signal at the output end (out1) of the first comparator U1.

[0058] In the embodiment of the present application, the power supply voltage obtained by the first power supply V1 and the first voltage divider unit 301 is superimposed on the output end (out1) of the first comparator U1 via the feedback voltage of the first feedback unit 302 to jointly provide a non-inverting input voltage for the non-inverting input end (+) of the first comparator U1, and the output end of the first comparator U1 is used to provide an inverting input voltage for the inverting input end (-) of the first comparator U1 via the charge and discharge circuit 202, and then an initial square wave signal can be generated according to the comparison result of the non-inverting input voltage and the inverting input voltage of the first comparator U1.

[0059] In some embodiments, Figure 3 On the basis of Figure 4As shown, the charge and discharge circuit 202 includes a discharge unit 401 and an energy storage unit 402 .

[0060] In the embodiment of the present application, the specific connection relationship of the charge and discharge circuit 202 is as follows: the inverting input terminal (-) of the first comparator U1 is respectively connected to the first terminal of the energy storage unit 402 and the first terminal of the discharge unit 401, the second terminal of the energy storage unit 402 is grounded, and the second terminal of the discharge unit 401 is connected to the output terminal (out1) of the first comparator U1, which is used to generate an intermediate waveform signal at the first terminal of the energy storage unit 402.

[0061] In the embodiment of the present application, when the non-inverting input voltage of the first comparator U1 is greater than the inverting input voltage, the initial square wave signal is at a high level, and the energy storage unit 402 is charged at this time; when the inverting input voltage of the first comparator U1 is greater than the non-inverting input voltage, the initial square wave signal is at a low level, and the energy storage unit 402 is discharged through the discharge unit 401, thereby generating an intermediate waveform signal.

[0062] In the embodiment of the present application, the initial waveform circuit 101 is cascaded with the hysteresis comparator circuit 102 to form a new circuit structure. This new circuit structure can increase the noise margin of the circuit, allowing the output side of the hysteresis comparator circuit 102 to provide a target square wave signal without noise, thereby improving the signal quality of the target square wave signal.

[0063] In a specific embodiment, Figure 5 As shown, the first comparison circuit 201 includes a first comparator U1 , a first resistor R1 , a second resistor R2 , and a third resistor R3 ; the charge-discharge circuit 202 includes a first capacitor C1 and a fourth resistor R4 .

[0064] In the embodiment of the present application, the first resistor R1 and the second resistor R2 constitute a first voltage divider unit 301 , the third resistor R3 constitutes a first feedback unit 302 , the fourth resistor R4 constitutes a discharge unit 401 , and the first capacitor C1 constitutes an energy storage unit 402 .

[0065] In the embodiments of this application, Figure 5As shown, the specific connection relationship of the initial waveform circuit 101 is as follows: the first end of the first resistor R1 is connected to the first power supply V1, the second end of the first resistor R1 is respectively connected to the first end of the second resistor R2, the first end of the third resistor R3 and the non-inverting input terminal (+) of the first comparator U1, the second end of the second resistor R2 is grounded, and the second end of the third resistor R3 is connected to the output terminal (out1) of the first comparator U1; the inverting input terminal (-) of the first comparator U1 is respectively connected to the first end of the first capacitor C1 and the first end of the fourth resistor R4, the second end of the first capacitor C1 is grounded, and the second end of the fourth resistor R4 is connected to the output terminal (out1) of the first comparator U1, for generating an intermediate waveform signal at the first end of the first capacitor C1.

[0066] In the embodiment of the present application, the first voltage divider 301 is used to adjust and distribute voltage. Specifically, by varying the resistance values ​​of the first resistor R1 and the second resistor R2, the first voltage divider 301 can produce different voltage drops across different resistors, thereby meeting the different requirements of the first comparator U1 for the common-mode input voltage. Here, the first power supply V1 can be a constant voltage power supply, but this is not specifically limited.

[0067] In the embodiment of the present application, an intermediate waveform signal can be generated by the fourth resistor R4, the first capacitor C1 and the output terminal (out1) of the first comparator U1. Here, the intermediate waveform signal can be generated by the voltage change at the terminal of the first capacitor C1. In addition, Figure 5 As shown, after the initial waveform circuit 101 generates an intermediate waveform signal, the intermediate waveform signal is used as the input of the hysteresis comparator circuit 102.

[0068] In some embodiments, the initial waveform circuit 101 is further used to generate an initial square wave signal at the output terminal (out1) of the first comparator U1; wherein: when the voltage of the non-inverting input terminal (+) of the first comparator U1 is greater than the voltage of the inverting input terminal (-) of the first comparator U1, the output terminal (out1) of the first comparator U1 outputs a first level signal; when the voltage of the non-inverting input terminal (+) of the first comparator U1 is less than the voltage of the inverting input terminal (-) of the first comparator U1, the output terminal (out1) of the first comparator outputs a second level signal.

[0069] In the embodiment of the present application, the output end (out1) of the first comparator U1 in the initial waveform circuit 101 generates an initial square wave signal, but there is a noise signal in the initial square wave signal. Therefore, the initial square wave signal generated by the initial waveform circuit 101 is not used here, so as to avoid the situation where the generated square wave signal contains noise.

[0070] In the embodiment of the present application, the first level signal may be a high level, and the second level signal may be a low level; or, the first level signal may be a low level, and the second level signal may be a high level.

[0071] For example, when the voltage at the non-inverting input (+) of the first comparator U1 is greater than the voltage at the inverting input (-) of the first comparator U1, the output (out1) of the first comparator U1 outputs a high level. When the voltage at the non-inverting input (+) of the first comparator U1 is less than the voltage at the inverting input (-) of the first comparator U1, the output (out1) of the first comparator outputs a low level. Therefore, the square wave signal here can also be called a square wave pulse signal.

[0072] In the embodiment of the present application, the charge and discharge circuit 202 is composed of a first capacitor C1 and a fourth resistor R4, and a resistor-capacitance (RC) circuit is formed by the first capacitor C1 and the fourth resistor R4. Then, an intermediate waveform signal is generated through the output end of the RC circuit and the output end (out1) of the first comparator U1.

[0073] In some embodiments, the intermediate waveform signal is a sawtooth wave signal; wherein: when the output terminal (out1) of the first comparator U1 outputs a first level signal, the first capacitor C1 is charged so that the voltage at the second terminal of the first capacitor C1 gradually increases; when the output terminal (out1) of the first comparator U1 outputs a second level signal, the first capacitor C1 is discharged through the fourth resistor R4 so that the voltage at the second terminal of the first capacitor C1 gradually decreases.

[0074] In the embodiment of the present application, the voltage at the non-inverting input terminal (+) of the first comparator U1 is determined by the first resistor R1, the second resistor R2, the first power supply V1, the third resistor R3, and the output terminal (out1) of the first comparator U1. Specifically, the first resistor R1 and the second resistor R2 introduce a supply voltage from the first power supply V1 and superimpose the feedback voltage of the output terminal (out1) of the first comparator U1 via the third resistor R3. Then, the voltage at the non-inverting input terminal (+) of the first comparator U1 can be calculated by the superposition theorem. The voltage at the non-inverting input terminal (+) of the first comparator U1 is as follows:

[0075]

[0076] Wherein, V1 represents the supply voltage of the first power supply V1, V′o ut represents the output voltage of the first comparator U1, R1 represents the resistance value of the first resistor R1, R2 represents the resistance value of the second resistor R2, and R3 represents the resistance value of the third resistor R3.

[0077] In the embodiment of the present application, the voltage at the inverting input terminal (-) of the first comparator U1 is determined by the initial square wave signal derived from the fourth resistor R4, the first capacitor C1, and the output terminal (out1) of the first comparator U1. Specifically, the RC circuit formed by the fourth resistor R4 and the first capacitor C1 is derived from the output terminal (out1) of the first comparator U1 and converted into an intermediate waveform signal. Here, the intermediate waveform signal at the inverting input (-) of the first comparator U1 includes two phases: charging and discharging. The charging phase formula is as follows:

[0078]

[0079] The formula for the discharge phase is as follows:

[0080]

[0081] Wherein, t represents time, and t represents the charge and discharge time constant.

[0082] In the embodiment of the present application, at the moment of power-on of the first comparator U1, the output voltage V′ of the first comparator U1 is out =0, the voltage at the non-inverting input of the first comparator U1 is calculated as The voltage v′ at the inverting input terminal (-) of the first comparator U1 - Close to 0, at this time, the voltage of the non-inverting input terminal (+) of the first comparator U1 is greater than the voltage of the inverting input terminal (-), and the output voltage V' of the first comparator U1 out = is high, and the first capacitor C1 starts to be charged. The voltage of the first capacitor C1 gradually increases. At this time, the voltage of the non-inverting input terminal (+) of the first comparator U1 is calculated as When the voltage of the first capacitor C1 is greater than the voltage v' at the non-inverting input terminal (+) of the first comparator U1 - When , the output terminal (out1) of the first comparator U1 is at a low level, the first capacitor C1 starts to discharge, and the voltage of the first capacitor C1 gradually decreases. At this time, the voltage of the non-inverting input terminal (+) of the first comparator U1 is calculated as When the voltage of the first capacitor C1 is less than the voltage v' at the non-inverting input terminal (+) of the first comparator U1 + When the first comparator U1 outputs a high level, the output terminal (out1) of the first comparator U1 is high. In this way, the repetitive cycle of charge and discharge forms the oscillation of the initial waveform circuit, thereby generating an intermediate waveform signal through the initial waveform circuit 101. It should be noted that when the first capacitor C1 is in the discharge stage, v′ + There is no need to consider V′ when calculating out , that is, in the discharge stage, when the output terminal (out1) of the first comparator U1 is low, that is, V′ out =0.

[0083] In some embodiments, for the hysteresis comparator circuit 102, see Figure 6 The hysteresis comparator circuit 102 includes a second comparison circuit 601 and a reference source circuit 602 , and the second comparison circuit 601 is connected to the first end of the energy storage unit and the reference source circuit 602 respectively.

[0084] Among them, the reference source circuit 602 is used to provide a reference power supply to the second comparison circuit 601; the second comparison circuit 601 is used to receive the intermediate waveform signal and the reference power supply, and compare the intermediate waveform signal with a preset threshold voltage, and generate a target square wave signal according to the comparison result; wherein, the value of the preset threshold voltage is correlated with the reference power supply.

[0085] In an embodiment of the present application, by setting an appropriate preset threshold voltage, the second comparison circuit 601 is used to compare the intermediate waveform signal with the preset threshold voltage. In this way, accurate comparison and judgment of the intermediate waveform signal can be achieved, and a target square wave signal without noise can be generated based on the comparison result.

[0086] In some embodiments, Figure 6 Based on Figure 7 The second comparison circuit 601 includes a second comparator U2 , a second voltage dividing unit 701 and a second feedback unit 702 .

[0087] In an embodiment of the present application, the specific connection relationship of the second comparison circuit 601 is as follows: the first end of the second voltage divider unit 701 is connected to the first end of the energy storage unit, the second end of the second voltage divider unit 701 is respectively connected to the non-inverting input end (+) of the second comparator U2 and the first end of the second feedback unit 702, the second end of the second feedback unit 702 is connected to the output end (out2) of the second comparator U2, and the inverting input end (-) of the second comparator U2 is connected to the reference source circuit 602, which is used to generate a target square wave signal at the output end (out2) of the second comparator U2.

[0088] In the embodiment of the present application, for the first comparator U1 or the second comparator U2, the non-inverting input terminal can be called the anode input terminal (or "positive input terminal"), and the inverting input terminal can be called the cathode input terminal (or "negative input terminal").

[0089] In an embodiment of the present application, the signal voltage obtained by the intermediate waveform signal and the second voltage divider unit 701 are superimposed on the output end (out2) of the second comparator U2 via the feedback voltage of the second feedback unit 702 to jointly provide a non-inverting input voltage for the non-inverting input end (+) of the second comparator U2, and the reference source circuit 602 is used to provide a constant non-inverting input voltage for the non-inverting input end (-) of the second comparator U2, so that the preset threshold voltage of the second comparator can be determined.

[0090] In some embodiments, Figure 7 Based on Figure 8 , the reference source circuit 602 includes a second power supply V2 and a third voltage dividing unit 801.

[0091] In an embodiment of the present application, the specific connection relationship of the reference source circuit 602 is as follows: the first end of the third voltage divider unit 801 is connected to the second power supply V2, and the second end of the third voltage divider unit 801 is connected to the inverting input terminal (-) of the second comparator U2, for providing a reference power supply to the inverting input terminal (-) of the second comparator U2.

[0092] In an embodiment of the present application, the second power supply V2 and the third voltage divider unit 801 in the reference source circuit 602 can provide a constant inverting input voltage for the inverting input terminal (-) of the second comparator U2, so as to determine the preset threshold voltage of the second comparator, thereby generating a target square wave signal without noise at the output terminal of the second comparator, thereby improving the signal quality of the target square wave signal.

[0093] In a specific embodiment, see Figure 9 The second comparison circuit 601 includes a second comparator U2, a fifth resistor R5, and a sixth resistor R6; the reference source circuit 602 includes a seventh resistor R7, an eighth resistor R8, and a second power supply V2.

[0094] In the embodiment of the present application, the fifth resistor R5 and the sixth resistor R6 constitute the third voltage dividing unit 801 , the seventh resistor R7 constitutes the second voltage dividing unit 701 , and the eighth resistor R8 constitutes the second feedback unit 702 .

[0095] In the embodiments of this application, Figure 9 As shown, the specific connection relationship of the hysteresis comparator circuit 102 is as follows: the first end of the fifth resistor R5 is connected to the second power supply V2, the second end of the fifth resistor R5 is respectively connected to the first end of the sixth resistor R6 and the inverting input terminal (-) of the second comparator U2, and the second end of the sixth resistor R6 is grounded; the first end of the seventh resistor R7 is connected to the first end of the energy storage unit, the second end of the seventh resistor R7 is respectively connected to the non-inverting input terminal (+) of the second comparator U2 and the first end of the eighth resistor R8, and the second end of the eighth resistor R8 is connected to the output terminal (out2) of the second comparator U2, for generating a target square wave signal at the output terminal (out2) of the second comparator U2.

[0096] In some embodiments, the reference source circuit 602 may only include the second power supply V2 , and it is only necessary to ensure that the voltage provided by the second power supply V2 meets the requirement of the inverting input terminal of the second comparator U2 .

[0097] It should be noted that the reference source circuit 602 may include a second power supply V2, or may also include a third voltage divider unit 801 and a second power supply V2. The third voltage divider unit 801 may be composed of a fifth resistor R5 and a sixth resistor R6, or may be composed of more resistors. Furthermore, the second power supply V2 may be a constant current power supply, which is not limited herein. In the embodiment of the present application, it is only necessary to ensure that the voltage provided by the reference source circuit 602 can meet the requirements of the inverting input terminal of the second comparator U2.

[0098] In the embodiment of the present application, the voltage at the non-inverting input terminal (+) of the second comparator U2 is determined by the intermediate waveform signal, the eighth resistor R8, and the output terminal (out2) of the second comparator U2. Specifically, the voltage at the non-inverting input terminal (+) of the second comparator U2 is determined by the intermediate waveform signal plus the target square wave signal derived from the output terminal (out2) of the second comparator U2 by the eighth resistor R8. Then, the voltage at the non-inverting input terminal of the second comparator U2 can be calculated by the superposition theorem as follows:

[0099]

[0100] Among them, V c Represents the voltage of the middle waveform signal, V out represents the output voltage of the second comparator U2, R7 represents the resistance value of the seventh resistor R7, and R8 represents the resistance value of the eighth resistor R8.

[0101] In the embodiment of the present application, the voltage at the inverting input terminal (-) of the second comparator U2 is determined by the second power supply V2, the fifth resistor R5, and the sixth resistor R6. Specifically, the fifth resistor R5 and the sixth resistor R6 form a third voltage divider unit that introduces a constant voltage from the second power supply V2. The voltage at the inverting input terminal (-) of the second comparator U2 can be calculated as follows:

[0102]

[0103] Wherein, V2 represents the supply voltage of the second power supply V2, R5 represents the resistance value of the fifth resistor R5, and R6 represents the resistance value of the sixth resistor R6.

[0104] In some embodiments, the preset threshold voltage includes an upper threshold voltage and a lower threshold voltage; the hysteresis comparator circuit is also used to output a first level signal at the output end of the second comparator when the voltage value of the intermediate waveform signal is greater than the upper threshold voltage; and output a second level signal at the output end of the second comparator when the voltage value of the intermediate waveform signal is less than the lower threshold voltage.

[0105] In the embodiment of the present application, the upper threshold voltage of the hysteresis comparator circuit 102 is as follows:

[0106]

[0107] The lower threshold voltage of the hysteresis comparator circuit 102 is as follows:

[0108]

[0109] Among them, v th+ Represents the upper threshold voltage, v th- Indicates the lower threshold voltage.

[0110] It should be noted that in the implementation of this application, at the lower threshold voltage v th- The output voltage V of the second comparator U2 is out Indicates high level.

[0111] In the embodiment of the present application, the voltage v of the non-inverting input terminal of the second comparator U2 is combined + and the voltage at the inverting input, v - The upper and lower threshold voltages of the hysteresis comparator circuit can be obtained, that is, let v + =v - There are upper and lower threshold voltages here because the output terminal (out2) of the second comparator U2 has two states, namely high level and low level; when the output terminal (out2) of the second comparator U2 is low level, the output voltage V out is 0.

[0112] In the embodiment of the present application, the noise tolerance interval of the hysteresis comparator circuit is determined by the upper threshold voltage and the lower threshold voltage, and the value of the noise tolerance interval is In some embodiments, the noise tolerance range of the hysteresis comparator circuit is associated with the resistance settings of the seventh resistor and the eighth resistor.

[0113] In the embodiment of the present application, when the intermediate waveform signal fluctuates between the upper threshold voltage and the lower threshold voltage, the output state of the output terminal (out2) of the second comparator U2 remains unchanged; when the intermediate waveform signal fluctuates outside the upper threshold voltage and the lower threshold voltage, the output state of the output terminal (out2) of the second comparator U2 changes. Specifically, during the continuous cycle of charge and discharge of the first capacitor C1, when the voltage V c Greater than the upper threshold voltage v th+ When the output terminal (out2) of the second comparator U2 is high, when the intermediate waveform signal V c Less than the lower threshold voltage v th-When the voltage of the intermediate waveform signal is lowered to the upper threshold voltage and the lower threshold voltage, the output terminal (out2) of the second comparator U2 is at a low level. In other words, the voltage value of the intermediate waveform signal is compared with the upper threshold voltage and the lower threshold voltage, respectively, and the output terminal (out2) of the second comparator U2 is controlled to output a waveform signal that alternates between the first level and the second level.

[0114] It should be noted that v th- ~v th+ The noise tolerance interval is between φ1 and φ2. When the target square wave signal generated by the output terminal (out2) of the second comparator U2 is not affected, the specific noise tolerance interval can be set by the resistance values ​​of the seventh resistor R7 and the eighth resistor R8.

[0115] In the embodiment of the present application, the first level signal may be a high level, and the second level signal may be a low level; or, the first level signal may be a low level, and the second level signal may be a high level.

[0116] Thus, the target square wave signal provided by the output side of the second comparator U2 can be a waveform signal that alternates between a high level and a low level. Thus, by comparing the voltage value of the intermediate waveform signal with the upper and lower threshold voltages, the output end (out2) of the second comparator U2 can provide a target square wave signal free of noise, thereby improving the signal quality of the target square wave signal.

[0117] It can be understood that "noise tolerance" refers to the voltage range of a signal in a digital electronic system that allows a certain amount of noise interference without affecting normal signal recognition and transmission. Specifically, the hysteresis comparator circuit 102 has two threshold voltages, one is an upper threshold voltage and the other is a lower threshold voltage. When the voltage at the non-inverting input of the second comparator U2 exceeds the upper threshold voltage, the output state of the second comparator U2 will switch to a high level. When the voltage at the non-inverting input of the second comparator U2 is lower than the lower threshold voltage, the output state of the second comparator U2 will switch to a low level, thereby generating a target square wave signal.

[0118] It's important to note that if the voltage at the non-inverting input of the second comparator U2 is within the threshold range—that is, it neither exceeds the upper threshold voltage nor falls below the lower threshold voltage—the state of the output of the second comparator U2 (out2) remains unchanged. This state is called the hold state, where the output of the second comparator U2 (out2) remains at the level of the last switch until the input voltage reaches a sufficiently close level or exceeds another threshold, at which point the output of the second comparator U2 switches again. Therefore, the state of the output of the second comparator U2 (out2) remains unchanged at this point. However, this situation should be avoided in the design of the square wave generator circuit to improve the signal quality of the target square wave signal.

[0119] In some embodiments, the upper threshold voltage and the lower threshold voltage are within the voltage range of the intermediate waveform signal, including: the upper threshold voltage is less than the non-inverting input terminal voltage of the first comparator in the initial waveform circuit corresponding to when the initial square wave signal is in the first level state; the lower threshold voltage is greater than the non-inverting input terminal voltage of the first comparator in the initial waveform circuit corresponding to when the initial square wave signal is in the second level state.

[0120] In the embodiment of the present application, the upper threshold voltage and the lower threshold voltage are within the voltage range of the intermediate waveform signal, including:

[0121]

[0122]

[0123] In the embodiment of the present application, by setting appropriate preset threshold voltages so that the upper threshold voltage and the lower threshold voltage are within the voltage range of the intermediate waveform signal, the hysteresis comparator circuit 102 can accurately compare and judge the intermediate waveform signal, thereby generating a target square wave signal free of noise, thereby improving the signal quality of the target square wave signal.

[0124] In some embodiments, as Figure 3 、 Figure 4 、 Figure 5 、 Figure 7 、 Figure 8 and Figure 9 As shown, the square wave generating circuit 10 may further include a third power supply V3. The first power supply terminal of the first comparator U1 in the initial waveform circuit 101 and the first power supply terminal of the second comparator U2 in the hysteresis comparator circuit 102 are both connected to the third power supply V3, and the second power supply terminal of the first comparator U1 and the second power supply terminal of the second comparator U2 are both grounded.

[0125] In an embodiment of the present application, the first power supply terminals of the first comparator U1 and the second comparator U2 are both connected to the third power supply, and the second power supply terminals of the first comparator U1 and the second comparator U2 are both grounded, that is, a single power rail is used to power the first comparator U1 and the second comparator U2, thereby simplifying the circuit structure of the square wave generating circuit and improving the safety of the square wave generating circuit.

[0126] In the embodiment of the present application, the third power supply V3 serves as the supply voltage for the first comparator U1 and the second comparator U3. The first power supply V1 and the second power supply V2 affect the upper and lower threshold voltages of the first comparator U1 and the second comparator U3. The first power supply V1, the second power supply V2, and the third power supply V3 can be designed to be the same or different, depending on the design requirements of the square wave generating circuit. The power supply sizes of the first power supply V1, the second power supply V2, and the third power supply V3 are not limited.

[0127] An embodiment of the present application provides a square wave generating circuit, which includes an initial waveform circuit and a hysteresis comparator circuit, wherein the initial waveform circuit is connected to the hysteresis comparator circuit. First, an initial square wave signal is generated by the initial waveform circuit, and an energy storage unit is charged or discharged according to the level state of the initial square wave signal, so that the energy storage unit generates an intermediate waveform signal. The intermediate waveform signal is compared with a preset threshold voltage by the hysteresis comparator circuit, so that the square wave generating circuit can increase the circuit noise tolerance and ultimately output a target square wave signal without noise, thereby solving the problem of the square wave generating circuit outputting noise in the related art. In this way, the cascade circuit structure of the initial waveform circuit and the hysteresis comparator circuit is used to enable the output side to provide a target square wave signal without noise, thereby improving the signal quality of the target square wave signal.

[0128] In another embodiment of the present application, based on the square wave generating circuit of the above embodiment, Figure 10 This is a detailed structural diagram of a square wave generating circuit provided in an embodiment of the present application. Figure 10 As shown, the square wave generating circuit 10 includes an initial waveform circuit 101 and a hysteresis comparator circuit 102. The initial waveform circuit 101 includes a first power supply V1, a first resistor R1, a second resistor R3, a fourth resistor R4, a first capacitor C1 and a first comparator U1; the hysteresis comparator circuit 102 includes a second power supply V2, a fifth resistor R5, a sixth resistor R6, a seventh resistor R7, an eighth resistor R8 and a second comparator U2. In addition, the square wave generating circuit 10 also includes a third power supply V3 for supplying power to the first comparator U1 and the second comparator U2. Here, the specific connection relationship of the square wave generating circuit 10 is as follows: Figure 10 shown.

[0129] In the embodiment of the present application, the square wave generating circuit 10 can be referred to as a pulse generating circuit based on a comparator, the initial waveform circuit 101 can be understood as a square wave generating circuit based on a comparator, and the hysteresis comparator circuit 102 can also be understood as a hysteresis comparator based on a comparator. Here, the first comparator U1, the first resistor R1, the second resistor R3, the fourth resistor R4, and the first capacitor C1 constitute the initial waveform circuit 101; the fifth resistor R5, the sixth resistor R6, the seventh resistor R7, the eighth resistor R8, and the second comparator U2 constitute the hysteresis comparator circuit 102.

[0130] In the embodiment of the present application, the initial waveform circuit 101 can be referred to as a first-stage circuit, and the hysteresis comparator circuit 102 can be referred to as a second-stage circuit. The intermediate waveform signal can be a sawtooth wave signal. The first capacitor C1 of the first-stage circuit is used as an output to be led to the input of the second-stage circuit. By adjusting the size of the second power supply V2 of the second-stage circuit and the resistance values ​​of the fifth resistor R5, the sixth resistor R6, the seventh resistor R7, and the eighth resistor R8, the upper / lower threshold voltage of the second-stage circuit can be adjusted to improve the robustness of the system, thereby solving the problem of noise in the output of the square wave generator circuit built based on the comparator, and thus improving the signal quality of the target square wave signal.

[0131] In a specific embodiment, combining Figure 10 The square wave generating circuit provided in the embodiment of the present application is described in detail.

[0132] The first stage circuit can be composed of a first comparator U1, a first resistor R1, a second resistor R2, a third resistor R3, a fourth resistor R4, and a first capacitor C1. The voltage at the anode input terminal of the first comparator U1 is obtained by adding a constant voltage introduced from the first power supply V1 by a first voltage divider composed of the first resistor R1 and the second resistor R2, and an initial square wave signal introduced from the output terminal of the first comparator U1 by the third resistor R3. The voltage v′ at the anode input terminal of the first comparator U1 can be calculated by the superposition theorem as shown in the above formula (1): + The voltage at the cathode input terminal of the first comparator U1 is drawn from the output terminal (out1) of the first comparator U1 by the RC circuit composed of the fourth resistor R4 and the first capacitor C1 and converted and output into a sawtooth wave signal. The sawtooth wave signal at the cathode input terminal of the first comparator U1 includes two stages of charging and discharging. The formula for the charging stage is shown in the above formula (2), and the formula for the discharging stage is shown in the above formula (3).

[0133] At the moment of power-on of the first comparator U1, the output voltage V′ of the first comparator U1 out is 0, then the voltage of the anode input terminal of the first comparator U1 is calculated as And the voltage v' at the inverting input of the first comparator U1 - Close to 0. In this case, the voltage at the anode input terminal of the first comparator U1 is greater than the voltage at the cathode input terminal, and the output terminal of the first comparator U1 outputs a high level. At this time, the first capacitor C1 begins to be charged, and the voltage of the first capacitor C1 gradually increases. At this time, the voltage at the anode input terminal of the first comparator U1 becomes When the voltage at the first capacitor C1 is greater than the voltage at the anode input of the first comparator U1, the output of the first comparator U1 outputs a low level. At this time, the first capacitor C1 begins to discharge, and the voltage of the first capacitor C1 gradually decreases. When the voltage at the first capacitor C1 is lower than the voltage at the anode input of the first comparator U1, the output of the first comparator U1 is high. This repetitive charging and discharging process forms an oscillation circuit, thereby generating a sawtooth wave signal.

[0134] The second stage circuit can be composed of a second comparator U2, a fifth resistor R5, a sixth resistor R6, a seventh resistor R7 and an eighth resistor R8. The voltage at the anode input terminal of the second comparator U2 is composed of the sawtooth wave signal of the first stage circuit plus the target square wave signal drawn from the output terminal of the second comparator U2 by the eighth resistor R8. By the superposition theorem, the voltage v at the anode input terminal of the second comparator U2 can be calculated as shown in the above formula (4). + The voltage at the cathode input of the second comparator U2 is a constant voltage introduced from the second power supply V2 by the third voltage divider composed of the fifth resistor R5 and the sixth resistor R6. The voltage calculation formula of the cathode input of the second comparator U2 is as shown in the above formula (5). The voltage v at the anode input of the second comparator U2 is + and the voltage v at the cathode input of the second comparator U2 - The upper threshold voltage and lower threshold voltage of the hysteresis comparator circuit can be obtained. Here, the upper threshold voltage and lower threshold voltage calculation formulas are shown in formulas (7) and (8) respectively. th- The output voltage V of the second comparator U2 is out Indicates high level.

[0135] By introducing the hysteresis comparator circuit 102, the square wave generating circuit 10 increases the noise tolerance. The value of the noise tolerance is determined by the upper threshold voltage and the lower threshold voltage. That is, the noise tolerance is When the first capacitor C1 is continuously charged and discharged, when the voltage of the sawtooth wave signal V c Greater than the upper threshold voltage v th+ When the output terminal of the second comparator U2 is high level, when the voltage of the sawtooth wave signal V c Less than the lower threshold voltage v th- When the output terminal of the second comparator U2 is low level. Here, v th- ~v th+ The noise tolerance interval is between φ1 and φ2. Without affecting the output of the output terminal of the second comparator U2, the specific noise tolerance interval can be set by setting the resistance values ​​of the seventh resistor R7 and the eighth resistor R8.

[0136] It should be noted that, in terms of resistance setting, the upper threshold voltage and the lower threshold voltage need to satisfy the above formulas (8) and (9) so that the upper threshold voltage and the lower threshold voltage of the hysteresis comparator circuit 102 are within the voltage range of the sawtooth wave signal.

[0137] The present application provides a square wave generating circuit, which can be specifically a square wave generating circuit powered by a single power rail. Through the above embodiment, it can be seen that by introducing a hysteresis comparator circuit, the noise margin is increased, and the problem of noise in the output of the square wave generating circuit constructed with only a comparator can be solved, so that a square wave pulse signal (i.e., a target square wave signal) without noise is output at the output end of the second comparator, thereby improving the signal quality of the target square wave signal.

[0138] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, circuit, product, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, circuit, product, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, circuit, product, or apparatus comprising the element.

[0139] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0140] The features disclosed in several circuit or product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0141] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A square wave generating circuit, characterized in that: The square wave generating circuit includes an initial waveform circuit and a hysteresis comparator circuit, and the initial waveform circuit is connected to the hysteresis comparator circuit, wherein: The initial waveform circuit is used to generate an initial square wave signal and charge or discharge the energy storage unit in the initial waveform circuit according to the level state of the initial square wave signal, so that the first end of the energy storage unit generates an intermediate waveform signal; The hysteresis comparator circuit is used to receive the intermediate waveform signal, compare the intermediate waveform signal with a preset threshold voltage, and generate a target square wave signal according to the comparison result.

2. The square wave generating circuit according to claim 1, characterized in that: The initial waveform circuit includes a first comparison circuit and a charge-discharge circuit, and the first comparison circuit is connected to the charge-discharge circuit, wherein: The first comparison circuit is used to generate the initial square wave signal; The charge and discharge circuit is used to receive the initial square wave signal and charge or discharge the energy storage unit according to the level state of the initial square wave signal, so that the first end of the energy storage unit generates the intermediate waveform signal.

3. The square wave generating circuit according to claim 2, characterized in that: The first comparison circuit includes a first comparator, a first voltage divider unit and a first feedback unit, wherein: The first end of the first voltage divider unit is connected to the first power supply, the second end of the first voltage divider unit is respectively connected to the non-inverting input end of the first comparator and the first end of the first feedback unit, the second end of the first feedback unit is connected to the output end of the first comparator, and the inverting input end of the first comparator is connected to the output end of the first comparator through the charge and discharge circuit, so as to generate the initial square wave signal at the output end of the first comparator.

4. The square wave generating circuit according to claim 3, characterized in that: The charge and discharge circuit includes a discharge unit and the energy storage unit, wherein: The inverting input terminal of the first comparator is respectively connected to the first terminal of the energy storage unit and the first terminal of the discharge unit, the second terminal of the energy storage unit is grounded, and the second terminal of the discharge unit is connected to the output terminal of the first comparator, so as to generate the intermediate waveform signal at the first terminal of the energy storage unit.

5. The square wave generating circuit according to claim 4, characterized in that: The first voltage dividing unit includes a first resistor and a second resistor, the first feedback unit includes a third resistor, the discharge unit includes a fourth resistor, and the energy storage unit includes a first capacitor, wherein: A first end of the first resistor is connected to the first power supply, a second end of the first resistor is connected to the first end of the second resistor, the first end of the third resistor, and the non-inverting input terminal of the first comparator respectively, a second end of the second resistor is grounded, and a second end of the third resistor is connected to the output terminal of the first comparator; The inverting input terminal of the first comparator is respectively connected to the first end of the first capacitor and the first end of the fourth resistor, the second end of the first capacitor is grounded, and the second end of the fourth resistor is connected to the output terminal of the first comparator, for generating the intermediate waveform signal at the first end of the first capacitor.

6. The square wave generating circuit according to any one of claims 1 to 5, characterized in that: The hysteresis comparator circuit includes a second comparison circuit and a reference source circuit, and the second comparison circuit is connected to the first end of the energy storage unit and the reference source circuit respectively, wherein: The reference source circuit is used to provide a reference power supply to the second comparison circuit; The second comparison circuit is used to receive the intermediate waveform signal and the reference power supply, and compare the intermediate waveform signal with a preset threshold voltage, and generate the target square wave signal according to the comparison result; wherein the value of the preset threshold voltage is correlated with the reference power supply.

7. The square wave generating circuit according to claim 6, characterized in that: The second comparison circuit includes a second comparator, a second voltage divider unit and a second feedback unit, wherein: The first end of the second voltage divider unit is connected to the first end of the energy storage unit, the second end of the second voltage divider unit is respectively connected to the non-inverting input end of the second comparator and the first end of the second feedback unit, the second end of the second feedback unit is connected to the output end of the second comparator, and the inverting input end of the second comparator is connected to the reference source circuit, so as to generate the target square wave signal at the output end of the second comparator.

8. The square wave generating circuit according to claim 7, characterized in that: The reference source circuit includes a second power supply and a third voltage dividing unit, wherein: A first end of the third voltage dividing unit is connected to the second power supply, and a second end of the third voltage dividing unit is connected to the inverting input terminal of the second comparator, for providing the reference power supply to the inverting input terminal of the second comparator.

9. The square wave generating circuit according to claim 8, characterized in that: The third voltage dividing unit includes a fifth resistor and a sixth resistor, the second voltage dividing unit includes a seventh resistor, and the second feedback unit includes an eighth resistor, wherein: A first end of the fifth resistor is connected to the second power supply, a second end of the fifth resistor is connected to the first end of the sixth resistor and the inverting input end of the second comparator respectively, and a second end of the sixth resistor is grounded; The first end of the seventh resistor is connected to the first end of the energy storage unit, the second end of the seventh resistor is respectively connected to the non-inverting input end of the second comparator and the first end of the eighth resistor, and the second end of the eighth resistor is connected to the output end of the second comparator, for generating the target square wave signal at the output end of the second comparator.

10. The square wave generating circuit according to claim 9, characterized in that: The preset threshold voltage includes an upper threshold voltage and a lower threshold voltage; The hysteresis comparator circuit is also used to output a first level signal at the output end of the second comparator when the voltage value of the intermediate waveform signal is greater than the upper threshold voltage; and output a second level signal at the output end of the second comparator when the voltage value of the intermediate waveform signal is less than the lower threshold voltage.

11. The square wave generating circuit according to claim 10, characterized in that: The upper threshold voltage and the lower threshold voltage are within the voltage range of the intermediate waveform signal, comprising: The upper threshold voltage is less than the voltage at the non-inverting input terminal of the first comparator in the initial waveform circuit corresponding to when the initial square wave signal is in the first level state; The lower threshold voltage is greater than the corresponding non-inverting input terminal voltage of the first comparator in the initial waveform circuit when the initial square wave signal is in the second level state.

12. The square wave generating circuit according to any one of claims 1 to 5, characterized in that: The square wave generating circuit further includes a third power supply, wherein: The first power supply end of the first comparator in the initial waveform circuit and the first power supply end of the second comparator in the hysteresis comparator circuit are both connected to the third power supply, and the second power supply end of the first comparator and the second power supply end of the second comparator are both grounded.