Clock generator and clock signal generation method
By designing a clock generator in a high-speed system, generating high-frequency clock signals using the first and second oscillators and logic units, and adjusting the charging current through the duty cycle calibration circuit, the frequency accuracy and duty cycle of the RC relaxation oscillator are solved. The problem of stability achieves high-precision and stable duty cycle clock signal generation.
Patent Information
- Application Number
- CN202410994247.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-22
AI Technical Summary
In high-speed systems, the frequency accuracy of the RC relaxation oscillator is affected by process, voltage and temperature changes, making it difficult to meet the requirements of high accuracy and duty cycle stability, especially after frequency doubling, the duty cycle of the output clock is difficult to maintain at 50 after frequency multiplication. %.
A clock generator is designed, including a first oscillator, a frequency multiplier, a second oscillator and a logic unit. The first clock signal is generated by the first oscillator, and the frequency multiplier doubles its frequency, and the second oscillator Adjust the phase, the logic unit generates the target clock signal, and adjusts the charging current through the duty cycle calibration circuit to stabilize the duty cycle.
It realizes high-frequency, high-precision and stable duty cycle clock signal generation in high-speed systems, reducing the impact of frequency accuracy on delay changes, and ensuring that the duty cycle of the output clock can be flexibly maintained at 50%.
Smart Images

