CRYSTAL OSCILLATOR MONITORING CIRCUIT
In an integrated circuit, a clock monitor circuit detects when an analog clock signal output by an on-chip crystal oscillator has stabilized. The clock monitor circuit uses an envelope follower circuit to monitor the envelope of the analog clock signal and compare the amplitude of the envelope with a predetermined amplitude value. When the predetermined value is reached and the envelope has remained steady for a predetermined time, an oscillator okay signal is generated. If an oscillator okay signal is not detected within another predetermined time, then an oscillator failure signal may be generated.
Latest Freescale Semiconductor, Inc. Patents:
- AIR CAVITY PACKAGES AND METHODS FOR THE PRODUCTION THEREOF
- METHODS AND SYSTEMS FOR ELECTRICALLY CALIBRATING TRANSDUCERS
- SINTERED MULTILAYER HEAT SINKS FOR MICROELECTRONIC PACKAGES AND METHODS FOR THE PRODUCTION THEREOF
- CONTROLLED PULSE GENERATION METHODS AND APPARATUSES FOR EVALUATING STICTION IN MICROELECTROMECHANICAL SYSTEMS DEVICES
- SYSTEMS AND METHODS FOR CREATING BLOCK CONSTRAINTS IN INTEGRATED CIRCUIT DESIGNS
The present invention relates generally to crystal oscillators and more particularly to a circuit for detecting stable operation of a crystal oscillator.
Crystal oscillators are a vital part of many integrated circuit devices such as a system-on-chip (SOC). Crystal oscillators are used to provide an accurate and stable clock reference for the SOC and its associated phase-locked loops (PLL). Typically, crystal oscillators take some time to stabilize, with oscillations growing as an envelope over a certain time period until the amplitude of the oscillations reaches a stabilized level. The time that these oscillations take to stabilize depends on factors like load capacitance, aging, and ambient operating conditions.
Known crystal oscillator monitoring circuits observe the digital clock output from the crystal oscillator and measure its duty cycle but provide no information about the sinusoidal oscillations (i.e., the analog clock output) also produced by the crystal oscillator. Some SOC devices use a counter-based fixed delay (typically between 1 ms and 5 ms) after start-up before running the SOC. However, as a crystal oscillator's boot time is greatly dependent on parasitic components, a boot time of anything up to 100 ms is possible.
Therefore it would be beneficial to provide an indication that a crystal oscillator has reached a stable region of operation.
The invention, together with objects and advantages thereof, may best be understood by reference to the following description of preferred embodiments together with the accompanying drawings in which:
The detailed description set forth below in connection with the appended drawings is intended as a description of presently preferred embodiments of the invention, and is not intended to represent the only forms in which the present invention may be practised. It is to be understood that the same or equivalent functions may be accomplished by different embodiments that are intended to be encompassed within the spirit and scope of the invention. In the drawings, like numerals are used to indicate like elements throughout. Furthermore, terms “comprises,” “comprising,” or any other variation thereof, are intended to cover a non-exclusive inclusion, such that module, circuit, device components, structures and method steps that comprises a list of elements or steps does not include only those elements but may include other elements or steps not expressly listed or inherent to such module, circuit, device components or steps. An element or step proceeded by “comprises . . . a” does not, without more constraints, preclude the existence of additional identical elements or steps that comprises the element or step.
In one embodiment, the present invention provides a crystal oscillator monitoring circuit. The circuit includes an envelope follower circuit for receiving an analog output signal from a crystal oscillator and for providing an envelope output signal, and signal processing circuitry connected to the envelope follower for receiving the envelope output signal, comparing the envelope output signal with a reference signal over time, and generating an output signal indicating stable operation of the crystal oscillator when the received envelope output signal reaches and maintains a desired value for a preset period of time.
In another embodiment, the present invention provides a method for detecting stable operation of a crystal oscillator. The method includes the steps of: receiving, in an envelope follower circuit, an oscillating analog output signal from the crystal oscillator; providing an envelope output signal comprising the envelope of the oscillating analog output signal; comparing the envelope output signal with a reference signal over time; and generating an output signal indicative of stable operation of the crystal oscillator when the envelope output signal reaches and maintains a desired value for a preset period of time.
In one example, a comparator makes successive comparisons over time between the envelope output signal and first and second reference voltages. The first and second reference voltages are increased in discrete steps each time the envelope output signal exceeds the first reference voltage and decreased each time the envelope output signal falls below the second reference voltage. A counter times the preset period of time and is reset every time the envelope output signal either exceeds the first reference voltage or falls below the second reference voltage. When the preset period of time expires without the counter having been reset, an “oscillator OK” signal is generated, indicating that the oscillator has attained a stable operating level. A minimum value of at least one of the first and second reference voltages may be selected below which even if the counter expires, an “oscillator ok” will not be generated as this signifies that the oscillator has not reached a desired operating level, even though its output has stabilized.
In another embodiment, an analog to digital converter (ADC) produces digitized values of the envelope output signal and compares successive digitized values with previous digitized values. A counter times the preset period of time and is reset every time there is a mismatch between compared digitized values. When the preset period of time expires without the counter having been reset, an “oscillator OK” signal is generated, indicating that the oscillator has attained a stable, operating level. For example, a digitized value of the envelope signal is compared with a previous digitized value plus an offset, Delta, and with a previous digitized value minus Delta. If the compared digitized value remains between these two values no reset for the counter is generated. A minimum acceptable value of output digitized value may be chosen below such that even if the counter expires, an “oscillator ok” signal will not be generated as this signifies that the oscillator has not reached a desired operating level, even though its output has stabilized.
Referring now to
In operation, initially, all components of the circuit 100 are reset. A reference count Value “REF COUNT” is set for the oscillator counter 117. A minimum count value “MIN AMP COUNT” is set for the counter and selector circuit 114. A reference timer value “REF TIMER” is set for the master timer 122. Initially, the counter and selector circuit 114 sets its output 113 so that the selectable voltage source 112 selects a voltage V1 for application to the second comparator 110 as an upper reference voltage. The selectable voltage source 112 also outputs a lower reference voltage that is received by the first comparator 110. This lower reference voltage has a value that is lower than the upper reference voltage by a known and fixed amount. Say for example that initially, the selected upper reference voltage V1 is 400 mV and the difference between upper and lower reference voltages is chosen to be 300 mV. Therefore the lower reference voltage is 100 mV.
On start-up, if the output of the crystal oscillator and therefore of the envelope detector 106 is 0 v, then the ‘count down’ signal from the first comparator 110 is at a logical “1” and the ‘count up’ signal 116 from the second comparator 111 is at a logical “0”. Once the crystal oscillator's amplitude grows such that the output of the envelope follower 106 reaches 100 mV, the first comparator 110 will trip causing the “count down” signal 115 to move to a logical “0”. The “count up” signal 116 remains at a logical “0”. As the amplitude of the crystal oscillator's output 102 grows still further, the output of the envelope detector 106 will reach 400 mV (V1). At this point, the second comparator 111 trips and causes the “count up” signal 116 to move to a logical “1” (with the “count down” signal remaining at a logical “0”). The counter and selector circuit 114 is thus incremented and its count value moves from zero to one, this count value being registered by the oscillator counter 117. This increment of the count value also triggers generation of a reset signal by the counter and oscillator counter 114, which is sent to the oscillator counter 117. On receipt of this reset signal, the oscillator counter 117 resets its count to zero and commences counting oscillator output pulses again. The incremented count value of ‘one’ also causes the counter and selector circuit 114 to select the next reference voltage V2, say 600 mV as a new upper reference voltage for application to the second comparator 111. The lower reference voltage also changes now to a value of 300 mV and is applied to the first comparator 110.
Following these changes in the upper and lower reference voltages, the “count up” signal 116 moves to a logical “0” while the “countdown” signal 115 remains at a logical “0”. As the output from the crystal oscillator 101 continues to increase, when the output of the envelope follower 106 reaches 600 mV (V2), the “count up” signal 116 will move to a logical “1” thereby incrementing the count value in the counter and selector circuit 114 to a value of “two”. This new count value triggers generation of another reset signal that is sent to the oscillator circuit 117, the new count value (of two) is registered by the oscillator counter 117 and also at this point, a new upper voltage reference, V3, is selected. In this example, V3 is 800 mV and so the lower voltage reference now becomes 500 mV. On receiving these new voltage reference values at the comparators 110, 111, the “count up” signal 116 moves to a logical “0” while the “count down” signal 115 remains at a logical “0.” This process can continue as the output from the crystal oscillator 101 increases in amplitude and every time the count value at the counter and selector circuit 114 changes, the oscillator counter 117 is reset.
In some circumstances, the count value of the counter and selector circuit 114 may be decremented. Assume that the output amplitude of the envelope detector 106 has reached 400 mv, the upper reference voltage is changed to 600 mV and the lower reference voltage to 300 mv but then, instead of increasing in amplitude, the output from the envelope detector 106 drops to 250 mv. Then the “count down” signal 115 will move to a logical “1” while the “count up” signal 116 will remain at a logical “0”. This will result in the count value of the counter and selector circuit 114 being decremented by one and in turn, will result in the counter and selector circuit 114 re-selecting a lower value (V1) as the upper voltage reference. It will also send a reset signal to the oscillator counter 117 that also will register the new (decremented) count value. If the crystal oscillator 101 recovers and its output 102 begins to increase, then the count value of the counter and selector circuit 114 will go up again the next time the second comparator 111 triggers.
Say that the desired stable amplitude of the output 102 of the crystal oscillator 101 corresponds to an envelope follower output of 1200 mV, and assume also that 1200 mV is the value of the voltage setting Vn in the selectable voltage source 112, which in turn corresponds to a count value (in the counter and selector circuit 114) of ‘four’ i.e., the preset value “MIN AMP COUNT.” (Counter values zero, one, two and three correspond with voltage settings V1, V2, V3 and V4 respectively). When the count value in the counter and selector circuit 114 reaches “MIN AMP COUNT” and the count value of the oscillator counter 117 has reached “REF COUNT” (i.e., no reset signal has been received from the counter and selector circuit 114 for a time period equivalent to “REF COUNT” since the oscillator counter 117 registered a counter and selector circuit equal to “MIN AMP COUNT”), then this indicates that the crystal oscillator output 102 has settled to a desired, stable value for an acceptable, predetermined time period (equivalent to the value of REF COUNT). Once these conditions are reached, the oscillator counter 117 generates an “oscillator OK” signal on line 121. This can be used by the SOC of which the circuit 100 is a part, as an indication that it can proceed further in the start-up and operation process. If the count value of the oscillator counter 117 should reach “REF COUNT” at any time but the count value received from the counter and selector circuit 114 is not equal to “MIN AMP COUNT,” then the oscillator counter 117 will roll-over and no “oscillator OK” signal will be generated because even though the crystal oscillator 101 may have been stable for a set time, its output level has still not reached the minimum amplitude requirement.
The output 121 of the oscillator counter 117 is fed to the master timer 122. The master timer 122 is set to run on initialization of the circuit 100 and times the period, “REF TIMER.” If the period “REF TIMER” (typically 50 ms) expires before an “oscillator OK” signal is received from the oscillator counter 117, then it is assumed that the crystal oscillator 101 has failed and a warning signal is output on line 123 by the master timer 123.
Even after the “oscillator OK signal” has been generated by the oscillator counter, the circuit 100 can continue to monitor the performance of the crystal oscillator 101 and de-assert the “oscillator OK” signal if its performance degrades. For example, the comparators 110 and 111 can continue to compare the envelope follower's output with the reference voltages and the first comparator 110 can decrement the count value in the counter and selector circuit 114 if the compared amplitude falls below the lower reference voltage. The counter and selector circuit 114 can respond to this by resetting the oscillator counter, which in turn, changes the state of its output on line 121.
Referring now to
In operation, initially, all components of the apparatus 200 are reset. A reference count Value “REF COUNT” is set for the oscillator counter 215. A reference timer value “REF TIMER” is set for the master timer 220. The first output on line 212 of the ADC 200, which is a “code ready” signal is set and received by the controller 214. The ADC 210, which can be typically a three or four bit device, receives the output of the envelope follower 206 and generates a digital SAR code. The digital code bears a particular relationship to the amplitude of the output of the envelope follower 206. The digital SAR code appears on the second output line 213 of the ADC 210 and is fed to the controller 214. The code increases and decreases depending on how the amplitude of the output of the envelope follower 206 is changing. Once a pre-set minimum value for the digital SAR code is reached, the oscillator counter 215 is enabled by an output generated by the controller 214 and commences counting crystal oscillator pulses. The controller 214 compares each received digital SAR code with the previous received digital SAR code. Every time the result of the comparison shows a mismatch, a reset signal is generated and applied to the oscillator counter 215. In an example, a digitized value of the envelope signal is compared with a previous digitized value plus an offset, Delta, and with a previous digitized value minus Delta. On receipt of a reset signal, the oscillator counter 215 resets its count to zero and commences counting oscillator output pulses again. Once the digital SAR code received at the controller 214 stops changing except for the least significant bit (LSB) or the LSB−1 depending on the chosen step size of the ADC 210 or it remains between a pre-set expected values of digitized output+/−Delta, this signifies that the amplitude of the crystal oscillator's analog output has reached a stable value and no reset for the counter is generated. A minimum acceptable value of output digitized value is chosen below which even if the oscillator counter 215 expires, an “oscillator ok” signal will not be generated as this signifies that the oscillator has not reached a desired operating level, even though its output has stabilized. Note that the ADC 210 may see the LSB toggle even when the oscillator's output has stabilized but this may be ignored. For a large step size it is unlikely to toggle but for small sizes it is more likely that it will. The step size of the successive approximation register in the ADC 210 and how many LSBs to ignore (or discard) while detecting stable operation can be decided based on the particular design requirement. When the digital SAR code stops changing, the ADC goes into a wait mode. Say that the desired stable amplitude of the output 202 of the crystal oscillator 201 corresponds to an envelope follower output of 800 mV. Once the digital SAR code corresponding to this analog value stabilizes for a period long enough for the oscillator counter to count up to REF COUNT, then the oscillator counter generates a “counter expired” signal on line 218 which is received by the controller. In, response, the controller 214 generates a. “oscillator OK” signal on its output line 219. In an alternative embodiment, the “counter expired” signal generated by the oscillator counter is used as the “oscillator OK” signal.
The output 219 of the controller 214 is fed to the master timer 220. The master timer 220 is set to run on initialization of the apparatus 200 and times the period, “REF TIMER.” If the period “REF TIMER” (typically 50 ms) expires before an “oscillator OK” signal is received from the controller 214, then it is assumed that the crystal oscillator 201 has failed and a warning signal is output on line 221 by the master timer 220.
Even after the “oscillator OK signal” is generated by the controller, 214, the controller can continue to monitor the digital SAR codes received from the ADC 210. If a significant change occurs, then the controller 214 de-asserts the “oscillator OK” signal by changing the state of the signal on its output line 219.
Advantageously, because the oscillation counter 215 and ADC 210 receive outputs from the crystal oscillator 201, the apparatus 200 can detect with confidence that the crystal oscillator 201 is actually running as intended and the generation of the “oscillator OK” signal is not merely a result of the detection of noise or a DC voltage.
The connections as discussed herein may be any type of connection suitable to transfer signals from or to the respective nodes, units or devices, for example via intermediate devices. Accordingly, unless implied or stated otherwise, the connections may for example be direct connections or indirect connections. The connections may be illustrated or described in reference to being a single connection, a plurality of connections, unidirectional connections, or bidirectional connections. However, different embodiments may vary the implementation of the connections. For example, separate unidirectional connections may be used rather than bidirectional connections and vice versa. Also, plurality of connections may be replaced with a single connection that transfers multiple signals serially or in a time multiplexed manner. Likewise, single connections carrying multiple signals may be separated out into various different connections carrying subsets of these signals. Therefore, many options exist for transferring signals.
Each signal described herein may be designed as positive or negative logic. In the case of a negative logic signal, the signal is active low where the logically true state corresponds to a logic level zero. In the case of a positive logic signal, the signal is active high where the logically true state corresponds to a logic level one. Note that any of the signals described herein can be designed as either negative or positive logic signals. Therefore, in alternate embodiments, those signals described as positive logic signals may be implemented as negative logic signals, and those signals described as negative logic signals may be implemented as positive logic signals. Furthermore, the terms “assert” or “set” and “negate” (or “de-assert” or “clear”) are used herein when referring to the rendering of a signal, status bit, or similar apparatus into its logically true or logically false state, respectively. If the logically true state is a logic level one, the logically false state is a logic level zero. And if the logically true state is a logic level zero, the logically false state is a logic level one.
Those skilled in the art will recognize that the boundaries between logic blocks are merely illustrative and that alternative embodiments may merge logic blocks or circuit elements or impose an alternate decomposition of functionality upon various logic blocks or circuit elements. Thus, it is to be understood that the architectures depicted herein are merely exemplary, and that in fact many other architectures can be implemented which achieve the same functionality. For example, the counter and selector circuit, oscillator counter and master timer of
Also for example, in one embodiment, the illustrated examples may be implemented as circuitry located on a single integrated circuit or within a same device. Further, the entire functionality of the circuit shown in
Also for example, the examples, or portions thereof, may be implemented as soft or code representations of physical circuitry or of logical representations convertible into physical circuitry, such as in a hardware description language of any appropriate type.
The description of the preferred embodiments of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or to limit the invention to the forms disclosed. It will be appreciated by those skilled in the art that changes could be made to the embodiments described above without departing from the broad inventive concept thereof. It is understood, therefore, that this invention is not limited to the particular embodiment disclosed, but covers modifications within the spirit and scope of the present invention as defined by the appended claims.
Claims
1. A clock monitoring circuit for detecting stable operation of a crystal oscillator, the clock monitoring circuit comprising:
- an envelope follower circuit for receiving an analog output signal from the crystal oscillator and providing an envelope output signal; and
- signal processing circuitry, connected to the envelope follower circuit, for receiving the envelope output signal, comparing the envelope output signal with a reference signal over time using a comparator, and generating an output signal indicating stable operation of the crystal oscillator when the envelope output signal reaches and maintains a desired value for a preset period of time,
- wherein: the comparator comprises an analog to digital converter (ADC) for producing digitized values of the received envelope output signal over time, and the reference signal is a previous digitized value of the received envelope output signal.
2. (canceled)
3. The apparatus of claim 1, wherein the reference signal comprises first and second reference voltages and wherein the comparator makes successive comparisons over time between the envelope output signal and the first and second reference voltages, and wherein the signal processing circuitry increases the first and second reference voltages in discrete steps each time the envelope output signal exceeds the first reference voltage and decreases the first and second reference voltages each time the envelope output signal falls below the second reference voltage.
4. The apparatus of claim 3, wherein the signal processing circuitry includes a counter for timing the preset period of time, and wherein the counter is reset every time the received envelope output signal compared by the comparator either exceeds the first reference voltage or falls below the second reference voltage.
5. (canceled)
6. The clock monitoring circuit of claim 1, wherein the signal processing circuitry further comprises a counter for timing the preset period of time, wherein the counter is reset every time there is a mismatch between the reference signal and a compared, digitized value of the envelope output signal.
7. The clock monitoring circuit of claim 1, wherein the signal processing circuitry includes a timer for timing a preset time interval and for detecting generation of the output signal and for generating a warning signal if, after the preset time interval has expired, the output signal has not been detected.
8. In an integrated circuit including a crystal oscillator, a clock monitoring circuit for detecting stable operation of the crystal oscillator, the clock monitoring circuit comprising:
- an envelope follower circuit for receiving an analog output signal from the crystal oscillator and providing an envelope output signal; and
- signal processing circuitry connected to the envelope follower circuit for receiving the envelope output signal, comparing the envelope output signal with a reference signal over time using a comparator, and generating an output signal indicating stable operation of the crystal oscillator when the received envelope output signal reaches and maintains a desired value for a preset period of time, and
- wherein: the reference signal comprises first and second reference voltages; the comparator makes successive comparisons over time between the envelope output signal and the first and second reference voltages; and the signal processing circuitry increases the first and second reference voltages in discrete steps each time the envelope output signal exceeds the first reference voltage and decreases the first and second reference voltages each time the envelope output signal falls below the second reference voltage.
9. A method for detecting stable operation of a crystal oscillator, the method comprising:
- receiving, in an envelope follower circuit, an oscillating analog output signal from the crystal oscillator;
- determining an envelope of the oscillating analog output signal;
- producing digitized values of the envelope over time in an analog to digital converter;
- comparing a digitized value of the envelope with a reference signal over time, wherein the reference signal comprises a previous digitized value of the envelope; and
- generating an output signal indicative of stable operation of the crystal oscillator when the envelope reaches and maintains a desired value for a preset period of time.
10. The method of claim 9, further comprising:
- making successive comparisons over time between the envelope and first and second reference voltages; and
- increasing the first and second reference voltages in discrete steps each time the envelope exceeds the first reference voltage and decreasing the first and second reference voltages each time the envelope falls below the second reference voltage.
11. The method of claim 10, further comprising:
- timing the preset period of time in a counter; and
- resetting the counter every time the envelope either exceeds the first reference voltage or falls below the second reference voltage.
12. (canceled)
13. The method of claim 9, further comprising:
- timing the preset period of time in a counter; and
- resetting the counter every time there is a mismatch between a compared, digitized value of the envelope and a previous, digitized value of the envelope.
Type: Application
Filed: Aug 4, 2014
Publication Date: Feb 4, 2016
Applicant: Freescale Semiconductor, Inc. (Austin, TX)
Inventors: Nishant Singh Thakur (Indore), Rakesh Pandey (Ghaziabad), Manmohan Rana (Ghaziabad)
Application Number: 14/451,404