Clock Selector Circuit
By using a phase difference detector and switching circuit system in the clock selector circuit to detect and switch the clock signals generated by the crystal oscillator and the RC oscillator, the problem of frequency shift when the clock signal is switched is solved, achieving seamless switching and Frequency is stable.
Patent Information
- Application Number
- CN202080094501.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-16
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-12-16
AI Technical Summary
It is difficult with existing technology to seamlessly switch clock signals generated using different oscillators without causing a frequency shift of the clock signal, especially between a crystal oscillator and an RC oscillator, causing the output clock signal to potentially contain switching artifacts. Frequency shifted and difficult to debug.
A clock selector circuit is designed that detects the phase difference between two input clock signals through a phase difference detector and switches the output clock signal when a phase crossover is detected, using the switching circuit system to be spaced in time from the clock edge , reduce switching interference and ensure the frequency stability of the output clock signal.
It achieves seamless switching of different clock signals without affecting the frequency of the output clock signal, avoids frequency shift, ensures the continuous use of clock signals, reduces the risk of shutdown of the processor or circuit system, and reduces power consumption. and complexity.
Smart Images

Figure CN115023681B_ABST
Abstract
Description
Background Art
[0001] The invention relates to a clock selector circuit.
[0002] Clock signals are used to coordinate the operation of electronic circuits, particularly integrated circuits. Typically, a periodic signal is generated by a quartz crystal oscillator and distributed to clocked circuit components, such as D-type flip-flops, via one or more clock lines within the electronic circuit. The periodic signal can be used directly as a clock signal, or the electronic circuit can derive a clock signal from the periodic signal, for example, using a clock multiplier or divider circuit. Clock signals are typically single-phase square waves.
[0003] Quartz crystal oscillators are commonly used to generate high-frequency and high-accuracy clock signals. However, crystal oscillators consume considerable power. Resistor-capacitor (RC) oscillators can generate clock signals more efficiently than crystal oscillators. RC oscillators can also be easily integrated into the same chip as other circuit components. However, RC oscillators are generally not as accurate as crystal oscillators and are more susceptible to variations in temperature and supply voltage. Feedback and control mechanisms can mitigate this to some extent, but RC oscillators are still generally not as accurate as high-quality crystal oscillators.
[0004] Therefore, it may be advantageous to provide an electronic device, such as a battery-powered Internet of Things (IoT) sensor, with multiple clock sources, such as both a crystal oscillator and an RC oscillator. The device can then switch between clock sources as required when clocking the same circuitry. For example, a system-on-chip (SoC) device can be configured to use a highly accurate clock derived from a crystal oscillator when an on-chip analog-to-digital (ADC) peripheral requiring high clock purity is active, and to use a clock derived from a lower-power RC oscillator at other times, such as when the device is in a sleep state.
[0005] Clock signals derived from different oscillators may have the same nominal frequency, but they are typically not phase-aligned. Consequently, seamlessly switching an electronic circuit from using one clock signal to using a different clock signal is not straightforward, as the resulting output clock signal may contain switching artifacts, where at least one clock cycle is distorted, for example, shortened or lengthened. Such artifacts can cause the frequency of the output clock signal to shift outside the circuit's specified frequency range, leading to errors that can be intermittent or unpredictable and therefore difficult to debug.
[0006] The present invention provides a clock selector circuit for improving switching between clock signals. Summary of the Invention
[0007] According to a first aspect, the present invention provides a clock selector circuit, comprising:
[0008] a first input for receiving a first input clock signal having a first frequency;
[0009] a second input for receiving a second input clock signal having a second frequency, wherein the second frequency differs from the first frequency by a frequency offset;
[0010] A clock output, the clock output being used to output an output clock signal;
[0011] a phase difference detector; and
[0012] Switching circuit system,
[0013] wherein the phase difference detector is configured to detect when a phase difference over time between the first input clock signal and the second input clock signal, determined using a predetermined type of clock edge—a rising edge or a falling edge—crosses zero, and to signal such zero crossing to the switching circuit system, and wherein the switching circuit system is configured to detect an edge of a type opposite to the predetermined type in the first input clock signal or in the second input clock signal in response to receiving the zero crossing signal from the phase difference detector, and to switch the output clock signal between the first input clock signal and the second input clock signal in response to detecting the opposite type of edge.
[0014] From a second aspect, the present invention provides a clock switching method, which includes:
[0015] receiving a first input clock signal having a first frequency;
[0016] receiving a second input clock signal having a second frequency, wherein the second frequency differs from the first frequency by a frequency offset;
[0017] outputting one of the first input clock signal and the second input clock signal as an output clock signal;
[0018] detecting a zero crossing of a phase difference between the first input clock signal and the second input clock signal over time using a predetermined type of clock edge—a rising edge or a falling edge;
[0019] detecting an edge of a type opposite to the predetermined type in the first input clock signal or in the second input clock signal in response to detecting the phase difference crossing zero; and
[0020] Switching to outputting the other of the first input clock signal and the second input clock signal as the output clock signal is responsive to detecting the opposite type of edge.
[0021] Thus, it can be seen that, according to the present invention, the two input clock signals are set to be offset relative to each other by a certain frequency, at least before and after the switching time, so that there is a phase difference between the clock signals that varies over time (typically linear if the frequency offset is held constant). The clock selector circuit uses a phase difference detector to detect when the two clock signals are closely aligned in phase by determining when the rising edges (or, alternatively, falling edges) of the two input clock signals cross in time, such that the second clock signal begins to lead the first clock signal, previously lags the first clock signal, or vice versa. Upon detecting this phase crossing, the clock selector circuit switches the output from one input clock signal to the other, where the switch is triggered by the subsequent falling edge (or, alternatively, subsequent rising edge) of one of the clock signals. In this way, the actual switching operation can be spaced apart in time from the rising (or falling) edge to minimize the risk of the switch interfering with any rising (or falling) edge in the output clock signal. It should be noted that the phase difference crosses zero each time it wraps around modulo 2π; this can occur in either the positive or negative direction.
[0022] In this way, seamless switching between two input clock signals is possible, wherein the output clock signal does not contain any significantly shortened or lengthened clock cycles that might otherwise cause the frequency of the output clock signal to shift outside of tolerable limits. This allows a device to continuously use the output clock signal without having to shut down a processor or other circuitry using the output clock signal to mitigate the risk of lost or corrupted clock cycles.
[0023] The clock selector circuit achieves this without requiring a third input clock signal operating at a much higher frequency than the first and second input clock signals to coordinate the switching process (e.g., operating at hundreds of MHz if the first and second input clocks both have frequencies of approximately 16 MHz). Such a higher frequency third clock signal may not be available on many devices. Even if a higher frequency clock source is available, using that clock source to control the switching between two lower frequency clock signals may increase power consumption and complexity, and introduce additional design constraints. In contrast, embodiments of the clock selector circuit of the present invention can operate using only the timing provided by the first and second input clock signals themselves.
[0024] The first clock signal and the second clock signal preferably have similar frequencies. The frequency offset may be less than 10% of the first frequency or less than 1% of the first frequency or less than 0.5% of the first frequency. In this way, the output clock signal may have a constant nominal frequency within a predetermined tolerance (e.g., + / - 10% or 1% or 0.5%) regardless of which input clock signal is being output. In some embodiments, the frequencies of both the first clock signal and the second clock signal are within the range of 16 MHz + / - 10% or + / - 1% or + / - 0.5%. However, the frequency offset may be at least 0.01% or at least 0.1% of the first frequency to ensure that there is no excessive delay before the phases next cross; in this way, switching can be performed promptly after the clock selector circuit receives a command to switch between clock signals.
[0025] The frequency offset can be constant within a time window, which can span multiple cycles of the output clock signal. Switching of the output clock signal can occur during this time window. In some embodiments, the frequency offset can have a lower value before and / or after the time window in which switching occurs than during the time window. Outside the switching window, the frequency offset can be less than 0.1% or less than 0.01% of the first frequency, e.g., zero offset.
[0026] The first input clock signal and the second input clock signal may be square wave signals.
[0027] The first input clock signal may be generated using a crystal oscillator. The second input clock signal may be generated using a resistor-capacitor (RC) or inductor-capacitor (LC) oscillator. The second input clock signal may be generated using a controllable oscillator such as a voltage-controlled oscillator (VCO) or a digitally controlled oscillator (DCO).
[0028] The clock selector circuit may include an output for sending a control signal to a controllable oscillator. The controllable oscillator may be used to generate a second input clock signal. The clock selector circuit may include control logic for generating and / or sending the control signal to the controllable oscillator. The control logic may be configured to send a first control signal to the controllable oscillator to cause the second frequency to be equal to the first frequency during a first period, and to send a second control signal to the controllable oscillator to cause the second frequency to be offset from the first frequency by the frequency offset amount during a second period. The output clock signal may be constantly set to one of the first and second input clock signals during the first period, and may be switched to the other of the first and second input clock signals during the second period. The control logic may be further configured to, when switching from the first input clock signal to the second input clock signal, send a third control signal to the controllable oscillator to cause the second frequency to be equal to the first frequency again during a third period following the second period. Thus, the frequency of the output clock signal may be offset from the nominal frequency of the first input clock signal (which may be derived from a crystal oscillator) around the switching time in order for the phase alignment process to occur, but may be restored to the nominal frequency after the switching has been completed.
[0029] In some embodiments, the second input clock signal can be calibrated against the first input clock signal at regular intervals. This calibration can be performed by calibration logic, which can be part of the clock selector circuit or separate. The control logic can use calibration data determined by the calibration logic when determining to send a control signal to the controllable oscillator to shift the second frequency from the first frequency by the offset amount.
[0030] The phase difference detector may include an analog or digital phase detector. The phase difference detector may include one or more flip-flops. The phase difference detector may include or consist of a D-type flip-flop that can be clocked on a predetermined type of clock edge. The D-type flip-flop may receive one of the first input clock signal and the second input clock signal as a clock input. The D-type flip-flop may receive the other of the first input clock signal and the second input clock signal as a data input (D). In this way, the output (Q) of the D-type flip-flop may signal when the phase difference has passed zero by changing from high to low (or vice versa). This signal may be transmitted to the switching circuit system, for example, along a single-bit signal line.
[0031] The switching circuitry may include a multiplexer. The switching circuitry may include a digital controller for sending a select signal to the multiplexer. The switching circuitry may also include control logic for generating a control signal and sending the control signal to the controllable oscillator. The digital controller may send the select signal to the multiplexer in response to receiving a zero-crossing signal from the phase difference detector. The digital controller may send the select signal within less than one cycle of the output clock signal.
[0032] The switching circuitry (e.g., a digital controller) may include circuitry for detecting an edge of a type opposite to a predetermined type in the first input clock signal or in the second input clock signal. This circuitry may include one or more logic gates or flip-flops. The switching circuitry may be configured to detect a first (i.e., next) edge of the opposite type in the first input clock signal (or the second input clock signal) after the phase difference detector has detected a zero crossing. The switching circuitry may be configured to switch the output clock signal between the first input clock signal and the second input clock signal after detecting that the phase difference has crossed zero and before receiving the first (i.e., next) edge of the predetermined type in the first input clock signal and / or the second input clock signal. In this way, switching of the output clock signal can advantageously occur within one clock cycle of the detected phase crossing, i.e., while the phases of the first input clock signal and the second input clock signal are still closely aligned.
[0033] The switching circuitry can be configured to detect a later-arriving edge of the opposite type to the first edge of the opposite type received in the first input clock signal and the second input clock signal after the phase difference detector has detected the phase difference crossing zero. Thus, the two input clock signals will be in the same state (high or low) at the time of this detection, and thus switching at this time reduces the risk of introducing any glitches.
[0034] The clock selector circuit (e.g., control logic within the clock selector circuit) may include a control input for receiving a switching command, for example, from a processor. The clock selector circuit may perform the switching in response to receiving the switching command. The clock selector circuit may include control logic configured to send a control signal to the controllable oscillator in response to receiving the switching command to shift the second frequency from the first frequency by the frequency offset amount.
[0035] The clock selector circuit may be part of an electronic device. The clock selector circuit may be at least partially integrated on an integrated circuit chip, such as a silicon wafer. The clock selector circuit may be part of a system-on-chip device. In another aspect, the present invention provides an electronic device comprising a clock selector circuit. The electronic device may include one or more quartz crystals that may be used to generate a first input clock signal. The electronic device may include one or more RC or LC oscillators that may be configured to generate the first input clock signal and / or the second input clock signal.
[0036] The output clock signal can be connected to circuitry that is arranged to be clocked by the output clock signal. This can include processors, peripherals, etc. The circuitry can be arranged to be clocked using a predetermined type of clock edge. In some embodiments, the predetermined type of clock edge is a rising edge; switching will then occur on a falling edge of the input clock signal that is close to phase alignment, thereby reducing the risk of affecting the rising edge used to clock the connected circuitry.
[0037] As used herein, the terms "circuit" and "circuitry" may refer to either an open circuit or a closed circuit; that is, the terms encompass portions of a circuit that, when connected to other components, such as a power supply, can form part of a closed circuit.
[0038] Features of any aspect or embodiment described herein may be applied to any other aspect or embodiment described herein where appropriate.When referring to different embodiments or sets of embodiments, it should be understood that these embodiments are not necessarily different, but may overlap. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Certain preferred embodiments of the present invention will now be described, by way of example only, with reference to the accompanying drawings, in which:
[0040] Figure 1 is a schematic diagram showing the major components of a system-on-chip device embodying a clock selector circuit of the present invention; and
[0041] Figure 2 is a timing diagram of the signals within the clock selector circuit during a switching operation. DETAILED DESCRIPTION
[0042] Figure 1 There is shown a system on a chip (SoC) 1. This SoC may be, for example, an on-chip radio component included in a wireless device such as a temperature sensor, for controlling the operation of the sensor and exchanging sensor readings with a remote device over a radio link.
[0043] The SoC 1 will typically be connected to various off-chip components such as a power source (e.g., battery), interfaces, sensors, capacitors, resistors, inductors, etc. For simplicity, these are Figure 1 However, one off-chip component shown is a quartz crystal 2, which may have a nominal frequency of 32 MHz. Crystal 2 is connected to a crystal source circuit 3 within SoC 1, which uses the quartz crystal to generate a clock signal CLK1 suitable for timing one or more clock domains within the SoC. Crystal source circuit 3 can scale down clock signal CLK1 to, for example, 16 MHz.
[0044] The second clock signal CLK2 can be generated by a digitally controlled oscillator (DCO) 4 comprising a resistor-capacitor (RC) oscillator. The frequency of the signal output by DCO 4 can be controlled by a digital controller 5. Digital controller 5 includes hardwired logic that implements a finite state machine. In some embodiments, digital controller 5 may also include a processor for executing software instructions; in other embodiments, digital controller 5 is a peripheral device that can receive commands from a separate processor, such as via a register interface over a bus system. DCO 4 can be designed to output a frequency of approximately 16 MHz, but can be controlled by digital controller 5 to operate above and below this frequency.
[0045] The SoC may contain calibration circuitry (not shown) for calibrating the DCO 4 at regular intervals against the crystal source 3 or against a different crystal source (e.g., a 32 kHz crystal) to determine trim values for the DCO 4 that will cause the DCO 4 to output a signal CLK2 at the same frequency as the 16 MHz signal CLK1 output by the crystal source 3. However, when clock switching occurs, the frequency of the signal CLK2 will be intentionally offset from the frequency of the signal CLK1 output by the crystal source 3.
[0046] Digital controller 5 also has an output line for sending a clock select signal, CLK_SEL, to multiplexer 6. Together, digital controller 5 and multiplexer 6 embody the switching circuitry disclosed herein. Multiplexer 6 has a first input for receiving clock signal CLK1 from crystal source 3 and a second input for receiving clock signal CLK2 from DCO 4. Multiplexer 6 has an output for outputting a clock output signal, CLK_OUT, which is equal to one of the two input signals, CLK1 and CLK2. The input selected by multiplexer 6 depends on the state of the binary clock select signal, CLK_SEL, received by multiplexer 6 from digital controller 5. This output signal, CLK_OUT, can be routed to various components of SoC 1 as needed. It can be used to clock the processor and / or one or more peripherals, such as a radio's baseband processor, analog-to-digital converter (ADC), etc. Of course, SoC 1 may have other crystal or RC clock sources (not shown) for providing appropriate clock signals to other components of the chip.
[0047] The clock switching circuit also contains a rising-edge-triggered D-type flip-flop (DFF) 7 that acts as a phase detector. The DFF is clocked by the DCO 4 clock signal CLK2 and receives the crystal clock signal CLK1 as the data "D" input. The output "Q" is provided to the digital controller 5 as a binary signal "phase_lag", which changes state each time the phase difference between the two inputs passes through zero.
[0048] The digital controller 5, multiplexer 6 and DFF 7 together form a clock selector circuit. In use, the digital controller, multiplexer and DFF enable the CLK_OUT signal to seamlessly switch from the crystal clock CLK1 to the RC oscillator clock signal CLK2, and vice versa, so that the frequency of the output signal CLK_OUT remains within a specified tolerance of the nominal frequency (e.g., 16 MHz). The digital controller, multiplexer and DFF achieve this by ensuring that the actual switching point occurs at a precisely determined moment.
[0049] The digital controller 5 will typically be idle until software executing on the processor of the SoC 1 determines that a change in clock source is needed. The processor can then write a command to switch clocks to an input register of the digital controller 5. When the digital controller 5 receives a command to switch between clock sources (e.g., from software executing on the processor of the SoC 1), the digital controller first ensures that both clock sources 3, 4 are powered, and then sends a digital frequency control word to the DCO 4 that causes the frequency of the DCO 4 output signal CLK2 to deviate slightly from its calibrated value, in which it is substantially equal to the crystal signal CLK1, e.g., increasing the frequency of CLK2 from 16.00 MHz to about 16.03 MHz by about 0.2%.
[0050] Whenever both clocks 3 and 4 are active, DFF 7 will output a phase_lag signal that is high whenever the rising edge of DCO 4 output CKL2 occurs within the first half cycle of crystal signal CLK1 after the rising edge of CLK1, and low whenever the rising edge of DCO 4 output CKL2 occurs within the second half cycle of crystal signal CLK1 after the rising edge of CLK1. If CLK2 is set to a slightly higher frequency (i.e., a shorter period) than CLK1, the phase_lag signal will transition from high to low when the phase difference between CLK1 and CLK2 crosses zero or in the next CLK2 cycle after the phase difference between CLK1 and CLK2 crosses zero. (When the phase difference crosses π, it will change from low back to high, but such detection is not used.) Alternatively, if CLK2 is set to a slightly lower frequency than CLK1 (i.e., longer period), then the phase_lag signal will change from low to high whenever the phase difference between CLK1 and CLK2 crosses zero.
[0051] The phase_lag signal is received by the digital controller 5. Assuming that the controller 5 shifts the frequency of CLK2 to a higher frequency than CLK1, the controller 5 detects when the phase_lag signal goes low. The controller responds by waiting to detect the next falling edge in one or both of the CLK1 or CLK2 signals. The controller can implement this detection using a falling-edge-triggered D-type flip-flop. The controller can detect when both clock signals go low, or if CLK2 is consistently skewed to a higher frequency than CLK1, the falling edge of CLK2 should lead the falling edge of CLK1 in the next cycle after the phase difference crosses zero, and therefore the digital controller 5 can alternatively be configured to turn on the next falling edge of CLK1 after receiving the CLK_SEL signal. Upon detecting one or more falling edges, the controller 5 immediately (within half a clock cycle) switches the CLK_SEL line to the multiplexer 6, causing the multiplexer 6 to switch to outputting either CLK1 or CLK2. The digital controller 5 then returns to an idle state, in which it awaits further switching commands from the processor.
[0052] Figure 2 is a timing diagram that shows how, by skewing the frequency of CLK2 slightly higher than the frequency of CLK1, a phase slip effect occurs over time, which causes the rising edges of the two clock signals to move relative to each other. The rate of change of the phase difference is proportional to the amount of constant frequency offset that exists between the two signals CLK1, CLK2. Specifically, the rising edge of CLK2 occurs earlier (further to the left) in each successive CLK1 cycle, until eventually it changes from occurring shortly after each rising edge of the CLK1 signal to coinciding with or occurring shortly before the rising edge of CLK1. Figure 2 The time at which this condition is detected by DFF 7 is marked by dashed line 20. At this point, the phase_lag signal from the DFF's output Q will transition from high to low. This transition is clocked by the rising edge of the DCO signal CLK2 supplied to the clock input of DFF 7. Thus, DFF 7 detects, within a maximum of one CLK2 clock cycle, when the phase difference between the two clock signals CLK1 and CLK2 crosses zero—that is, when considering a phase difference in the range of -π to π (modulo 2π), when the phase difference transitions from positive to negative (or vice versa).
[0053] Figure 2The second line 21 in the CLK_SEL ...
[0054] Figure 2 Shown is the output signal CLK_OUT from the multiplexer 6. In this example, CLK_OUT is initially set to the DCO 4 signal CLK2 and switches to the crystal signal CLK1 on the first falling edge after the phase difference crosses zero.
[0055] When switching from the DCO signal CLK2 to the crystal signal CLK1, as in Figure 2 In the example of , the digital controller 5 can then optionally power down the DCO 4 if it is not needed, to reduce the overall power consumption of the SoC 1. However, power savings may not justify doing so, and in embodiments where this can be done, for example, it may be desirable to recalibrate the DCO 4 against the crystal 2 at regular intervals so that if a command to switch back to using the DCO 4 is received, the DCO 4 is ready to take over.
[0056] When switching from crystal signal CLK1 to DCO signal CLK2, digital controller 5 may power down crystal 2 and its associated circuitry 3, if nothing else is needed, to reduce overall power consumption of SoC 1. In addition, digital controller 5 may send an additional control word to DCO 4 after the switch to remove frequency skew and set DCO 4 to a calibrated nominal value.
[0057] Those skilled in the art will appreciate that the invention has been illustrated by describing one or more specific embodiments thereof and is not limited to these embodiments; many variations and modifications are possible within the scope of the appended claims.
[0058] Specifically, the clock switching circuit does not require that one of the clock signals be a crystal signal and the other clock signal be from an RC oscillator. The same principle can be used to switch between two clock signals generated from different RC oscillators or from any other clock source. Switching between two crystals may be less useful and may be difficult to implement in practice because such switching may not provide the appropriate frequency offset (skew).
[0059] A multiplexer may receive three or more clock signals as inputs. The multiplexer may be able to switch the output from any one input clock to any other input clock. In this case, phase detector logic may be able to detect the zero crossing of the phase difference between any pair of input clock signals and use this to trigger switching from one of the pair to the other.
[0060] In some embodiments, phase crossing detection can be performed on the falling edge of one of the clock signals (e.g., CLK2), with the multiplexer switching being timed by the next rising edge. This can be particularly useful if the output clock signal from the multiplexer is sent to the falling edge timing circuitry, as this can ensure that any switching noise from the multiplexer is kept away from the falling edge of the output clock signal. Alternatively, an inverter can be placed after the output of the multiplexer 6 to clock the falling edge timing circuitry.
Claims
1. A clock selector circuit, comprising: a first input for receiving a first input clock signal having a first frequency; a second input for receiving a second input clock signal having a second frequency, wherein the second frequency differs from the first frequency by a frequency offset; A clock output, the clock output being used to output an output clock signal; Phase difference detector; as well as Switching circuit system, wherein the phase difference detector is configured to detect when a phase difference over time between the first input clock signal and the second input clock signal determined using a predetermined type of clock edge - a rising edge or a falling edge - crosses zero, and the phase difference detector is configured to send a zero-crossing signal to the switching circuit system in response to detecting that the phase difference crosses zero, and wherein the switching circuit system is configured to detect an edge of a type opposite to the predetermined type in the first input clock signal or in the second input clock signal in response to receiving the zero-crossing signal from the phase difference detector, and to switch the output clock signal between the first input clock signal and the second input clock signal in response to detecting the opposite type of edge.
2. The clock selector circuit of claim 1, wherein the frequency offset is less than 10% of the first frequency.
3. A clock selector circuit according to claim 1 or 2, wherein the frequency offset is constant within a time window spanning multiple cycles of the output clock signal, and wherein the switching of the output clock signal occurs during this time window.
4. A clock selector circuit according to claim 1 or 2, wherein the first input clock signal is generated using a crystal oscillator, and wherein the second input clock signal is generated using a resistor-capacitor (RC) or inductor-capacitor (LC) oscillator.
5. The clock selector circuit of claim 1 or 2, wherein the second input clock signal is generated using a controllable oscillator, and wherein the clock selector circuit comprises control logic for sending a control signal to the controllable oscillator.
6. The clock selector circuit of claim 5 , wherein the control logic is configured to send a first control signal to the controllable oscillator so that the second frequency is equal to the first frequency during a first period, and to send a second control signal to the controllable oscillator so that the second frequency is offset from the first frequency by the frequency offset amount during a second period.
7. The clock selector circuit of claim 6 , wherein the control logic is further configured to, when switching from the first input clock signal to the second input clock signal, send a third control signal to the controllable oscillator so that the second frequency is again equal to the first frequency during a third time period after the second time period.
8. The clock selector circuit of claim 5 , further comprising calibration logic for calibrating the second input clock signal against the first input clock signal at intervals, and wherein the control logic is configured to use calibration data determined by the calibration logic to determine a control signal to be sent to the controllable oscillator to shift the second frequency from the first frequency by the offset amount.
9. The clock selector circuit of claim 1 or 2, wherein the phase difference detector comprises a D-type flip-flop that is clocked on a clock edge of the predetermined type.
10. The clock selector circuit of claim 9, wherein the D-type flip-flop is arranged to receive one of the first input clock signal and the second input clock signal as a clock input and to receive the other of the first input clock signal and the second input clock signal as a data input.
11. A clock selector circuit according to claim 1 or 2, wherein the switching circuit system includes a multiplexer and a digital controller, wherein the digital controller is configured to send a selection signal to the multiplexer within less than one cycle of the output clock signal receiving the zero-crossing signal from the phase difference detector.
12. A clock selector circuit according to claim 1 or 2, wherein the switching circuit system is configured to detect the opposite type of first edge in the first input clock signal, or is configured to detect the opposite type of first edge in the second input clock signal, and the first input clock signal and the second input clock signal are received by the clock selector circuit after the phase difference detector has detected that the phase difference crosses zero.
13. A clock selector circuit according to claim 1 or 2, wherein the switching circuit system is configured to switch the output clock signal between the first input clock signal and the second input clock signal after the phase difference detector has detected that the phase difference has crossed zero and before the clock selector circuit receives the first edge of the predetermined type in the first input clock signal and / or the second input clock signal.
14. A system-on-chip device comprising a clock selector circuit according to claim 1 or 2, wherein the system-on-chip device further comprises circuitry arranged to be clocked by the output clock signal output by the clock selector circuit.
15. A clock switching method, comprising: receiving a first input clock signal having a first frequency; receiving a second input clock signal having a second frequency, wherein the second frequency differs from the first frequency by a frequency offset; outputting one of the first input clock signal and the second input clock signal as an output clock signal; detecting a zero crossing of a phase difference over time between the first input clock signal and the second input clock signal using a predetermined type of clock edge—a rising edge or a falling edge; detecting an edge of a type opposite to the predetermined type in the first input clock signal or in the second input clock signal in response to detecting that the phase difference crosses zero; as well as Switching to outputting the other of the first input clock signal and the second input clock signal as the output clock signal is responsive to detecting the opposite type of edge.
Citation Information
Patent Citations
Low frequency precision oscillator
CN107040243A
Technique for glitchless switching of asynchronous clocks
US6806755B1