Figure CN119010846A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of integrated circuits, and in particular relates to a clock generator and a clock signal generating method. Background Art
[0002] In complex SOC systems, high-speed clock signals are usually required to transmit and receive information. In typical clock systems, high-speed clocks are generally implemented through PLLs (phase-locked loops). However, modules such as loop filters in PLLs usually occupy a large area. Therefore, in some low-cost, area-required applications, RC relaxation oscillators can be used instead of PLLs to generate system clocks.
[0003] The traditional RC relaxation oscillator structure is as follows Figure 1 As shown, the clock signal CLK is mainly generated by the periodic charging and discharging of the capacitor Cint. The charging current Icharge is used to charge the capacitor Cint, and the ramp voltage VC on the capacitor Cint is compared with the reference voltage Vref on the resistor Rint. When the ramp voltage VC reaches the reference voltage Vref, the ramp voltage VC is reset and the next charging is restarted, so as to oscillate in a cycle. Since the comparison delay of the comparator and other delays in the clock path will vary greatly with the process, voltage and temperature, the oscillation frequency accuracy of the RC relaxation oscillator is limited, especially at higher oscillation frequencies, the impact of these delay changes is more significant, thereby limiting the application of such RC relaxation oscillators in high-speed systems.
[0004] In order to reduce the impact of the above delays on the frequency accuracy of the RC relaxation oscillator, the oscillation clock of the RC relaxation oscillator can be doubled by a frequency multiplication circuit to obtain a higher-speed output clock. Common frequency multiplication circuits include Figure 2 As shown, it is generally realized by an XOR gate XOR, the clock signal CLK and the delayed clock signal CLK generated after a period of delay by the delay unit Dtime D Connected to the two input terminals of XOR gate at the same time, Figure 3 As can be seen from the figure, at this time, the rising edge and the falling edge of the clock signal CLK respectively generate rising edges at the output end of the XOR gate XOR, thereby obtaining an output clock CLK_doub having a frequency equal to twice the frequency of the clock signal CLK.
[0005] However, in most systems, there are certain constraints and requirements on the duty cycle of the system clock. Figure 3 The duty cycle of the output clock CLK_doub needs to be kept at 50%, and the delayed clock signal CLK needs to be strictly controlled. DThe delay time is 1 / 4 of the clock cycle (Tclk). However, the delay unit Dtime is generally composed of an inverter chain, and the delay of the inverter varies significantly with PVT. Even if the duty cycle of the input clock signal CLK is 50%, Figure 4 As can be seen from the figure, as the delay time of the inverter chain shifts, the delayed clock signal CLK D The delay time is difficult to maintain at 1 / 4 clock cycle (Tclk), making it difficult to guarantee the duty cycle of the output clock CLK_doub.
[0006] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention
[0007] The object of the present invention is to provide a clock generator and a clock signal generating method, which can reduce the influence of various delays on frequency accuracy and realize an output clock with a stable duty cycle, so as to be suitable for high-speed, high-precision and stable duty cycle system applications.
[0008] In order to achieve the above object, a specific embodiment of the present invention provides a clock generator, including: a first oscillator, a frequency multiplier, a second oscillator and a logic unit;
[0009] The first oscillator is connected to a first voltage to generate a first clock signal, the input end of the frequency multiplier is connected to the output end of the first oscillator, the frequency multiplier is used to generate a multiplied clock signal based on the first clock signal, the second oscillator is connected to the first voltage to generate a second clock signal, the frequency of the second clock signal is equal to the frequency of the multiplied clock signal, the first input end of the logic unit is connected to the output end of the frequency multiplier, the second input end of the logic unit is connected to the output end of the second oscillator, and the logic unit is used to generate a target clock signal based on the second clock signal and the multiplied clock signal.
[0010] In one or more embodiments of the present invention, the second oscillator adjusts the phase of the second clock signal relative to the multiplied clock signal based on adjusting the internal charging current, and the logic unit is used to generate a target clock signal based on the transition edge of the second clock signal and the transition edge of the multiplied clock signal.
[0011] In one or more embodiments of the present invention, the first oscillator includes a first transistor, a second transistor, a first resistor, a first capacitor, a first switch and a first comparison control module, the first end of the first transistor and the first end of the second transistor are connected to a first voltage, the control end of the first transistor and the control end of the second transistor are connected to the control voltage, the second end of the first transistor is connected to the first end of the first resistor, the second end of the second transistor is connected to the first end of the first capacitor and the first end of the first switch, the second end of the first resistor, the second end of the first capacitor and the second end of the first switch are connected to the second voltage, the first end of the first comparison control module is connected to the first end of the first resistor, the second end of the first comparison control module is connected to the first end of the first capacitor, and the first comparison control module generates a first clock signal for controlling the first switch to be closed or opened based on the voltage of the first end of the first resistor and the voltage of the first end of the first capacitor.
[0012] In one or more embodiments of the present invention, the second oscillator includes a third transistor, a current-type DAC, a second resistor, a second capacitor, a second switch and a second comparison control module, the first end of the third transistor and the first end of the current-type DAC are connected to the first voltage, the second end of the third transistor is connected to the first end of the second resistor, the control end of the third transistor is used to receive the control voltage, each control end of the current-type DAC is used to receive a calibration code, or a control voltage and a calibration code, the second end of the current-type DAC is connected to the first end of the second capacitor and the first end of the second switch, the second end of the second resistor, the second end of the second capacitor and the second end of the second switch are connected to the second voltage, the current-type DAC is used to generate a charging current provided to charge the second capacitor and adjust the charging current based on the control of the calibration code, the first input end of the second comparison control module is connected to the first end of the second resistor, the second input end of the second comparison control module is connected to the first end of the second capacitor, and the second comparison control module is used to generate a second clock signal for controlling the second switch to be closed or opened based on the voltage of the first end of the second resistor and the voltage of the first end of the second capacitor.
[0013] In one or more embodiments of the present invention, the frequency multiplier includes a delay unit and an XOR gate, wherein the first input terminal of the XOR gate is connected to the output terminal of the first oscillator, the second input terminal of the XOR gate is connected to the output terminal of the delay unit, the input terminal of the delay unit is connected to the output terminal of the first oscillator, and the output terminal of the XOR gate is used to output a doubled clock signal.
[0014] In one or more embodiments of the present invention, the logic unit includes a first NAND gate and a second NAND gate, the first input end of the first NAND gate is connected to the output end of the frequency multiplier to receive the multiplied clock signal, the second input end of the first NAND gate is connected to the output end of the second NAND gate, the first input end of the second NAND gate is connected to the output end of the first NAND gate, the second input end of the second NAND gate is connected to the output end of the second oscillator to receive the second clock signal, and the output end of the first NAND gate is used to output the target clock signal.
[0015] In one or more embodiments of the present invention, the clock generator further includes a duty cycle calibration circuit, which generates an adjustment indication signal corresponding to a calibration code for regulating the charging current based on the target clock signal and a reference voltage.
[0016] In one or more embodiments of the present invention, the duty cycle calibration circuit includes a filtering module and a comparison output module, the input end of the filtering module is connected to the output end of the logic unit, the first input end of the comparison output module is connected to the output end of the filtering module, the second input end of the comparison output module is used to receive a reference voltage, and the output end of the comparison output module outputs an adjustment indication signal.
[0017] The present invention also discloses a clock signal generating method. Based on the clock generator, the clock signal generating method comprises:
[0018] generating a frequency-multiplied clock signal based on the first clock signal;
[0019] generating a second clock signal having the same frequency as the multiplied clock signal;
[0020] A target clock signal is generated based on a transition edge of the second clock signal and a transition edge of the multiplied frequency clock signal.
[0021] In one or more embodiments of the present invention, the clock signal generating method includes: adjusting the phase of the second clock signal based on the difference between the duty cycle of the target clock signal and the preset duty cycle.
[0022] Compared with the prior art, the clock generator and clock signal generating method of the present invention obtain a first clock signal with a lower frequency through a first oscillator, then multiply the first clock signal through a frequency multiplier, obtain a second clock signal with the same frequency as the signal obtained by the frequency multiplier through a second oscillator, generate a target clock signal based on the second clock signal and the first clock signal through a logic unit, and can perform duty cycle calibration through a duty cycle calibration circuit, thereby achieving a high-frequency, high-precision and duty-cycle stable high-frequency target clock signal with a lower design cost, so that it can be more flexibly applied to high-speed systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 It is a circuit schematic diagram of an RC relaxation oscillator in the prior art.
[0025] Figure 2 The circuit diagram of the frequency multiplier in the prior art is shown in FIG.
[0026] Figure 3 This is an ideal signal waveform diagram of a clock generator in the prior art.
[0027] Figure 4 This is an actual signal waveform diagram of a clock generator in the prior art.
[0028] Figure 5 4 is a circuit diagram of a clock generator in one embodiment of the present invention.
[0029] Figure 6 FIG. 4 is a signal waveform diagram generated by a clock generator in an embodiment of the present invention.
[0030] Figure 7 FIG. 4 is a signal waveform diagram corresponding to a case where the duty cycle of the target clock signal is less than 50% in an embodiment of the present invention.
[0031] Figure 8 1 is a signal waveform diagram corresponding to when the duty cycle of the target clock signal is greater than 50% in one embodiment of the present invention.
[0032] Fig. 9 is a flow chart of a clock signal generating method in one embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] "Coupled" or "connected" or "connected" in the specification includes both direct connection and indirect connection. Indirect connection is a connection through an intermediate medium, such as a connection through an electrically conductive medium, which may have parasitic inductance or parasitic capacitance; indirect connection may also include connection through other active or passive devices on the basis of achieving the same or similar functional purposes, such as connection through circuits or components such as switches and follower circuits. In addition, in the invention, words such as "first" and "second" are mainly used to distinguish one technical feature from another technical feature, and do not necessarily require or imply that there is a certain actual relationship, quantity or order between these technical features.
[0035] In the detailed description of the specification, reference is made to the accompanying drawings forming a part thereof, wherein like reference numerals refer to like parts throughout, and wherein are shown by way of exemplary embodiments that may be implemented. It should be understood that other embodiments may be utilized and structural or logical changes may be made without departing from the scope of the present disclosure. Therefore, the following detailed description should not be considered in a limiting sense.
[0036] The various operations in the specification may be described in turn as multiple discrete actions or operations in a manner that is most helpful in understanding the claimed subject matter. However, the order of description should not be interpreted as implying that these operations must be order-dependent. Specifically, these operations may not be performed in the order presented. The described operations may be performed in an order different from the described embodiments. Various additional operations may be performed and / or the described operations may be omitted in additional embodiments.
[0037] For purposes of this disclosure, the phrase "A and / or B" means (A), (B), or (A and B). For purposes of this disclosure, the phrase "A, B and / or C" means (A), (B), (C), (A and B), (A and C), (B and C), or (A, B and C).
[0038] Various components and devices may be referred to or shown in the singular form in this document (for example, "MOS tube", "transistor", "switch", etc.), but this is only for convenience of discussion, and any element mentioned in the singular form may include multiple such elements according to the teachings of this document.
[0039] The specification describes the use of the phrases "in one embodiment" or "in other embodiments" or "in some embodiments", which may each refer to one or more of the same or different embodiments. In addition, the terms "including", "comprising", "having", etc. used in relation to the embodiments of the present disclosure are synonymous.
[0040] like Figure 5As shown, a clock generator in an embodiment of the present invention includes: a first oscillator 10, a frequency multiplier 20, a second oscillator 30, a logic unit 40 and a duty cycle calibration circuit 50.
[0041] The first oscillator 10 is connected to the first voltage to generate a first clock signal CLK1 . The input end of the frequency multiplier 20 is connected to the output end of the first oscillator 10 . The frequency multiplier 20 is used to generate a multiplied clock signal CLKX based on the first clock signal CLK1 .
[0042] The second oscillator 30 is connected to the first voltage to generate a second clock signal CLK2, and the frequency of the second clock signal CLK2 is equal to the frequency of the multiplied clock signal CLKX. In one embodiment, the second oscillator 30 can adjust the phase of the second clock signal CLK2 relative to the multiplied clock signal CLKX based on adjusting the internal charging current Ich2.
[0043] The first oscillator 10 and the second oscillator 30 both generate corresponding charging currents based on the first voltage and the control voltage VBP. In one embodiment, the first voltage is the power supply voltage VDD.
[0044] The first input terminal of the logic unit 40 is connected to the output terminal of the frequency multiplier 20, and the second input terminal of the logic unit 40 is connected to the output terminal of the second oscillator 30. The logic unit 40 is used to generate the target clock signal CLKD based on the second clock signal CLK2 and the multiplied clock signal CLKX. In one embodiment, the logic unit 40 is used to generate the target clock signal CLKD based on the transition edge of the second clock signal CLK2 and the transition edge of the multiplied clock signal CLKX.
[0045] The duty ratio calibration circuit 50 generates a trim indication signal T corresponding to a trim code for adjusting the charging current Ich2 based on the target clock signal CLKD and the reference voltage.
[0046] In one embodiment, the first oscillator 10 includes a first transistor M1 , a second transistor M2 , a first resistor R1 , a first capacitor C1 , a first switch K1 and a first comparison control module 11 .
[0047] The first end of the first transistor M1 and the first end of the second transistor M2 are connected to the first voltage, the control end of the first transistor M1 and the control end of the second transistor M2 are connected to the control voltage, the second end of the first transistor M1 is connected to the first end of the first resistor R1, the second end of the second transistor M2 is connected to the first end of the first capacitor C1 and the first end of the first switch K1, the second end of the first resistor R1, the second end of the first capacitor C1 and the second end of the first switch K1 are connected to the second voltage, the first end of the first comparison control module 11 is connected to the first end of the first resistor R1, the second end of the first comparison control module 11 is connected to the first end of the first capacitor C1, and the first comparison control module 11 generates a first clock signal CLK1 for controlling the first switch K1 to be closed or opened based on the voltage of the first end of the first resistor R1 and the voltage of the first end of the first capacitor C1. In one embodiment, the second voltage is a ground voltage.
[0048] The first comparison control module 11 includes a first comparator COM1, a first inverter INV1, a first latch Latch1, a second inverter INV2 and a third inverter INV3.
[0049] The first input terminal of the first comparator COM1 is connected to the second terminal of the first transistor M1, the second input terminal of the first comparator COM1 is connected to the second terminal of the second transistor M2, the output terminal of the first comparator COM1 is connected to the input terminal of the first inverter INV1, the first input terminal of the first comparator COM1 is a negative input terminal, and the second input terminal of the first comparator COM1 is a positive input terminal. The output terminal of the first inverter INV1 is connected to the input terminal of the first latch Latch1, the output terminal of the first latch Latch1 is connected to the input terminal of the second inverter INV2 to output the first clock signal CLK1, the output terminal of the second inverter INV2 is connected to the input terminal of the third inverter INV3, the output terminal of the third inverter INV3 is connected to the first switch K1, and the third inverter INV3 outputs the first clock signal CLK1 to control the closing or opening of the first switch K1. In other embodiments, the first input terminal of the first comparator COM1 can be a positive input terminal, and the second input terminal of the first comparator COM1 can be a negative input terminal.
[0050] In one embodiment, the first transistor M1 generates a reference current Iref1 based on the control voltage VBP and the first voltage and provides it to the first resistor R1. The second transistor M2 generates a charging current Ich1 based on the control voltage VBP and the first voltage to charge the first capacitor C1. The first comparator COM1 compares the voltage at the first end of the first resistor R1 with the voltage at the first end of the first capacitor C1 to generate a first control signal and controls the first switch K1 to be closed or opened after being transmitted through the first inverter INV1, the first latch Latch1, the second inverter INV2 and the third inverter INV3. When the first switch K1 is closed, the first capacitor C1 is discharged. When the first switch K1 is opened, the first capacitor C1 is charged.
[0051] In other embodiments, one or more of the first inverter INV1 , the first latch Latch1 , the second inverter INV2 , and the third inverter INV3 may not be provided, or the first comparison control module 11 may be other modules.
[0052] The second oscillator 30 includes a third transistor M3 , a current-type DAC (digital-to-analog converter) 31 , a second resistor R2 , a second capacitor C2 , a second switch K2 and a second comparison control module 32 .
[0053] The first end of the third transistor M3 and the first end of the current-type DAC are connected to the first voltage, the second end of the third transistor M3 is connected to the first end of the second resistor R2, the control end of the third transistor M3 is used to receive the control voltage, each control end of the current-type DAC31 is used to receive the control voltage VBP and the calibration code trimcode, the second end of the current-type DAC is connected to the first end of the second capacitor C2 and the first end of the second switch K2, the second end of the second resistor R2, the second end of the second capacitor C2 and the second end of the second switch K2 are connected to the second voltage, the current-type DAC31 is used to generate a charging current Ich2 provided to charge the second capacitor C2 and adjust the charging current Ich2 based on the control of the calibration code trimcode, the first input end of the second comparison control module 32 is connected to the first end of the second resistor R2, the second input end of the second comparison control module 32 is connected to the first end of the second capacitor C2, and the second comparison control module 32 is used to generate a second clock signal CLK2 for controlling the second switch K2 to be closed or opened based on the voltage Vref2 of the first end of the second resistor R2 and the voltage VD of the first end of the second capacitor C2.
[0054] The second comparison control module 32 includes a second comparator COM2, a fourth inverter INV4, a second latch Latch2, a fifth inverter INV5 and a sixth inverter INV6.
[0055] The first input terminal of the second comparator COM2 is connected to the second terminal of the third transistor M3, the second input terminal of the second comparator COM2 is connected to the first terminal of the second capacitor C2, the output terminal of the second comparator COM2 is connected to the input terminal of the fourth inverter INV4, the first input terminal of the second comparator COM2 is a negative input terminal, and the second input terminal of the second comparator COM2 is a positive input terminal. The output terminal of the fourth inverter INV4 is connected to the input terminal of the second latch Latch2, the output terminal of the second latch Latch2 is connected to the input terminal of the fifth inverter INV5 to output the second clock signal CLK2, the output terminal of the fifth inverter INV5 is connected to the input terminal of the sixth inverter INV6, the output terminal of the sixth inverter INV6 is connected to the second switch K2, and the sixth inverter INV6 outputs the first clock signal CLK1 to control the closing or opening of the second switch K2.
[0056] In other embodiments, the first input terminal of the second comparator COM2 may be a positive input terminal, and the second input terminal of the second comparator COM2 may be a negative input terminal.
[0057] In one embodiment, the third transistor M3 generates a reference current Iref2 based on the control voltage VBP and the first voltage and provides it to the second resistor R2. The control terminal in the current-type DAC31 is used to receive the control voltage VBP and the trim code. The current-type DAC31 generates a charging current Ich2 based on the control voltage VBP and the first voltage to charge the second capacitor C2, and the size of the charging current Ich2 can be adjusted by the trim code. In one embodiment, the current-type DAC31 is composed of multiple transistors.
[0058] In other embodiments, if the regulation of the charging current Ich2 is not involved, the current-source DAC 31 may be replaced by a transistor, or the control terminals of all transistors of the current-source DAC 31 may receive the control voltage VBP.
[0059] The second comparator COM2 compares the voltage at the first end of the second resistor R2 with the voltage at the first end of the second capacitor C2 to generate a second control signal, and controls the second switch K2 to close or open after being transmitted through the fourth inverter INV4, the second latch Latch2, the fifth inverter INV5 and the sixth inverter INV6. When the second switch K2 is closed, the second capacitor C2 is discharged, and when the second switch K2 is opened, the second capacitor C2 is charged.
[0060] In other embodiments, one or more of the fourth inverter INV4 , the second latch Latch2 , the fifth inverter INV5 , and the sixth inverter INV6 may not be provided, or the second comparison control module 32 may be other modules.
[0061] In one embodiment, the first transistor M1, the second transistor M2 and the third transistor M3 are all P-channel MOS transistors, and the transistors in the current-mode DAC31 are also P-channel MOS transistors. The first end of the first transistor M1, the first end of the second transistor M2 and the first end of the third transistor M3 are sources, the second end of the first transistor M1, the second end of the second transistor M2 and the second end of the third transistor M3 are drains, and the control end of the first transistor M1, the control end of the second transistor M2 and the control end of the third transistor M3 are gates. In other embodiments, the first transistor M1, the second transistor M2 and the third transistor M3 can be N-channel MOS transistors, and the transistors in the current-mode DAC31 can also be N-channel MOS transistors, and the corresponding circuit connection relationship is adaptively modified.
[0062] In other embodiments, the first oscillator 10 and the second oscillator 20 may both use an oscillator with voltage-average feedback to implement the output of the first clock signal CLK1. In the oscillator with voltage-average feedback, the reference voltage is adjusted by an integrator to reduce the impact of the comparator comparison delay on the oscillation clock frequency due to PVT changes, and then multiplied by a frequency multiplier to achieve a high-frequency clock signal with higher frequency accuracy.
[0063] In one embodiment, the first clock signal CLK1 can be obtained by periodically controlling the first capacitor C1 to charge and discharge, and the second clock signal CLK2 can be obtained by periodically controlling the second capacitor C2 to charge and discharge. The charging current Ich2 generated by the second oscillator 20 is proportionally reduced relative to the charging current Ich1 generated by the first oscillator 10, and the selected second capacitor C2 can also be proportionally reduced relative to the first capacitor C1 to save design costs such as area and power consumption, and make the frequency of the second clock signal CLK2 twice the frequency of the first clock signal CLK1. In other embodiments, the multiples of the two clock signals can be other values.
[0064] like Figure 5 As shown, the frequency multiplier 20 includes a delay unit Delay and an XOR gate XOR, wherein a first input end of the XOR gate XOR is connected to an output end of the first oscillator 10 to receive a first clock signal CLK1, a second input end of the XOR gate XOR is connected to an output end of the delay unit Delay, an input end of the delay unit Delay is connected to an output end of the first oscillator 10 to receive the first clock signal CLK1, and an output end of the XOR gate XOR is used to output a multiplied clock signal CLKX. In one embodiment, the delay unit Delay may be formed by one or more buffers connected in series, or the delay unit Delay may be formed by a plurality of inverters connected in series.
[0065] In one embodiment, one first clock signal CLK1 directly enters the XOR gate XOR, and another first clock signal CLK1 enters the XOR gate XOR after a small delay through the delay unit Delay, and finally obtains a narrow pulse doubled-frequency clock signal CLKX through the XOR gate XOR.
[0066] like Figure 5 As shown, in one embodiment, the logic unit 40 is a latch. The logic unit 40 includes a first NAND gate NA1 and a second NAND gate NA2. The first input end of the first NAND gate NA1 is connected to the output end of the frequency multiplier 20 to receive the multiplied clock signal CLKX, the second input end of the first NAND gate NA1 is connected to the output end of the second NAND gate NA2, the first input end of the second NAND gate NA2 is connected to the output end of the first NAND gate NA1, the second input end of the second NAND gate NA2 is connected to the output end of the second oscillator 30 to receive the second clock signal CLK2, the output end of the first NAND gate NA1 is used to output the target clock signal CLKD, and the output end of the second NAND gate NA2 outputs a signal inverted from the target clock signal CLKD. In one embodiment, the first NAND gate NA1 also has an enable input end for receiving an enable signal EN, and the second NAND gate NA2 also has an enable input end for receiving the enable signal EN.
[0067] In one embodiment, the frequency-multiplied clock signal CLKX and the second clock signal CLK2 are latched by the logic unit 40 to obtain the final target clock signal CLKD. Figure 6 As shown, since the rising edge and the falling edge of the target clock signal CLKD are respectively determined by the falling edge of the second clock signal CLK2 and the falling edge of the multiplied clock signal CLKX, if the duty cycle of the target clock signal CLKD needs to be guaranteed to be 50%, it is no longer necessary to strictly set TD (data setup time) = 0.25Tclk (clock cycle), thereby reducing the influence of the duty cycle of the target clock signal CLKD caused by the inverter chain delay changing with PVT, so that a target clock signal CLKD with a duty cycle that is relatively stable at 50% can be obtained.
[0068] From the above principle, it can be known that if the duty cycle of the target clock signal CLKD deviates from 50% due to the influence of PVT, it can be calibrated by adjusting the falling edge position of the second clock signal CLK2; and from the principle of the second oscillator 30, it can be known that the falling edge position of the second clock signal CLK2 is determined by the moment when the voltage VD at the first end of the second capacitor C2 is charged to the voltage Vref2. If the capacitance value of the second capacitor C2 is fixed here, the change speed of the voltage VD can be adjusted by adjusting the size of the charging current Ich2 output by the current-type DAC31.
[0069] like Figure 7As shown, if the duty cycle D<50%, it means that the falling edge of the second clock signal CLK2 is closer to the falling edge of the multiplied clock signal CLKX. It is necessary to increase the charging current Ich2 by adjusting the trim code of the current-type DAC31, so that the voltage VD presents a larger charging slope and charges to the voltage Vref2 at an earlier time, thereby increasing the distance between the falling edge of the second clock signal CLK2 and the falling edge of the multiplied clock signal CLKX, and adjusting the duty cycle of the target clock signal CLKD back to 50%.
[0070] like Figure 8 As shown, if the duty cycle D>50%, which means that the falling edge of the second clock signal CLK2 is farther from the falling edge of the multiplied clock signal CLKX, it is necessary to reduce the charging current Ich2 by adjusting the trim code of the current-type DAC31, so that the voltage VD rises more slowly and the time of charging to the voltage Vref2 is later, thereby reducing the distance between the falling edge of the second clock signal CLK2 and the falling edge of the multiplied clock signal CLKX, and adjusting the duty cycle of the target clock signal CLKD back to 50%.
[0071] like Figure 5 As shown, the duty cycle calibration circuit 50 includes a filtering module and a comparison output module, the input end of the filtering module is connected to the output end of the logic unit 40, the first input end of the comparison output module is connected to the output end of the filtering module, and the second input end of the comparison output module is used to receive a reference voltage.
[0072] In one embodiment, the input end of the filtering module is connected to the output end of the second NAND gate NA2 of the logic unit 40, and the filtering module includes a third resistor R3 and a third capacitor C3, the first end of the third resistor R3 is connected to the output end of the second NAND gate NA2, the second end of the third resistor R3 is connected to the first end of the third capacitor C3 and the first input end of the comparison output module, and the second end of the third capacitor C3 is connected to the second voltage.
[0073] As can be seen from the above, the duty cycle calibration circuit 50 receives the signal output by the second NAND gate NA2, and does not directly receive the target clock signal CLKD output by the first NAND gate NA1. However, since the signal output by the second NAND gate NA2 is opposite in phase to the target clock signal CLKD, it has no effect on the subsequent duty cycle calibration, so the duty cycle calibration circuit 50 is equivalent to using the target clock signal CLKD.
[0074] In other embodiments, the input end of the filter module may also be connected to the output end of the first NAND gate NA1 of the logic unit 40 .
[0075] The comparison output module includes a third comparator COM3, a seventh inverter INV7 and an eighth inverter INV8. The first input terminal of the third comparator COM3 is connected to the first terminal of the third capacitor C3, the second input terminal of the third comparator COM3 is used to receive a reference voltage, the input terminal of the seventh inverter INV7 is connected to the output terminal of the third comparator COM3, the output terminal of the seventh inverter INV7 is connected to the input terminal of the eighth inverter INV8, and the output terminal of the eighth inverter INV8 outputs an adjustment indication signal T.
[0076] In other embodiments, the number of inverters may be adjusted as needed, the seventh inverter INV7 and the eighth inverter INV8 may not be provided, or a buffer may be used instead of an inverter.
[0077] Since the general purpose input and output pin GPIO may affect the actual duty cycle of the target clock signal CLKD inside the circuit during circuit testing, a duty cycle calibration circuit 50 is provided.
[0078] The third comparator COM3 is used to compare the clock signal output by the logic unit 40 with the reference voltage after filtering by the filtering module to generate the adjustment indication signal T. In one embodiment, the value of the reference voltage is half of the first voltage (0.5VDD).
[0079] When the duty cycle is less than 50%, the voltage Vfilter at the first end of the third capacitor C3 is less than 0.5VDD (i.e., there is not enough time to charge the voltage at the first end of the third capacitor C3 to 0.5VDD), and the adjustment indication signal T output by the third comparator COM3 is "1". On the contrary, when the duty cycle is greater than 50%, the voltage Vfilter at the first end of the third capacitor C3 is greater than 0.5VDD (i.e., the charging time of the third capacitor C3 is too long, resulting in the voltage at its first end exceeding 0.5VDD), and the adjustment indication signal T output by the third comparator COM3 is "0".
[0080] Therefore, when calibrating the duty cycle, start adjusting from the smallest calibration code trim code in the direction of increasing it, and capture the calibration code trimcode corresponding to the moment when the adjustment indication signal T output by the third comparator COM3 flips from "1" to "0", that is, the calibration code trimcode corresponding to the change of the duty cycle from less than 50% to greater than 50% is determined as the calibration code trimcode with a duty cycle closest to 50%.
[0081] like Fig. 9 As shown, the present invention also discloses a clock signal generating method, and the clock signal generating method based on the above clock generator includes:
[0082] Generate a frequency-multiplied clock signal CLKX based on the first clock signal CLK1;
[0083] Generate a second clock signal CLK2 having the same frequency as the multiplied clock signal CLKX;
[0084] The target clock signal CLKD is generated based on the transition edges of the second clock signal CLK2 and the multiplied clock signal CLKX, and the phase of the second clock signal CLK2 can be adjusted based on the difference between the duty cycle of the target clock signal CLKD and the preset duty cycle.
[0085] like Figure 5 As shown, in one embodiment, a first clock signal CLK1 is generated by a first oscillator 10 , and a frequency multiplier 20 generates a multiplied clock signal CLKX based on the first clock signal CLK1 .
[0086] The second oscillator 30 generates a second clock signal CLK2 having the same frequency as that of the multiplied clock signal CLKX.
[0087] The target clock signal CLKD is generated based on the multiplied clock signal CLKX and the second clock signal CLK2 by the logic unit 40. The target clock signal CLKD is mainly generated based on the transition edge of the second clock signal CLK2 and the transition edge of the multiplied clock signal CLKX by the logic unit 40, and based on the difference between the duty cycle of the target clock signal CLKD and the preset duty cycle, the phase of the second clock signal CLK2 relative to the multiplied clock signal CLKX can be adjusted by adjusting the charging current inside the second oscillator 30, so as to finally adjust the duty cycle of the target clock signal CLKD.
[0088] In one embodiment, the duty cycle calibration circuit 50 generates an adjustment indication signal T corresponding to the calibration code trim code for adjusting the charging current Ich2 based on the target clock signal CLKD and the reference voltage. In one embodiment, the duty cycle calibration circuit 50 compares the clock signal inverted from the target clock signal CLKD with the reference voltage to generate the adjustment indication signal T, and by capturing the calibration code trim code corresponding to the transition moment of the adjustment indication signal T, determines the calibration code trim code corresponding to the duty cycle closest to 50%.
[0089] For the specific method, please refer to the above description of the clock generator.
[0090] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0091] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A clock generator, characterized in that: include: A first oscillator, a frequency multiplier, a second oscillator and a logic unit; The first oscillator is connected to a first voltage to generate a first clock signal, the input end of the frequency multiplier is connected to the output end of the first oscillator, the frequency multiplier is used to generate a multiplied clock signal based on the first clock signal, the second oscillator is connected to the first voltage to generate a second clock signal, the frequency of the second clock signal is equal to the frequency of the multiplied clock signal, the first input end of the logic unit is connected to the output end of the frequency multiplier, the second input end of the logic unit is connected to the output end of the second oscillator, and the logic unit is used to generate a target clock signal based on the second clock signal and the multiplied clock signal.
2. The clock generator according to claim 1, characterized in that: The second oscillator adjusts the phase of the second clock signal relative to the multiplied clock signal based on adjusting the internal charging current, and the logic unit is used to generate the target clock signal based on the transition edge of the second clock signal and the transition edge of the multiplied clock signal.
3. The clock generator according to claim 1, characterized in that: The first oscillator includes a first transistor, a second transistor, a first resistor, a first capacitor, a first switch and a first comparison control module, wherein the first end of the first transistor and the first end of the second transistor are connected to a first voltage, the control end of the first transistor and the control end of the second transistor are connected to the control voltage, the second end of the first transistor is connected to the first end of the first resistor, the second end of the second transistor is connected to the first end of the first capacitor and the first end of the first switch, the second end of the first resistor, the second end of the first capacitor and the second end of the first switch are connected to the second voltage, the first end of the first comparison control module is connected to the first end of the first resistor, the second end of the first comparison control module is connected to the first end of the first capacitor, and the first comparison control module generates a first clock signal for controlling the first switch to be closed or opened based on the voltage of the first end of the first resistor and the voltage of the first end of the first capacitor.
4. The clock generator according to claim 1, characterized in that: The second oscillator includes a third transistor, a current-type DAC, a second resistor, a second capacitor, a second switch and a second comparison control module. The first end of the third transistor and the first end of the current-type DAC are connected to a first voltage, the second end of the third transistor is connected to the first end of the second resistor, the control end of the third transistor is used to receive a control voltage, and each control end of the current-type DAC is used to receive a control voltage and a calibration code. The second end of the current-type DAC is connected to the first end of the second capacitor and the first end of the second switch, the second end of the second resistor, the second end of the second capacitor and the second end of the second switch are connected to the second voltage, the current-type DAC is used to generate a charging current provided to charge the second capacitor and adjust the charging current based on the control of the calibration code, the first input end of the second comparison control module is connected to the first end of the second resistor, the second input end of the second comparison control module is connected to the first end of the second capacitor, and the second comparison control module is used to generate a second clock signal for controlling the second switch to be closed or opened based on the voltage of the first end of the second resistor and the voltage of the first end of the second capacitor.
5. The clock generator according to claim 1, characterized in that: The frequency multiplier includes a delay unit and an XOR gate, wherein a first input end of the XOR gate is connected to an output end of a first oscillator, a second input end of the XOR gate is connected to an output end of the delay unit, an input end of the delay unit is connected to an output end of the first oscillator, and an output end of the XOR gate is used to output a frequency-multiplied clock signal.
6. The clock generator according to claim 1, characterized in that: The logic unit includes a first NAND gate and a second NAND gate, wherein the first input end of the first NAND gate is connected to the output end of the frequency multiplier to receive the multiplied clock signal, the second input end of the first NAND gate is connected to the output end of the second NAND gate, the first input end of the second NAND gate is connected to the output end of the first NAND gate, the second input end of the second NAND gate is connected to the output end of the second oscillator to receive the second clock signal, and the output end of the first NAND gate is used to output the target clock signal.
7. The clock generator according to claim 2, characterized in that: The clock generator further includes a duty cycle calibration circuit that generates an adjustment indication signal corresponding to a calibration code for regulating a charging current based on a target clock signal and a reference voltage.
8. The clock generator according to claim 7, characterized in that: The duty cycle calibration circuit includes a filtering module and a comparison output module, the input end of the filtering module is connected to the output end of the logic unit, the first input end of the comparison output module is connected to the output end of the filtering module, the second input end of the comparison output module is used to receive a reference voltage, and the output end of the comparison output module outputs an adjustment indication signal.
9. A clock signal generating method, characterized in that: generating a frequency-multiplied clock signal based on the first clock signal; generating a second clock signal having the same frequency as the multiplied clock signal; A target clock signal is generated based on a transition edge of the second clock signal and a transition edge of the multiplied frequency clock signal.
10. The clock signal generating method according to claim 9, characterized in that: The clock signal generating method comprises: The phase of the second clock signal is adjusted based on the difference between the duty cycle of the target clock signal and the preset duty cycle.
