Frequency switching circuits and methods, chips, and terminals
By combining a clock switching module and a glitch shielding module, the problems of system complexity and high static power consumption in traditional frequency switching circuits are solved, and frequency switching with a simple architecture and dynamic power consumption adjustment is achieved.
Patent Information
- Application Number
- CN202611401037.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-11-10
AI Technical Summary
Traditional frequency switching circuits suffer from high system architecture complexity and high static power consumption.
A clock switching module and a glitch shielding module are used. The branch current is adjusted by the current adjustment unit, the clock selection unit selects the clock source, and glitch shielding is performed during frequency switching.
It achieves a simple system architecture, dynamic adjustment of static power consumption, and glitch-free frequency switching.
Smart Images

Figure CN123074486A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of integrated circuit technology, and in particular to a frequency switching circuit and method, chip, and terminal. Background Technology
[0002] For traditional application systems, when switching between multiple clock frequencies is required, the conventional approach is to design multiple ring oscillators to operate simultaneously, generating multiple clock signals of different frequencies. When a switching signal arrives, the corresponding clock signal is selected for output, thereby achieving the purpose of clock frequency switching. However, operating multiple ring oscillators simultaneously not only increases the complexity of the system architecture and its area, but also implies high static power consumption.
[0003] Therefore, how to reduce system architecture complexity to reduce area while reducing static power consumption has become one of the technical problems that those skilled in the art urgently want to solve.
[0004] It should be noted that the above description of the technical background is only for the purpose of providing a clear and complete explanation of the technical solutions of the present invention and facilitating understanding by those skilled in the art. It should not be assumed that the above technical solutions are known to those skilled in the art simply because they have been described in the background section of this invention. Summary of the Invention
[0005] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a frequency switching circuit, method, chip, and terminal to solve the problems of complex system architecture and high static power consumption in existing frequency switching circuits.
[0006] To achieve the above and other related objectives, the present invention provides a frequency switching circuit, including a clock switching module and a glitch shielding module, wherein the clock switching module includes a current adjustment unit and a clock selection unit;
[0007] The current regulation unit adjusts the branch current by adjusting the branch resistance, and accordingly provides oscillation current to the clock selection unit;
[0008] The clock selection unit selects one from the first clock source and the second clock source based on the switching control signal, and the selected clock source starts working based on the oscillation current and outputs a clock signal of the corresponding frequency.
[0009] The glitch shielding module is used to shield the clock signal from glitches during frequency switching.
[0010] Optionally, the current regulating unit includes:
[0011] The reference branch adjusts the branch resistance to regulate the branch current based on the switching control signal, and also generates a reference voltage based on the branch resistance and the branch current.
[0012] The current supply branch generates the oscillating current based on the branch current and provides it to the clock selection unit to generate the oscillating voltage;
[0013] The clamping section clamps the reference voltage and the oscillation voltage to make them equal.
[0014] Optionally, the reference branch includes a first current transistor and a resistor adjustment section, wherein the control terminal of the first current transistor is connected to a bias voltage, the first end of the first current transistor is connected to a reference ground through the resistor adjustment section, the second end of the first current transistor is connected to a power supply voltage, and the resistor adjustment section performs resistor short-circuit control based on the switching control signal to adjust the branch resistance.
[0015] Optionally, the resistor adjustment section includes a first resistor, a second resistor, and a control switch, wherein a first end of the first resistor is connected to a first end of the first current tube, a second end of the first resistor is connected to a reference ground via the second resistor, and the control switch is connected in parallel across the two ends of the second resistor and is controlled by the switching control signal.
[0016] Optionally, the current supply branch includes a second current tube, wherein the control terminal of the second current tube is connected to the control terminal of the first current tube, the first terminal of the second current tube outputs the oscillating current, and the second terminal of the second current tube is connected to the power supply voltage; wherein the size ratio of the first current tube and the second current tube is 1:m, and m is a natural number greater than 1.
[0017] Optionally, the clamping portion includes an operational amplifier, wherein a first input terminal of the operational amplifier receives the reference voltage, a second input terminal of the operational amplifier receives the oscillation voltage, and an output terminal of the operational amplifier outputs the bias voltage.
[0018] Optionally, the clock selection unit further includes a selection switch, which provides the oscillation current to the first clock source or the second clock source based on the switching control signal, so that the first clock source outputs a clock signal of a first frequency or the second clock source outputs a clock signal of a second frequency, wherein the first frequency is greater than the second frequency.
[0019] Optionally, at least one of the first clock source and the second clock source is implemented using a ring oscillator; wherein, when the first clock source is implemented using a ring oscillator, it includes an odd number of first inverters connected end to end, and each first inverter is controlled to start operating by the oscillation current; when the second clock source is implemented using a ring oscillator, it includes an odd number of second inverters connected end to end, and each second inverter is controlled to start operating by the oscillation current.
[0020] Optionally, when the first clock source is implemented using a ring oscillator, it further includes at least one first capacitor connected between the output terminal of the corresponding first inverter and the reference ground; when the second clock source is implemented using a ring oscillator, it further includes at least one second capacitor connected between the output terminal of the corresponding second inverter and the reference ground.
[0021] Optionally, the burr shielding module includes:
[0022] The first synchronization unit synchronizes the frequency switching signal with the clock signal on the falling edge and outputs the switching control signal and its inverted signal.
[0023] A pulse generation unit is used to generate a first pulse and a second pulse corresponding to the rising and falling edges of the inverted signal of the switching control signal to output a pulse signal.
[0024] The second synchronization unit synchronizes the pulse signal with the clock signal on the falling edge and outputs an intermediate signal.
[0025] The logic processing unit generates a glitch shielding signal based on the pulse signal and the intermediate signal to shield the clock signal from glitches.
[0026] Optionally, both the first synchronization unit and the second synchronization unit are implemented using falling edge triggers.
[0027] Optionally, the pulse generation unit includes:
[0028] The rising edge portion is used to generate the first pulse at the rising edge of the inverted signal of the switching control signal;
[0029] The falling edge portion is used to generate the second pulse at the falling edge of the inverted signal of the switching control signal;
[0030] The pulse output section outputs the pulse signal by performing logical operations on the first pulse and the second pulse.
[0031] Optionally, the rising edge portion includes a third inverter, a fourth inverter, a third capacitor, and a NAND gate. The input terminal of the third inverter is connected to the first input terminal of the NAND gate and receives the inverted signal of the switching control signal. The output terminal of the third inverter is connected to reference ground through the third capacitor. The output terminal of the third inverter is also connected to the second input terminal of the NAND gate. The output terminal of the NAND gate is connected to the input terminal of the fourth inverter. The output terminal of the fourth inverter outputs the first pulse.
[0032] Optionally, the falling edge portion includes a fifth inverter, a fourth capacitor, and a first NOR gate, wherein the input terminal of the fifth inverter is connected to the first input terminal of the first NOR gate and receives the inverted signal of the switching control signal, the output terminal of the fifth inverter is connected to reference ground through the fourth capacitor, the output terminal of the fifth inverter is also connected to the second input terminal of the first NOR gate, and the output terminal of the first NOR gate outputs the second pulse.
[0033] Optionally, the pulse output section includes a second NOR gate, wherein the two inputs of the second NOR gate receive the first pulse and the second pulse respectively, and the output of the second NOR gate outputs the pulse signal.
[0034] Optionally, the logic processing unit includes a first AND gate and a second AND gate, wherein the first input terminal of the first AND gate receives the pulse signal, the second input terminal of the first AND gate receives the intermediate signal, the output terminal of the first AND gate is connected to the first input terminal of the second AND gate to provide the glitch shielding signal, the second input terminal of the second AND gate receives the clock signal, and the output terminal of the second AND gate serves as the output terminal of the frequency switching circuit.
[0035] Optionally, the glitch shielding module further includes: a signal selection unit, which outputs the clock signal corresponding to the selected clock source to the first synchronization unit, the second synchronization unit, and the logic processing unit.
[0036] The present invention also provides a frequency switching method, implemented based on the frequency switching circuit described in any one of the above claims, comprising:
[0037] The oscillation current is adjusted by regulating the branch current through adjusting the branch resistance.
[0038] The first clock source or the second clock source is selected as the selected clock source based on the switching control signal. The selected clock source starts working based on the oscillation current and outputs a clock signal of the corresponding frequency.
[0039] During frequency switching, the clock signal is glitched.
[0040] The present invention also provides a chip comprising the frequency switching circuit described in any one of the above claims.
[0041] The present invention also provides a terminal, including the chip described above.
[0042] As described above, the frequency switching circuit, method, chip, and terminal of this invention propose a novel frequency switching scheme. When switching to a lower clock frequency, the branch current is reduced by increasing the branch resistance, thereby reducing the oscillation current and allowing the selected clock source to consume less static current. When switching to a higher clock frequency, the branch current is increased by decreasing the branch resistance, thereby increasing the oscillation current and allowing the selected clock source to consume more static current. In other words, low frequency results in low current, and high frequency results in high current, thus achieving dynamic adjustment of the static current as the output frequency changes, saving circuit static power consumption at lower output frequencies. This invention has a simple system architecture and not only achieves glitches-free switching between different frequencies but also realizes dynamic adjustment of circuit static power consumption. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the frequency switching circuit in an embodiment of the present invention.
[0044] Figure 2 This is a schematic diagram of the clock switching module in an embodiment of the present invention.
[0045] Figure 3 This is a schematic diagram of the clock selection unit in an embodiment of the present invention.
[0046] Figure 4 This is a schematic diagram of the burr shielding module in an embodiment of the present invention.
[0047] Figure 5 This is a schematic diagram of the structure of the first synchronization unit in an embodiment of the present invention.
[0048] Figure 6 This is a schematic diagram of a pulse generation unit in an embodiment of the present invention.
[0049] Figure 7 for Figure 6 The waveform diagram of the key node in the pulse generation unit is shown.
[0050] Figure 8 This is a schematic diagram of another structure of the pulse generation unit in an embodiment of the present invention.
[0051] Figure 9 This is a schematic diagram of the structure of the second synchronization unit in an embodiment of the present invention.
[0052] Figure 10 for Figure 4 The waveform diagram of the key node in the burr shielding module is shown.
[0053] Component designation explanation:
[0054] 10-Frequency switching circuit, 100-Clock switching module, 110-Current adjustment unit, 111-Reference branch, 1111-Resistance adjustment section, 1111a-Control switch, 112-Current supply branch, 113-Clamping section, 120-Current selection unit, 121-First clock source, 122-Second clock source, 123-Selection switch, 1231-First transmission gate, 1232-Second transmission gate, 200-Glitch shielding module, 210-Signal selection unit, 211-Multiple choice, 212-First buffer, 213-Second buffer, 220-First synchronization unit, 230-Pulse generation unit, 231-Rising edge section, 232-Falling edge section, 233-Pulse output section, 234-Edge detection section, 235-First timer, 236-Second timer, 240-Second synchronization unit, 250-Logic processing unit. Detailed Implementation
[0055] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention.
[0056] Please see Figures 1 to 10 It should be noted that the illustrations provided in this embodiment are only schematic representations of the basic concept of the present invention. Therefore, the illustrations only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the shape, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0057] like Figure 1 As shown, this embodiment provides a frequency switching circuit 10, including a clock switching module 100 and a glitch shielding module 200.
[0058] The clock switching module 100 selects either a first-frequency clock signal CLKO1 or a second-frequency clock signal CLKO2 for output based on the switching control signal A. Of course, it is also feasible to select one output from more (three or more) different frequency clock signals, and this should not be a limitation. For example, Figure 2 As shown, the clock switching module 100 includes a current regulation unit 110 and a clock selection unit 120.
[0059] The current adjustment unit 110 adjusts the branch current by adjusting the branch resistance, and accordingly provides an oscillation current to the clock selection unit 120. In one embodiment, such as Figure 2 As shown, the current regulation unit 110 includes a reference branch 111, a current supply branch 112, and a clamping section 113.
[0060] Reference branch 111 adjusts the branch resistance to regulate the branch current based on the switching control signal A, and also generates a reference voltage VRES based on the branch resistance and branch current. Specifically, as shown... Figure 2 As shown, the reference branch 111 includes a first current tube PM1 and a resistance adjustment section 1111.
[0061] The control terminal of the first current transistor PM1 is connected to the bias voltage. The first terminal of the first current transistor PM1 is connected to the reference ground through the resistor adjustment section 1111. The second terminal of the first current transistor PM1 is connected to the power supply voltage VDD. Optionally, the first current transistor PM1 is a PMOS transistor (i.e., a P-type metal-oxide-semiconductor field-effect transistor). Correspondingly, the control terminal is the gate terminal, the first terminal is the drain terminal, and the second terminal is the source terminal.
[0062] The resistor adjustment section 1111 adjusts the branch resistance by performing resistor short-circuit control based on the switching control signal A. More specifically, such as... Figure 2 As shown, the resistance adjustment section 1111 includes a first resistor R1, a second resistor R2, and a control switch 1111a; wherein, the first end of the first resistor R1 is connected to the first end of the first current tube PM1, the second end of the first resistor R1 is connected to the reference ground through the second resistor R2, and the control switch 1111a is connected in parallel across the two ends of the second resistor R2 and is controlled by the switching control signal A, so as to short-circuit control the second resistor R2 based on the switching control signal A, thereby adjusting the branch resistance.
[0063] In a specific example, the control switch 1111a is implemented using a switching transistor NM1, wherein the control terminal of the switching transistor NM1 is connected to the switching control signal A, and the first terminal and the second terminal of the switching transistor NM1 are respectively connected to the two ends of the second resistor R2; optionally, the switching transistor NM1 is an NMOS transistor (i.e., an N-type metal-oxide-semiconductor field-effect transistor), and correspondingly, the control terminal is the gate terminal, the first terminal is the drain terminal, and the second terminal is the source terminal.
[0064] The current supply branch 112 generates an oscillating current based on the branch current and provides it to the clock selection unit 120 to generate an oscillating voltage VOSC. Specifically, as shown... Figure 2 As shown, the current supply branch 112 includes a second current tube PM2.
[0065] The control terminal of the second current transistor PM2 is connected to the control terminal of the first current transistor PM1. The first terminal of the second current transistor PM2 outputs an oscillating current, and the second terminal of the second current transistor PM2 is connected to the power supply voltage VDD. Optionally, the second current transistor PM2 is a PMOS transistor, with the corresponding control terminal being the gate terminal, the first terminal being the drain terminal, and the second terminal being the source terminal.
[0066] In this structure, the first current transistor PM1 and the second current transistor PM2 form a current mirror structure, and the size ratio (e.g., width-to-length ratio) of the first current transistor PM1 and the second current transistor PM2 is 1:m, where m is a natural number greater than 1; the branch current flowing through the first current transistor PM1 is denoted as I1, and the oscillating current flowing through the second current transistor PM2 is denoted as I2. Ignoring the channel modulation effect, we have I1:I2=1:m.
[0067] In addition, the oscillation current output by the second current transistor PM2 is provided to the clock selection unit 120 to generate the oscillation voltage VOSC; in practical applications, such as Figure 2 As shown, in order to obtain a stable oscillation voltage VOSC, a voltage stabilizing capacitor C0 is added to the current supply branch 112 and connected between the first terminal of the second current tube PM2 and the reference ground to achieve the purpose of stabilizing the voltage.
[0068] The clamping section 113 clamps the reference voltage VRES and the oscillation voltage VOSC to make them equal. Specifically, as shown... Figure 2 As shown, the clamping section 113 includes an operational amplifier OP.
[0069] The first input terminal of the operational amplifier (OP) (e.g., the inverting input terminal) receives the reference voltage VRES, and the second input terminal (e.g., the inverting input terminal) receives the oscillation voltage VOSC. The output terminal of the OP is connected to the control terminals of the first current transistor PM1 and the second current transistor PM2 to output a bias voltage. Voltage clamping by the OP ensures that the reference voltage VRES and the oscillation voltage VOSC are equal, which is beneficial for frequency design. In practical applications, the operational amplifier (OP) can be implemented using any architecture, as long as sufficient gain and overall circuit loop stability are guaranteed.
[0070] The clock selection unit 120 selects one clock source 121 and the second clock source 122 based on the switching control signal A, and the selected clock source starts operating based on the oscillation current and outputs a clock signal of the corresponding frequency. In one embodiment, such as Figure 2 As shown, the clock selection unit 120 includes a first clock source 121, a second clock source 122, and a selection switch 123.
[0071] The first clock source 121 starts operating based on the corresponding oscillation current and outputs a clock signal CLKO1 at the first frequency. Specifically, as follows... Figure 3 As shown, the first clock source 121 is implemented using a ring oscillator. Of course, other clock source structures that can achieve the relevant functions are also feasible and should not be limited to this.
[0072] The ring oscillator includes an odd number of first inverters connected end to end, and each first inverter is controlled to start working by the corresponding oscillation current and outputs a clock signal CLKO1 of the first frequency. Figure 3 The diagram shows a ring oscillator comprising three first inverters INV11-INV13. Of course, designing five or more first inverters is feasible depending on practical needs, and there is no limitation on this. Furthermore, the ring oscillator also includes at least one first capacitor connected between the output terminal of the corresponding first inverter and the reference ground. In practical applications, typically one first capacitor is connected to the output terminal of each first inverter, such as... Figure 3 As shown, it includes three first capacitors C11-C13.
[0073] The second clock source 122 starts operating based on the corresponding oscillation current and outputs a clock signal CLKO2 at a second frequency, where the second frequency is less than the first frequency. Specifically, as shown... Figure 3 As shown, the second clock source 122 is implemented using a ring oscillator. Of course, other clock source structures that can achieve the relevant functions are also feasible and should not be limited to this.
[0074] The ring oscillator includes an odd number of second inverters connected end to end, and each second inverter is controlled to start working at the corresponding oscillation current and outputs a clock signal CLKO2 at a second frequency. Figure 3 The diagram shows a ring oscillator comprising three second inverters INV21-INV23. Of course, designing five or more second inverters is feasible depending on practical needs, and there is no limitation on this. Furthermore, the ring oscillator also includes at least one second capacitor connected between the output of the corresponding second inverter and the reference ground. In practical applications, typically one second capacitor is connected to the output of each second inverter, such as... Figure 3 As shown, it includes three second capacitors C21-C23.
[0075] It should be noted that, although Figure 3Both the first clock source 121 and the second clock source 122 include three inverters. However, the transistors constituting the corresponding inverters in the first clock source 121 and the second clock source 122 have different sizes. For example, the transistor size corresponding to the first inverter is larger than the transistor size corresponding to the second inverter, so that the first frequency is greater than the second frequency. Of course, transistors of the same size can also be selected. In this case, it is necessary to adjust the number of the first inverters and the second inverters. For example, the number of first inverters in the first clock source 121 is greater than the number of second inverters in the second clock source 122, so that the first frequency is greater than the second frequency. In practical applications, any scheme that can achieve a first frequency greater than the second frequency is applicable to this embodiment, and there is no limitation on this.
[0076] Selector switch 123, based on switching control signal A, provides oscillating current to either the first clock source 121 or the second clock source 122 to select either clock source 121 or the second clock source 122 as the selected clock source; for example, when switching control signal A is high, oscillating current is provided to the first clock source 121 to select it as the selected clock source, and when switching control signal A is low, oscillating current is provided to the second clock source 122 to select it as the selected clock source. Specifically, as... Figure 3 As shown, the selection switch 123 includes a first transmission gate 1231 and a second transmission gate 1232.
[0077] The first transmission gate 1231 is connected between the current supply unit 112 and the first clock source 121. It is turned on when the switching control signal A is high and turned off when the switching control signal A is low. More specifically, as Figure 3 As shown, the first transmission gate 1231 includes a first transmission transistor NM2 and a second transmission transistor PM3. The control terminal of the first transmission transistor NM2 is connected to a switching control signal A, and the control terminal of the second transmission transistor PM3 is connected to the inverted signal AN of the switching control signal. The first terminal of the first transmission transistor NM2 and the second terminal of the second transmission transistor PM3 are connected to receive the oscillation current, and the second terminal of the first transmission transistor NM2 and the first terminal of the second transmission transistor PM3 are connected to output the oscillation current. Optionally, the first transmission transistor NM2 is an NMOS transistor and the second transmission transistor PM3 is a PMOS transistor. Correspondingly, the control terminal is the gate terminal, the first terminal is the drain terminal, and the second terminal is the source terminal.
[0078] The second transmission gate 1232 is connected between the current supply unit 112 and the second clock source 122. It is turned off when the switching control signal A is high and turned on when the switching control signal A is low. More specifically, as shown... Figure 3As shown, the second transmission gate 1232 includes a third transmission transistor NM3 and a fourth transmission transistor PM4. The control terminal of the third transmission transistor NM3 is connected to the inverted signal AN of the switching control signal, and the control terminal of the fourth transmission transistor PM4 is connected to the switching control signal A. The first terminal of the third transmission transistor NM3 and the second terminal of the fourth transmission transistor PM4 are connected to receive the oscillation current, and the second terminal of the third transmission transistor NM3 and the first terminal of the fourth transmission transistor PM4 are connected to output the oscillation current. Optionally, the third transmission transistor NM3 is an NMOS transistor and the fourth transmission transistor PM4 is a PMOS transistor. Correspondingly, the control terminal is the gate terminal, the first terminal is the drain terminal, and the second terminal is the source terminal.
[0079] The glitch shielding module 200 is used to shield the clock signal from glitches during frequency switching; wherein, for example... Figure 4 As shown, the burr shielding module 200 includes a first synchronization unit 220, a pulse generation unit 230, a second synchronization unit 240, and a logic processing unit 250. Furthermore, it also includes a signal selection unit 210.
[0080] The signal selection unit 210 outputs the clock signal corresponding to the selected clock source to the first synchronization unit 220, the second synchronization unit 240, and the logic processing unit 250; wherein, in order to distinguish it from the first frequency clock signal CLKO1 and the second frequency clock signal CLKO2, the clock signal corresponding to the selected clock source is denoted as the selected clock signal CLKO_PRE.
[0081] Specifically, such as Figure 4 As shown, the signal selection unit 210 is implemented using a multiplexer 211. The first input of the multiplexer 211 is connected to the output of the first clock source 121, and the second input is connected to the output of the second clock source 122. The control terminal of the multiplexer 211 is connected to a switching control signal A. When the switching control signal A is high, the first input and output of the multiplexer 211 are connected, and the clock signal CLKO1 of the first frequency is output as the selected clock signal CLKO_PRE. When the switching control signal A is low, the second input and output of the multiplexer 211 are connected, and the clock signal CLKO2 of the second frequency is output as the selected clock signal CLKO_PRE.
[0082] Furthermore, the signal selection unit 210 also includes a first buffer 212 and a second buffer 213, wherein the first buffer 212 is connected between the output of the first clock source 121 and the first input of the multiplexer 211, and the second buffer 213 is connected between the output of the second clock source 122 and the second input of the multiplexer 211 for signal buffering.
[0083] The first synchronization unit 220 synchronizes the frequency switching signal FS with the selected clock signal CLKO_PRE on the falling edge and outputs the switching control signal and its inverted signal.
[0084] Specifically, such as Figure 5 As shown, the first synchronization unit 220 is implemented using a falling edge flip-flop; wherein, the data terminal (such as the D terminal) of the falling edge flip-flop is connected to the frequency switching signal FS, the clock terminal (such as the Clk terminal) of the falling edge flip-flop is connected to the selected clock signal CLKO_PRE, the non-inverting output terminal (such as the Q terminal) of the falling edge flip-flop outputs the switching control signal A, and the inverting output terminal (such as the QN terminal) of the falling edge flip-flop outputs the inverted signal AN of the switching control signal.
[0085] When switching from the first frequency to the second frequency, i.e., from a high-frequency clock to a low-frequency clock, the frequency switching signal FS flips from high to low. After falling-edge synchronization, the switching control signal A becomes low, and its inverted counterpart AN becomes high. Similarly, when switching from the second frequency to the first frequency, i.e., from a low-frequency clock to a high-frequency clock, the frequency switching signal FS flips from low to high. After falling-edge synchronization, the switching control signal A becomes high, and its inverted counterpart AN becomes low. (See also...) Figure 10 .
[0086] The pulse generation unit 230 is used to generate a first pulse and a second pulse corresponding to the rising and falling edges of the inverted signal AN of the switching control signal to output a pulse signal B. In one embodiment, such as Figure 6 As shown, the pulse generation unit 230 includes a rising edge portion 231, a falling edge portion 232, and a pulse output portion 233.
[0087] The rising edge portion 231 is used to generate a first pulse F at the rising edge of the inverted signal AN of the switching control signal. Specifically, as shown... Figure 6 As shown, the rising edge portion 231 includes a third inverter INV3, a fourth inverter INV4, a third capacitor C3, and a NAND gate. The input of the third inverter INV3 is connected to the first input of the NAND gate and receives the inverted signal AN of the switching control signal. The output of the third inverter INV3 is connected to reference ground via the third capacitor C3. The output of the third inverter INV3 is also connected to the second input of the NAND gate. The output of the NAND gate is connected to the input of the fourth inverter INV4. The output of the fourth inverter INV4 outputs a first pulse F. The pulse width of the first pulse F is determined by the size of the third capacitor C3, and the size of the capacitor should be designed according to actual needs and is not limited thereto.
[0088] The falling edge portion 232 is used to generate a second pulse H at the falling edge of the inverted signal AN of the switching control signal. Specifically, as shown... Figure 6 As shown, the falling edge portion 232 includes a fifth inverter INV5, a fourth capacitor C4, and a first NOR gate NOR1. The input of the fifth inverter INV5 is connected to the first input of the first NOR gate NOR1 and receives the inverted signal AN of the switching control signal. The output of the fifth inverter INV5 is connected to reference ground via the fourth capacitor C4. The output of the fifth inverter INV5 is also connected to the second input of the first NOR gate NOR1. The output of the first NOR gate NOR1 outputs a second pulse H. The pulse width of the second pulse H is determined by the size of the fourth capacitor C4, and the size of the capacitor should be designed according to actual needs and is not limited thereto.
[0089] The pulse output section 233 processes the first pulse F and the second pulse H through logical operations to output a pulse signal B. Specifically, as shown... Figure 6 As shown, the pulse output section 233 includes a second NOR gate NOR2, wherein the two input terminals of the second NOR gate NOR2 receive a first pulse F and a second pulse H respectively, and the output terminal of the second NOR gate NOR2 outputs a pulse signal B. Further, as... Figure 6 As shown, the pulse output section 233 also includes a sixth inverter INV6 and a seventh inverter INV7, which are connected in series to the output of the second NOR gate NOR2 to facilitate signal shaping of the pulse signal B.
[0090] Let the signal at the third capacitor C3 be denoted as signal E, and the signal at the fourth capacitor C4 be denoted as signal G. Then:
[0091] When the rising edge of the inverted switching control signal AN arrives, signals E and G need to toggle from high to low. Due to the presence of the third capacitor C3 and the fourth capacitor C4, signals E and G exhibit a delayed and buffered transition to low, as shown below. Figure 7 As shown in the first half, the inverted signals AN and E of the switching control signal are subjected to AND-NOT logic operation and then inverted again to obtain a narrow pulse at the rising edge, i.e., the first pulse F; at the same time, the inverted signals AN and G of the switching control signal are subjected to OR-NOT logic operation and remain at a low level, with no second pulse H output.
[0092] When the falling edge of the inverted switching control signal AN arrives, signals E and G need to toggle from low to high. Due to the presence of the third capacitor C3 and the fourth capacitor C4, signals E and G exhibit a delayed and buffered rise to high level, as shown below. Figure 7As shown in the latter half, the inverted switching control signal AN and signal G are subjected to a OR NOT logic operation to obtain a narrow pulse at the falling edge, i.e., the second pulse H; at the same time, the inverted switching control signal AN and signal E are subjected to an AND NOT logic operation and then inverted again to always be at a low level, and there is no first pulse F output.
[0093] Finally, after performing a OR-NOT operation on the first pulse F and the second pulse H, and then undergoing two stages of inversion, the first pulse F and the second pulse H are combined together to form a complete pulse signal B, as shown below. Figure 7 As shown.
[0094] Of course, the pulse generation unit 230 can also generate the first pulse F and the second pulse H in other ways, such as using a timer to generate the first pulse F and the second pulse H. Specifically, for example... Figure 8 As shown, the pulse generation unit 230 includes an edge detection section 234, a first timer 235, a second timer 236, and a pulse output section 233. The edge detection section 234 detects the edge of the inverted signal AN of the switching control signal to output a corresponding trigger signal. For example, it outputs a first trigger signal when a rising edge is detected and a second trigger signal when a falling edge is detected. The first timer 235 is started by the first trigger signal and stops timing when the timing time reaches a first threshold, generating a first pulse F. The pulse width of the first pulse F is determined by the size of the first threshold, which should be designed according to actual needs and is not limited thereto. The second timer 236 is started by the second trigger signal and stops timing when the timing time reaches a second threshold, generating a second pulse H. The pulse width of the second pulse H is determined by the size of the second threshold, which should be designed according to actual needs and is not limited thereto. The pulse output section 233 performs logical processing on the first pulse F and the second pulse H to output a pulse signal B, as described above, and will not be repeated here. In practical applications, the first timer 235 and the second timer 236 can also be implemented by multiplexing the same timer. It should be noted that if a timer scheme is to be adopted, the system architecture must have a third clock signal so that the timer can operate based on the third clock signal.
[0095] The second synchronization unit 240 synchronizes the pulse signal B with the selected clock signal CLKO_PRE on the falling edge and outputs an intermediate signal C. Specifically, as shown... Figure 9 As shown, the second synchronization unit 240 is implemented using a falling edge flip-flop; wherein, the data terminal (such as the D terminal) of the falling edge flip-flop is connected to the pulse signal B, the clock terminal (such as the Clk terminal) of the falling edge flip-flop is connected to the selected clock signal CLKO_PRE, and the non-inverting output terminal (such as the Q terminal) of the falling edge flip-flop outputs the intermediate signal C.
[0096] The logic processing unit 250 generates a glitch shielding signal D based on the pulse signal B and the intermediate signal C to shield the clock signal CLKO_PRE from glitches.
[0097] Specifically, such as Figure 4 As shown, the logic processing unit 250 includes a first AND gate AND1 and a second AND gate AND2. The first input of the first AND gate AND1 receives a pulse signal B, the second input receives an intermediate signal C, and the output outputs a glitch shielding signal D. The glitch shielding signal D is formed by performing a logical AND operation on the pulse signal B and the intermediate signal C. The first input of the second AND gate AND2 receives the glitch shielding signal D, the second input receives the selected clock signal CLKO_PRE, and the output of the second AND gate AND2 serves as the output of the frequency switching circuit 10. Frequency glitch shielding of the selected clock signal CLKO_PRE is achieved by performing a logical AND operation on the glitch shielding signal D and the selected clock signal CLKO_PRE.
[0098] It should be noted that the logic devices involved in this embodiment, such as inverters, AND gates, NAND gates, NOR gates, etc., can be implemented using any circuit structure with relevant functions, and there are no restrictions on this.
[0099] Correspondingly, this embodiment also provides a frequency switching method, including the following steps, such as step S1 and step S2; wherein, the method of this embodiment is implemented using the frequency switching circuit 10 described above.
[0100] Step S1: Adjust the branch current by adjusting the branch resistance to adjust the oscillation current; select the first clock source 121 or the second clock source 122 as the selected clock source based on the switching control signal A, and the selected clock source starts working based on the oscillation current and outputs a clock signal of the corresponding frequency.
[0101] When switching to the first frequency (e.g., switching from the second frequency to the first frequency), that is, switching from a low-frequency clock to a high-frequency clock: the current adjustment unit 110 increases the branch current by reducing the branch resistance to increase the oscillation current, and the clock selection unit 120 selects the first clock source 121 as the selected clock source. At this time, the selected clock source starts to work based on the corresponding oscillation current and outputs the clock signal CLKO1 of the first frequency.
[0102] In this process, the frequency switching signal FS flips from low level to high level, the switching control signal A becomes high level, and the inverted signal AN of the switching control signal becomes low level.
[0103] In the current regulating unit 110, the control switch 1111a of the reference branch 111 is turned on, shorting the second resistor R2, which is equivalent to reducing the branch resistance. The branch resistance can be regarded as the first resistor R1. At this time, the branch current satisfies the formula The oscillating current satisfies the formula .
[0104] In the clock selection unit 120, the selection switch 123 provides the oscillation current to the first clock source 121, that is, selects the first clock source 121 as the selected clock source. At this time, the first clock source 121 outputs a clock signal CLKO1 at the first frequency.
[0105] In the current regulation unit 110, the operational amplifier OP clamps the reference voltage VRES and the oscillation voltage VOSC to be equal, satisfying the formula The first clock source 121 is equivalent to a capacitor Cring1, satisfying the formula. ;again, Then there is .
[0106] When switching to the second frequency (e.g., switching from the first frequency to the second frequency), that is, switching from a high-frequency clock to a low-frequency clock: the current adjustment unit 110 reduces the branch current by increasing the branch resistance to reduce the oscillation current, and the clock selection unit 120 selects the second clock source 122 as the selected clock source. At this time, the selected clock source starts to work based on the corresponding oscillation current and outputs the second frequency clock signal CLKO2.
[0107] In this process, the frequency switching signal FS flips from high level to low level, the switching control signal A becomes low level, and the inverted signal AN of the switching control signal becomes high level.
[0108] In the current regulating unit 110, the control switch 1111a of the reference branch 111 is open, and the second resistor R2 is connected to the reference branch 111, which is equivalent to increasing the branch resistance. The branch resistance can be regarded as the sum of the first resistor R1 and the second resistor R2. At this time, the branch current satisfies the formula The oscillating current satisfies the formula .
[0109] In the clock selection unit 120, the selection switch 123 provides the oscillation current to the second clock source 122, that is, selects the second clock source 122 as the selected clock source. At this time, the second clock source 122 outputs a clock signal CLKO2 at the second frequency.
[0110] In the current regulation unit 110, the operational amplifier OP clamps the reference voltage VRES and the oscillation voltage VOSC to be equal, satisfying the formula The second clock source 122 is equivalent to a capacitor Cring2, satisfying the formula. ;again, Then there is .
[0111] Where I1 is the branch current, I2 is the oscillation current, VRES is the reference voltage, VOSC is the oscillation voltage, R1 is the value of the first resistor, R2 is the value of the second resistor, Q1 is the energy value corresponding to the first clock source, T1 is the oscillation period of the first clock source, f1 is the oscillation frequency of the first clock source, i.e., the first frequency, Q2 is the energy value corresponding to the second clock source, T2 is the oscillation period of the second clock source, and f2 is the oscillation frequency of the second clock source, i.e., the second frequency.
[0112] Step S2: During the frequency switching process, the clock signal is glitched.
[0113] When switching to the first frequency, the switching control signal A is high, and the signal selection unit 210 selects the first clock source 121 for output, that is, the clock signal CLKO1 of the first frequency is used as the selected clock signal CLKO_PRE.
[0114] like Figure 7 and Figure 10 As shown in the latter half, the pulse generation unit 230 generates a second pulse H at the falling edge of the inverted signal AN of the switching control signal, and generates a pulse signal B accordingly; the second synchronization unit 240 synchronizes the pulse signal B with the selected clock signal CLKO_PRE on the falling edge and outputs an intermediate signal C; the logic processing unit 250 performs a logical AND operation on the pulse signal B and the intermediate signal C to generate a glitch shielding signal D, so as to shield the selected clock signal CLKO_PRE from glitches, thereby achieving no clock output during the frequency conversion process and outputting a stable clock after the frequency conversion is completed.
[0115] When switching to the second frequency, the switching control signal A is low, and the signal selection unit 210 selects the second clock source 122 for output, that is, the clock signal CLKO2 of the second frequency is used as the selected clock signal CLKO_PRE.
[0116] like Figure 7 and Figure 10As shown in the first half, the pulse generation unit 230 generates a first pulse F at the rising edge of the inverted signal AN of the switching control signal, and generates a pulse signal B accordingly; the second synchronization unit 240 synchronizes the pulse signal B with the selected clock signal CLKO_PRE on the falling edge and outputs an intermediate signal C; the logic processing unit 250 performs a logical AND operation on the pulse signal B and the intermediate signal C to generate a glitch shielding signal D, so as to shield the selected clock signal CLKO_PRE from glitches, thereby achieving no clock output during the frequency conversion process and outputting a stable clock after the frequency conversion is completed.
[0117] Correspondingly, this embodiment also provides a chip, including a frequency switching circuit 10; wherein the frequency switching circuit 10 is implemented using the circuit structure described above, and will not be repeated here.
[0118] Correspondingly, this embodiment also provides a terminal, including a chip (not shown in the figure); wherein the chip is implemented using the chip structure described above, and will not be repeated here.
[0119] In summary, the frequency switching circuit, method, chip, and terminal of this invention propose a novel frequency switching scheme. When switching to a lower clock frequency, the branch current is reduced by increasing the branch resistance, thereby reducing the oscillation current and allowing the selected clock source to consume less static current. Conversely, when switching to a higher clock frequency, the branch current is increased by decreasing the branch resistance, thereby increasing the oscillation current and allowing the selected clock source to consume more static current. In other words, low frequency results in low current, and high frequency results in high current, thus achieving dynamic adjustment of the static current as the output frequency changes, saving circuit static power consumption at lower output frequencies. This invention has a simple system architecture and not only achieves glitches-free switching between different frequencies but also realizes dynamic adjustment of circuit static power consumption. Therefore, this invention effectively overcomes the various shortcomings of existing technologies and has high industrial applicability.
[0120] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A frequency switching circuit, characterized in that, It includes a clock switching module and a glitch shielding module, wherein the clock switching module includes a current adjustment unit and a clock selection unit; The current regulation unit adjusts the branch current by adjusting the branch resistance, and accordingly provides oscillation current to the clock selection unit; The clock selection unit selects one from the first clock source and the second clock source based on the switching control signal, and the selected clock source starts working based on the oscillation current and outputs a clock signal of the corresponding frequency. The glitch shielding module is used to shield the clock signal from glitches during frequency switching.
2. The frequency switching circuit according to claim 1, characterized in that, The current regulation unit includes: The reference branch adjusts the branch resistance to regulate the branch current based on the switching control signal, and also generates a reference voltage based on the branch resistance and the branch current. The current supply branch generates the oscillating current based on the branch current and provides it to the clock selection unit to generate the oscillating voltage; The clamping section clamps the reference voltage and the oscillation voltage to make them equal.
3. The frequency switching circuit according to claim 2, characterized in that, The reference branch includes a first current transistor and a resistor adjustment section. The control terminal of the first current transistor is connected to a bias voltage, the first end of the first current transistor is connected to a reference ground through the resistor adjustment section, and the second end of the first current transistor is connected to a power supply voltage. The resistor adjustment section performs resistor short-circuit control based on the switching control signal to adjust the branch resistance.
4. The frequency switching circuit according to claim 3, characterized in that, The resistance adjustment section includes a first resistor, a second resistor, and a control switch. The first end of the first resistor is connected to the first end of the first current tube, the second end of the first resistor is connected to the reference ground through the second resistor, and the control switch is connected in parallel across the two ends of the second resistor and is controlled by the switching control signal.
5. The frequency switching circuit according to claim 3, characterized in that, The current supply branch includes a second current tube, wherein the control terminal of the second current tube is connected to the control terminal of the first current tube, the first terminal of the second current tube outputs the oscillating current, and the second terminal of the second current tube is connected to the power supply voltage; wherein the size ratio of the first current tube and the second current tube is 1:m, and m is a natural number greater than 1.
6. The frequency switching circuit according to claim 3, characterized in that, The clamping section includes an operational amplifier, wherein a first input terminal of the operational amplifier receives the reference voltage, a second input terminal of the operational amplifier receives the oscillation voltage, and an output terminal of the operational amplifier outputs the bias voltage.
7. The frequency switching circuit according to claim 1, characterized in that, The clock selection unit further includes a selection switch, which provides the oscillation current to the first clock source or the second clock source based on the switching control signal, so that the first clock source outputs a clock signal of a first frequency or the second clock source outputs a clock signal of a second frequency, wherein the first frequency is greater than the second frequency.
8. The frequency switching circuit according to claim 1 or 7, characterized in that, In the first clock source and the second clock source, at least one clock source is implemented using a ring oscillator; wherein, when the first clock source is implemented using a ring oscillator, it includes an odd number of first inverters connected end to end, and each first inverter is controlled to start operating by the oscillation current; when the second clock source is implemented using a ring oscillator, it includes an odd number of second inverters connected end to end, and each second inverter is controlled to start operating by the oscillation current.
9. The frequency switching circuit according to claim 8, characterized in that, When the first clock source is implemented using a ring oscillator, it further includes at least one first capacitor connected between the output terminal of the corresponding first inverter and the reference ground; when the second clock source is implemented using a ring oscillator, it further includes at least one second capacitor connected between the output terminal of the corresponding second inverter and the reference ground.
10. The frequency switching circuit according to claim 1, characterized in that, The burr shielding module includes: The first synchronization unit synchronizes the frequency switching signal with the clock signal on the falling edge and outputs the switching control signal and its inverted signal. A pulse generation unit is used to generate a first pulse and a second pulse corresponding to the rising and falling edges of the inverted signal of the switching control signal to output a pulse signal. The second synchronization unit synchronizes the pulse signal with the clock signal on the falling edge and outputs an intermediate signal. The logic processing unit generates a glitch shielding signal based on the pulse signal and the intermediate signal to shield the clock signal from glitches.
11. The frequency switching circuit according to claim 10, characterized in that, Both the first synchronization unit and the second synchronization unit are implemented using falling edge triggers.
12. The frequency switching circuit according to claim 10, characterized in that, The pulse generation unit includes: The rising edge portion is used to generate the first pulse at the rising edge of the inverted signal of the switching control signal; The falling edge portion is used to generate the second pulse at the falling edge of the inverted signal of the switching control signal; The pulse output section outputs the pulse signal by performing logical operations on the first pulse and the second pulse.
13. The frequency switching circuit according to claim 12, characterized in that, The rising edge portion includes a third inverter, a fourth inverter, a third capacitor, and a NAND gate. The input terminal of the third inverter is connected to the first input terminal of the NAND gate and receives the inverted signal of the switching control signal. The output terminal of the third inverter is connected to the reference ground through the third capacitor. The output terminal of the third inverter is also connected to the second input terminal of the NAND gate. The output terminal of the NAND gate is connected to the input terminal of the fourth inverter. The output terminal of the fourth inverter outputs the first pulse.
14. The frequency switching circuit according to claim 12, characterized in that, The falling edge portion includes a fifth inverter, a fourth capacitor, and a first NOR gate. The input terminal of the fifth inverter is connected to the first input terminal of the first NOR gate and receives the inverted signal of the switching control signal. The output terminal of the fifth inverter is connected to the reference ground through the fourth capacitor. The output terminal of the fifth inverter is also connected to the second input terminal of the first NOR gate. The output terminal of the first NOR gate outputs the second pulse.
15. The frequency switching circuit according to claim 12, characterized in that, The pulse output section includes a second NOR gate, wherein the two input terminals of the second NOR gate receive the first pulse and the second pulse respectively, and the output terminal of the second NOR gate outputs the pulse signal.
16. The frequency switching circuit according to claim 10, characterized in that, The logic processing unit includes a first AND gate and a second AND gate, wherein the first input terminal of the first AND gate receives the pulse signal, the second input terminal of the first AND gate receives the intermediate signal, the output terminal of the first AND gate is connected to the first input terminal of the second AND gate to provide the glitch shielding signal, the second input terminal of the second AND gate receives the clock signal, and the output terminal of the second AND gate serves as the output terminal of the frequency switching circuit.
17. The frequency switching circuit according to any one of claims 10-16, characterized in that, The glitch shielding module further includes a signal selection unit, which outputs the clock signal corresponding to the selected clock source to the first synchronization unit, the second synchronization unit, and the logic processing unit.
18. A frequency switching method, characterized in that, Based on the frequency switching circuit according to any one of claims 1-17, including: The oscillation current is adjusted by regulating the branch current through adjusting the branch resistance. The first clock source or the second clock source is selected as the selected clock source based on the switching control signal. The selected clock source starts working based on the oscillation current and outputs a clock signal of the corresponding frequency. During frequency switching, the clock signal is glitched.
19. A chip, characterized in that, Includes the frequency switching circuit as described in any one of claims 1-17.
20. A terminal, characterized in that, Includes the chip described in claim 19.
