Glitch free clock multiplexer that uses a delay element to detect a transition-free period in a clock signal
A clock multiplexer circuit uses a delay element to detect a transition-free period in a first signal present on a D-input lead of an output latch. The output latch is then controlled to latch the stable value of the first signal, and to hold the value of the first signal on an output lead of the clock multiplexer circuit. The clock multiplexer circuit then controls a multiplexer of the clock multiplexer circuit to couple a second signal onto the D-input lead of the output latch. The clock multiplexer circuit then enables the output latch synchronously with respect to the second signal such that the output latch is made transparent at a time when the second signal on the D-input of the output latch is stable and not transitioning. The result is glitch free clock switching from the first signal to the second signal.
Latest Zilog, Inc. Patents:
- Rejecting noise transients while turning off a fluorescent lamp using a starter unit
- Remote control of a legacy fluorescent lamp fixture
- Fluorescent lamp starter unit having a hot socket insert capability
- Ambient light sensor auto-calibration in a lighting control system
- Rejecting Noise Transients While Turning Off a Fluorescent Lamp Using a Starter Unit
This application is a continuation of, and claims priority under 35 U.S.C. §120 from, nonprovisional U.S. patent application Ser. No. 11/445,851 entitled “Glitch Free Clock Multiplexer that Uses a Delay Element to Detect a Transition-Free Period in a Clock Signal,” filed on Jun. 3, 2006, now U.S. Pat. No. 7,375,571, the subject matter of which is incorporated herein by reference.
BACKGROUND INFORMATIONMany clock multiplexers produce glitches under some conditions when switching from one clock source to another clock source. Some clock multiplexing schemes place restrictions on the switch control events and/or on the clock signals being switched. An example is U.S. Pat. No. 6,075,392 which assumes that the switch control events are synchronous to the currently selected clock signal and also assumes that the currently selected clock signal is active and transitioning. If the currently selected clock signal begins to start transitioning erratically or fails entirely such that it is no longer transitioning, then the clock multiplexing scheme may not be able to transition from the currently selected clock signal to another clock signal in a glitch-free manner.
SUMMARYA clock multiplexer circuit uses a delay element to detect a transition-free period in a first signal present on a D-input lead of an output latch. The output latch is then controlled to latch the stable value of the first signal, and to hold the value of the first signal on an output lead of the clock multiplexer circuit. The clock multiplexer circuit then controls a multiplexer of the clock multiplexer circuit to couple a second signal onto the D-input lead of the output latch. The clock multiplexer circuit then enables the output latch synchronously with respect to the second signal such that the output latch is made transparent at a time when the second signal on the D-input of the output latch is stable and not transitioning. The result is glitch-free clock switching from the first signal to the second signal.
Proper glitch-free operation of the clock multiplexer circuit does not depend on the first signal transitioning as a proper clock signal. Proper operation of the clock multiplexer circuit does not require that the first clock be transitioning at all. In one novel aspect, the first signal is passed through a delay element. A digital value on the input lead of the delay element is compared to a digital value on the output lead of the delay element. If the two digital values are detected to be identical during a time when the clock signal is to be switched, then the first signal is determined to be stable and the stable value of the first signal is latched into the output latch. This circuitry causes the output latch to be latched properly even if the first signal is not transitioning (for example, due to the first signal being a clock signal that has failed and has stopped transitioning altogether).
Further details and embodiments are described in the detailed description below. This summary does not purport to define the invention. The invention is defined by the claims.
The accompanying drawings, where like numerals indicate like components, illustrate embodiments of the invention.
An operation of clock multiplexer circuit 1 is described in connection with the waveform diagram of
The clock signal from the external crystal oscillator that is present on IC terminal 10 is coupled through multiplexer 2 onto an input lead 22 of delay element control circuit 4. This signal is denoted MUXCLK in the waveform diagram of
Next, an asynchronous clock switching event occurs as represented in the waveform of
The CLKCHG signal is supplied onto the lower input lead of AND gate 28. If the signal passing through delay element 5 is stable and is not transitioning for a short duration of time, then the value MUXCLK on the input lead of delay element 5 will be the same as the value MUXCLKDLY on the output lead of delay element 5. In the example of
Latch 3 is a type of latch that is transparent when the signal on the enable EN-input lead of latch 3 is a digital high. Transparent means that the signal on the D-input lead passes through the latch and is output onto the Q-output lead of the latch. Latch 3 latches and holds the value on its D-input lead as the value that is output onto its Q-output lead when the enable signal on its EN-input lead transitions from high-to-low. As long as the enable signal is a digital low, latch 3 holds the value on its Q-output lead at this latched value.
Accordingly, when the CLKEN signal transitions from high-to-low, latch 3 latches the value of the signal MUXCLKDLY on its D-input lead. The low digital value of the signal MUXCLKDLY is therefore held on the Q-output lead as the value of the signal SYSCLK (see the upper waveform of
When CLKEN transitions low, CLKENB transitions high. CLKENB is supplied to the enable input leads of transparent latches 30-33 of multiplexer 2. Latches 30-33 therefore become transparent. The result of decoding the two-bit “00” value on the multiplexer input leads 15 therefore passes through the latches 30-33 and to the four AND gates 34-37. The value output by latch 33 is the only digital high. The value of the signal CLKSELDEC[3:0] output by the latches 30-33 therefore changes from “0100” (where the “1” corresponds to the external crystal oscillator) to “0001” (where the “1” corresponds to the watch dog timer). The clock signal output from watch dog timer clock source 8 is now coupled through AND gate 34 and OR gate 38 and onto the multiplexer output lead 21. The signal MUXCLK now transitions as a result of transitioning of the watch dog timer clock. The MUXCLK signals does not, however, pass through output latch 3 and onto SYSCLK due to latch 3 being latched.
The high value of CLKENB is also synchronized through synchronizer 7. The two flip-flops 39 and 40 of synchronizer 7 are clocked on the high-to-low transitions of MUXCLKDLY (flip-flops 39 and 40 are negative edge triggered). Due to multiplexer 2 having been switched to select the watchdog timer clock signal, the signal MUXCLKDLY is a delayed version of the watchdog timer clock signal. CLKENB is therefore synchronized with respect to the clock signal (watchdog timer clock) that is now being switched to. Note that the low-to-high transition of CLKENB exits synchronizer 7 as the low-to-high transition of signal CHGDONE in the waveform of
When CHGDONE transitions high, OR gate 40 asserts the signal CLKEN-S on the set input lead of sequential logic element 6 to a digital high. Sequential logic element 6 is set, and the signal CLKEN transitions to a digital high. The low-to-high transition of CLKEN is indicated at time T2 in the waveforms of
When CHGDONE transitions high, CHGDONEB transitions low and resets flip-flop 26, thereby causing signal CLKCHG to be deasserted to a low logic value as illustrated in
Next, the processor writes the two-bit value “10” into register 13 (corresponding to the external crystal oscillator). This write occurs synchronously with respect to the SYSCLK. When the processor addresses register 13 during a write cycle, the signal WR pulses to a digital high value. When SYSCLK transitions high during the time WR is high, the two-bit data bus value is clocked into register 13 and appears as value CLKSEL[1:0]. Note that in
When the value of CLKSEL[1:0] changes value, flip-flop 26 is loaded with a digital one such that signal CLKCHG is asserted to a digital high value. In the example of
Signal CLKCHG being asserted high causes AND gate 28 to output a digital high when the internal precision oscillator clock signal is stable (as detected by MUXCLK and MUXCLKDLY having the same values). When such a stable condition is detected, then the reset signal CLKEN-R on the reset input lead of sequential logic element 6 is asserted to a digital logic high. The resetting of sequential logic element 6 causes sequential logic element 6 to force the CLKEN signal to a digital low, thereby latching the stable value of MUXCLKDLY into output latch 3. At time T1 in the waveform diagram of
When CLKEN transitions to a digital low, CLKENB transitions to a digital high. As explained above in connection with
As explained above in connection with
When CHGDONE transitions high, signal CHGDONEB transitions low. This resets flip-flop 26, thereby deasserting the signal CLKCHG to a digital low. At a later time after the period of time illustrated in
Next (step 201), a delay element is used detect a transition-free period in the first signal. In the example of
Next (step 202), the output latch is latched during the transition-free period such that the stable value of the first signal is held by the output latch. In the example of
Next (step 203), the multiplexer is switched such that the first signal is no longer present on the D-input lead of the output latch but rather so that a second signal is present on the D-input lead of the output latch. In the example of
Next (step 204), the output latch is made transparent synchronously with the second signal such that the second signal is allowed to pass through the output latch. In the example of
Although certain specific embodiments are described above for instructional purposes, the teachings of this patent document have general applicability and are not limited to the specific embodiments described above. The clock switching function of the specific circuit of
Claims
1. A method comprising:
- (a) passing a first signal through a multiplexer, onto an input lead of a delay element, through the delay element, onto an output lead of the delay element and onto a data input lead of a latch, wherein an input digital value is present on the input lead of the delay element as the first signal is passed onto the input lead of the delay element, and wherein an output digital value is present on the output lead as the first signal is passed onto the output lead;
- (b) detecting a transition-free period in the first signal by comparing the input digital value to the output digital value;
- (c) latching the latch during the transition-free period based on the detecting in (b); and
- (d) switching the multiplexer such that the first signal is no longer present on the data input lead of the latch but so that a second signal is present on the data input lead of the latch.
2. The method of claim 1, further comprising:
- (e) making the latch transparent at least one period of the second signal after the switching in (d).
3. The method of claim 2, wherein the latch is made transparent in (e) in response to an edge of the second signal.
4. The method of claim 1, wherein the first signal has failed and is not transitioning when the transition-free period is detected in (b).
5. The method of claim 1, wherein the transition-free period is detected in (b) when both the input digital value and the output digital value are digital low values.
6. The method of claim 1, wherein the detecting in (b) is performed without comparing the first signal to any other signal.
7. The method of claim 1, wherein the detecting in (b) is performed without comparing the input digital value to any value other than the output digital value.
8. The method of claim 1, wherein the first signal is an external crystal oscillator clock signal, and wherein the second signal is a watchdog timer clock signal.
9. A method comprising:
- (a) coupling a first clock input lead of a multiplexer to a delay element, wherein a signal path extends through the multiplexer, through the delay element, and to a data input lead of a latch;
- (b) identifying when a voltage on the data input lead of the latch is stable at a digital value, wherein the identifying is performed using the delay element;
- (c) when the voltage is stable as identified in (b), latching and holding the digital value on an output lead of the latch;
- (d) coupling a second clock input lead of the multiplexer to the delay element, wherein a clock signal is present on the second clock input lead and is passed through the multiplexer, through the delay element and to the data input lead of the latch; and
- (e) after the coupling in (d) controlling the latch to be transparent.
10. The method of claim 9, further comprising:
- (f) receiving a clock change signal, wherein the digital value is latched and held in (c) in response to the receiving of the clock change signal.
11. The method of claim 9, wherein the latch is controlled to be transparent in (e) in response to an edge of the clock signal on the data input lead of the latch.
12. The method of claim 9, wherein a first signal is present on the first clock input lead of the multiplexer, and wherein the identifying in (b) is performed without comparing the first signal to any other signal.
13. The method of claim 9, wherein the identifying in (b) is performed without comparing a voltage on the first clock input lead to any voltage other than the voltage on the data input lead of the latch.
14. The method of claim 9, wherein the first clock input lead of the multiplexer is coupled to an external crystal oscillator, and wherein the second clock input lead of the multiplexer is coupled to a watchdog timer.
15. A clock multiplexer circuit, comprising:
- a multiplexer having a first multiplexer input lead, a second multiplexer input lead, and a multiplexer output lead;
- a latch having a latch data input lead and a latch output lead; and
- a delay element having a delay input lead and a delay output lead, wherein the delay input lead is coupled to the multiplexer output lead, wherein the delay output lead is coupled to the latch data input lead, wherein a first signal is present on the first multiplexer input lead and is passed to the delay input lead, wherein a second signal is present on the latch data input lead, wherein the clock multiplexer circuit determines that the second signal is stable by comparing the second signal to the first signal, and wherein after the second signal is determined to be stable the multiplexer couples a clock signal present on the second multiplexer input lead to the multiplexer output lead such that the clock signal passes through the delay element, through the latch and onto the latch output lead.
16. The clock multiplexer circuit of claim 15, wherein the clock multiplexer circuit does not compare the first signal to any signal other than the second signal.
17. The clock multiplexer circuit of claim 15, wherein the latch is transparent after the multiplexer couples the clock signal present on the second multiplexer input lead to the multiplexer output lead.
18. The clock multiplexer circuit of claim 15, wherein the latch has a latch enable input lead, further comprising:
- a sequential logic element that is set to a first state in response to the clock multiplexer circuit determining that the second signal is stable, wherein the sequential logic element deasserts a latch enable signal onto the latch enable input lead in response to the clock multiplexer circuit determining that the second signal is stable; and
- a synchronizer that is clocked by the clock signal, wherein the latch enable signal is passed through the synchronizer, wherein the synchronizer outputs a third signal that sets the sequential logic element to a second state, and wherein the setting of the sequential logic element to the second state results in the asserting of the latch enable signal.
19. The clock multiplexer circuit of claim 18, wherein the latch enable signal is asserted shortly after and in response to an edge of the clock signal.
20. The clock multiplexer circuit of claim 15, wherein the first multiplexer input lead is coupled to an external crystal oscillator, and wherein the second multiplexer input lead is coupled to a watchdog timer.
21. A circuit comprising:
- a multiplexer having a first multiplexer input lead and a second multiplexer input lead, wherein a first clock signal is present on the first multiplexer input lead and a second clock signal is present on the second multiplexer input lead;
- a latch, wherein the first clock signal is coupled through the multiplexer and onto a latch data input lead of the latch; and
- means for determining when the first signal is stable and for controlling the multiplexer such that the second clock signal is then coupled through the multiplexer and onto the latch data input lead, wherein the means determines when the first clock signal is stable by comparing the first clock signal to a delayed version of the first signal, and wherein the means is also for making the latch transparent synchronously with the second clock signal.
22. The circuit of claim 21, wherein the delayed version of the first clock signal is present on the latch data input lead of the latch.
23. The circuit of claim 22, wherein the means for comparing comprises:
- a delay element having an input lead and an output lead; and
- a comparator having a first input lead coupled to the input lead of the delay element, the comparator having a second input lead coupled to the output lead of the delay element.
24. The circuit of claim 21, wherein the first multiplexer input lead is coupled to an external crystal oscillator, and wherein the second multiplexer input lead is coupled to a watchdog timer.
5319678 | June 7, 1994 | Ho et al. |
5502409 | March 26, 1996 | Schnizlein |
5539337 | July 23, 1996 | Taylor et al. |
5726990 | March 10, 1998 | Shimada et al. |
5731715 | March 24, 1998 | Mote, Jr. |
6075392 | June 13, 2000 | Sandner |
6266780 | July 24, 2001 | Grundvig et al. |
6292044 | September 18, 2001 | Mo et al. |
6324652 | November 27, 2001 | Henderson et al. |
6501304 | December 31, 2002 | Boerstler et al. |
6593780 | July 15, 2003 | Lammers |
6784699 | August 31, 2004 | Haroun et al. |
7039146 | May 2, 2006 | Chiu |
7284143 | October 16, 2007 | Song et al. |
7375571 | May 20, 2008 | Tiffany |
20020075058 | June 20, 2002 | Hwang et al. |
WO 03/044996 | May 2003 | WO |
- IBM Technical Disclosure, Gartmann et al., “Method To Select One Of Two Clocks While Avoiding Narrow Pulses,” vol. 32 No. 9B, Feb. 1990, pp. 82-84, printout from Delphion.
Type: Grant
Filed: May 19, 2008
Date of Patent: Sep 8, 2009
Assignee: Zilog, Inc. (San Jose, CA)
Inventor: William J. Tiffany (Eagle, ID)
Primary Examiner: Lincoln Donovan
Assistant Examiner: Patrick O'Neill
Attorney: Imperium Patent Works
Application Number: 12/154,057
International Classification: G06F 1/08 (20060101);