Compensating for hysteretic characteristics of crystal oscillators

In some examples, compensating for hysteretic characteristics of a crystal oscillator in a timing circuit includes obtaining a plurality of successive temperature measurements. From the plurality of successive temperature measurements, a temperature gradient having a sign and a magnitude can be determined. A frequency compensation parameter can then be determined based on any combination of two or more factors chosen from a set of factors including a temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient. A frequency error of the timing circuit can then be compensated based on the frequency compensation parameter.

BACKGROUND

Crystal oscillators can be used in electronic devices to provide a frequency reference or to provide a clock signal for an electronic circuit. A crystal oscillator is designed to vibrate at a known frequency upon application of an appropriate input, such as a voltage. An ideal crystal oscillator vibrates at a known, unchanging frequency. However, in practice, a crystal oscillator will typically oscillate at different frequencies depending on the temperature of the crystal oscillator.

BRIEF SUMMARY

Certain embodiments are described for compensating for hysteretic characteristics of crystal oscillators. Different examples are described below. One example of a method for compensating for hysteretic characteristics of crystal oscillators, includes obtaining a plurality of successive temperature measurements; determining a temperature gradient having a sign and a magnitude, the temperature gradient based on at least two temperature measurements of the plurality of successive temperature measurements and a time between the at least two temperature measurements; determining a frequency compensation parameter based on any combination of two or more factors chosen from a set of factors including a temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient; and compensating for a frequency error of the timing circuit based on the frequency compensation parameter.

An example apparatus for compensating for hysteretic characteristics of crystal oscillators includes a sensor configured to sense a temperature, and a processor configured to obtain a plurality of successive temperature measurements from the sensor; determine a temperature gradient having a sign and a magnitude, the temperature gradient based on at least two temperature measurements of the plurality of successive temperature measurements and a time between the at least two temperature measurements; determine a frequency compensation parameter based on any combination of two or more factors chosen from a set of factors including a temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient; and compensate for a frequency error of the timing circuit based on the frequency compensation parameter.

A further example system for compensating for hysteretic characteristics of crystal oscillators includes means for obtaining a plurality of successive temperature measurements; means for determining a temperature gradient having a sign and a magnitude, the temperature gradient based on at least two temperature measurements the plurality of successive temperature measurements and a time between the at least two temperature measurements; means for determining a frequency compensation parameter based on any combination of two or more factors chosen from a set of factors including a temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient; and means for compensating for a frequency error of the timing circuit based on the frequency compensation parameter.

One example non-transitory computer-readable medium comprises program code for a processor to execute a method for compensating for hysteretic characteristics of a crystal oscillator in a timing circuit, the program code including program code for obtaining a plurality of successive temperature measurements; program code for determining a temperature gradient having a sign and a magnitude, the temperature gradient based on at least two temperature measurements of the plurality of successive temperature measurements and a time between the at least two temperature measurements; program code for determining a frequency compensation parameter based on any combination of two or more factors chosen from a set of factors including a temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient; and program code for compensating for a frequency error of the timing circuit based on the frequency compensation parameter.

Still further examples are provided in the detailed description below, including examples for encoding program code on non-transitory computer-readable media for performing example methods described above and in the detailed description below.

DETAILED DESCRIPTION

Examples are described herein in the context of compensating for hysteretic effects in crystal oscillators. Those of ordinary skill in the art will realize that the following description is illustrative only and is not intended to be in any way limiting. Other embodiments will readily suggest themselves to such skilled persons having the benefit of this disclosure. Reference will now be made in detail to implementations of example embodiments as illustrated in the accompanying drawings. The same reference indicators will be used throughout the drawings and the following description to refer to the same or like items.

In the interest of clarity, not all of the routine features of the examples described herein are shown and described. It will, of course, be appreciated that variations of the teachings described within this specification may be implemented without deviating from the scope of this disclosure.

Some devices employ timing circuits with crystal oscillators as a frequency reference or as a clock source. For example, a smartphone may employ such a timing circuit for use with a global positioning system (GPS) receiver to enable accurate position services for the smartphone. However, the temperature of the crystal oscillator may vary over time due in part to the operation of the smartphone. For example, if the smartphone is used to make a cellular voice call, the cellular radio components can generate amounts of heat, which cause other components in the smartphone to heat up, including the crystal oscillator. As the crystal oscillator's temperature changes, its actual vibration frequency will vary and the output signal of the timing circuit will change. Furthermore, the relationship between frequency and temperature of crystal oscillators tends to exhibit hysteretic characteristics. For example, at a particular temperature, a crystal oscillator may vibrate at different frequencies depending on whether the temperature of the crystal oscillator is increasing or decreasing. However, software or hardware employing the timing circuit's output signal may be “unaware” of these changes and may continue to operate as though the output signal is invariant.

Further, the frequency of the output signal does not vary by a constant amount for any particular temperature. Rather, the frequency of the output signal may vary by two different amounts based on whether the temperature is increasing or decreasing. Further, the rate at which the temperature changes over time affects the amount by which the frequency of the output signal will vary from the vibration frequency at a particular steady-state temperature. In addition to the magnitude of the gradient, the magnitude of the frequency variance is also affected by the absolute temperature itself. Thus, compensating for frequency error in crystal oscillators can depend on many factors.

Thus, an example apparatus may be fitted with one or more temperature sensors to measure the temperature of components of the apparatus, such as the crystal oscillator itself, the timing circuit having the crystal oscillator, or components near the crystal oscillator or timing circuit. The apparatus is programmed or configured to receive successive temperature measurements over time from the temperature sensor(s), determine temperature gradients based on the successive temperature measurements, determine the sign and magnitude of the temperature gradients, and use one or more of these data points to determine a frequency compensation parameter for the output signal provided by the timing circuit or crystal oscillator. The apparatus can then apply the frequency compensation parameter in a wide variety of ways, described in more detail below, when performing certain tasks that rely on the frequency of the crystal oscillator's or timing circuit's output signal.

For example, the example apparatus could be part of a global positioning system (GPS) subsystem to enable the apparatus to determine its position. However, GPS signals received from GPS satellites are decoded, in part, based on a known frequency reference provided by a timing circuit including a crystal oscillator. Thus, when decoding GPS signals, the apparatus may employ the frequency compensation parameter to adjust the frequency of the output signal provided to the GPS subsystem to enable a more accurate calculated position. Such an example apparatus may be incorporated into a smartphone, a GPS receiver, a navigation system, or any other suitable device or system.

Referring now toFIG. 1,FIG. 1shows a plot of frequency error as a function of temperature in a signal output by a timing circuit having a crystal oscillator without considering or calculating hysteretic effects. As can be seen inFIG. 1, the frequency error, in parts per million (ppm), is shown as the two-dimensional curve110as a function of the temperature in degrees Celsius. In other words, the curve110is an ideal frequency error vs. temperature curve. Thus, the curve110illustrates the frequency error of a crystal oscillator at any of a number of steady-state temperatures. For example, at approximately 32 degrees Celsius, this crystal oscillator has no frequency error. The function, ƒ(t),120used to generate the curve110is shown. The values of c0, c1, c2, c3, and t0are dependent on the crystal oscillator itself, while the value oft is the temperature of the crystal oscillator. The curve110can be used to determine a first-order calculation of a vibration frequency of a crystal oscillator by applying the frequency error calculated using curve110to a nominal frequency of the timing circuit having a crystal oscillator. In some examples, a means for determining an ideal frequency error of the crystal oscillator based at least on the temperature measurement may calculate the ideal frequency error of the crystal oscillator by solving the function, ƒ(t), described above based on a particular temperature value, t. As shown in greater detail below, a variance from this first-order calculation of the vibration frequency can be determined using temperature and/or temperature gradient information.

Referring now toFIG. 2,FIG. 2shows a plot200of frequency error in a crystal oscillator's output as a function of temperature with hysteretic characteristics. The frequency error is relative to a nominal vibration frequency of a crystal oscillator. The plot200includes an ideal frequency error versus temperature curve210for a crystal oscillator, similar to that shown inFIG. 1. The plot200also includes two frequency error versus temperature curves220,230that show a hysteretic response of the crystal oscillator to temperature changes. Referring first to curve220, curve220shows a plot of frequency error based on temperature changes over time. As can be seen, the frequency error at 67 degrees Celsius for curve220has two different values: −9499 parts per billion (ppb) and −9553 ppb. As discussed above, these different values result, at least in part, from the hysteretic characteristics of the crystal oscillator. Thus in this example, as the crystal oscillator heats, the frequency error (illustrated by curve220) relative to the nominal vibration frequency of the output signal is less than the ideal frequency error curve210, but while the crystal oscillator cools, the frequency error relative to the nominal vibration frequency of the output signal is greater than the ideal frequency error curve210at the same temperature. As can be seen from this example, a frequency variance (and hence a frequency error) can have a first value at a given temperature as well as a second value at the given temperature. Hence, in general, the frequency variance (and the frequency compensation parameter, as discussed further below) can have a first value at a temperature where the sign of the temperature gradient has a first sign and a second value at the temperature where the sign of the temperature gradient has a second sign where the first value and the second value are different and the first sign and the second sign are different.

In addition,FIG. 2shows a second curve230. Curve230also shows a plot of frequency error relative to the nominal vibration frequency based on temperature changes over time; however, the magnitudes of the hysteresis in the frequency error of the second curve230are generally greater than the magnitudes of the variances of the first curve220. As can be seen inFIG. 2, the frequency error relative to the nominal vibration frequency at 67 degrees Celsius for the second curve230are −9476 ppb and −9584 ppb, while for the first curve220, they are −9499 ppb and −9553 ppb. The difference in frequency error between the two curves220,230is based on the differences in the time gradient of temperature underlying the respective frequency errors. The temperature gradients resulting from the heating and cooling of the crystal oscillator that contributed to the first curve220had a lower magnitude than the temperature gradients that contributed to the second curve230.

Referring now toFIG. 3,FIG. 3shows a plot300of frequency error in a crystal oscillator as a function of temperature with hysteretic characteristics. The plot300ofFIG. 3does not include an ideal frequency error versus temperature curve like the curve210shown inFIG. 2. Rather, the plot300includes two frequency error versus temperature curves320,330that show hysteretic responses of the crystal oscillator to different temperature changes. As with the curves220,230shown inFIG. 2, the curves320,330inFIG. 3show variance from the ideal frequency error based on temperature changes over time. In this case, the variances on the first curve320at −5 degrees Celsius are 6504 ppb and 6474 ppb and the variances on the second curve330at the same temperature, −5 degrees Celsius, are 6520 and 6455, respectively. Again, in this example, the variance from the ideal frequency error is based on the temperature gradient and the sign of the temperature gradient. In some examples, calculating the variance may be based on empirically measured oscillation frequency response data of the crystal to temperature gradients and the signs of those gradients and difference between the measured oscillation frequency values and the ideal frequency error. One example may employ a means for determining a variance from the ideal frequency error based at least on the temperature gradient to provide the variance. These measured values may further be stored in a lookup table and some examples may access the measured values in the lookup table based on a measured temperature and a temperature gradient. Therefore, a corrected vibration frequency can be calculated based on a nominal vibration frequency, an ideal frequency error, and a variance from the ideal frequency error. The variance from the ideal frequency error can exhibit hysteretic characteristics.

However, as can be seen, the magnitude of the hysteretic effects illustrated by curves220,230inFIG. 2was larger than those illustrated by the curves320,330inFIG. 3, which occurred at a lower temperature range. The variance from the ideal frequency error in a crystal oscillator's output signal exhibits hysteretic characteristics that are dependent, at least in part, on both a temperature gradient, including the sign and magnitude of the gradient, as well as the temperature of the crystal.

Referring now toFIG. 4,FIG. 4shows an example system400for compensating for hysteretic effects in crystal oscillators. The system400includes a timing circuit410, which includes a crystal oscillator420, a temperature sensor430, and a processor440. This example system400may be incorporated into many different types of devices. For example, suitable devices include smartphones, cellular phones, tablets, laptop computers, navigational systems for vehicles.

In the system400shown inFIG. 4, the timing circuit410provides an oscillation signal having a frequency based on vibrations of the crystal oscillator420. As described above, the vibrations of the crystal oscillator may vary depending on temperature and a temperature gradient, including the sign and the magnitude of the temperature gradient. The temperature sensor430is thermally coupled to and senses the temperature of the crystal oscillator420over time and provides successive temperature measurements to the processor440. Various types of temperature sensors may be employed in different example systems according to this disclosure. For example, thermocouples and thermistors are example means for obtaining a plurality of successive temperature measurements. And while the system400shown inFIG. 4only includes one temperature sensor, multiple sensors can be used in different examples.

The processor440uses the successive temperature measurements to calculate temperature gradients and to determine a frequency compensation parameter for the timing circuit410. In this example system400, the processor440executes program code to determine a frequency compensation parameter based on any combination of two or more factors chosen from a set of factors including a temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient. The processor440also causes the timing circuit410to output an oscillation signal based on the frequency compensation parameter. In this example, over time, the processor440iteratively determines multiple successive frequency compensation parameters and causes the timing circuit410to output oscillation signals based on the successive frequency compensation parameters, which allows the processor440to compensate for frequency error as the crystal oscillator changes temperature over time.

Referring now toFIG. 5A,FIG. 5Ashows an example method500for compensating for hysteretic effects in crystal oscillators. The method500ofFIG. 5Ais described with reference to the example system400shown inFIG. 4, but is not limited to such a system400.

The method500begins in block510when the processor440obtains a plurality of successive temperature measurements from the temperature sensor430, or from a plurality of temperature sensors. The temperature sensor430can periodically send successive temperature measurements to the processor440, or the processor440can periodically poll the temperature sensor430for successive temperature measurements. In the context of this description, successive temperature measurements refers to multiple temperature measurements of the timing circuit410or the crystal oscillator420, or a component near to either of the timing circuit410or crystal oscillator420, occurring at different times and does not imply periodic or regular temperature measurements, though periodic or regular temperature measurements may be suitable for different examples according to this disclosure.

In block520, the processor440determines a temperature gradient having a sign and a magnitude, the temperature gradient based on at least two temperature measurements of the plurality of successive temperature measurements and a time between the at least two temperature measurements. For example, the example system400shown inFIG. 4calculates a temperature gradient using two consecutive temperature measurements: a first temperature measurement and a second temperature measurement, where the first temperature measurement occurs prior to the second temperature measurement. In one implementation, the processor440subtracts the first temperature measurement from the second temperature measurement and divides the result by the time between the two measurements to obtain the gradient. However, the processor440can be configured to determine a temperature gradient based on two or more successive temperature measurements over time or two or more non-successive temperature measurements (e.g., a first and a fifth temperature measurement of a succession of five temperature measurements). For example, over more than two successive temperature samples, the processor440can calculate temperature gradients for successive pairs of temperature samples and calculate an average gradient based on the calculated temperature gradients to determine the temperature gradient having the sign and the magnitude.

In some embodiments, the processor440can employ more than two successive temperature samples to determine a temperature gradient. For example, the processor may determine a temperature gradient using three successive temperature measurements, such as by determining an average temperature gradient over such measurements. In some examples, the processor may use two or more non-consecutive temperature measurements, such as every other temperature measurement or other regularly-spaced temperature measurements. In one such example, the processor may employ every third temperature measurement based on a sampling frequency of temperature measurements. For example, if a temperature measurement is taken every 10 milliseconds, the processor440may be configured to only determine temperature gradients over time periods of 50 or 100 milliseconds, thus only certain of the temperature measurements may be employed.

In some examples, the processor440may also determine a rate of change of a temperature gradient over time such as by calculating successive temperature gradients and a difference between the successive temperature gradients. The rate of change of the temperature gradient may indicate an acceleration or deceleration of the temperature gradient, e.g., that the crystal oscillator is heating or cooling more or less quickly over time. In some examples, the processor440may employ curve fitting over a plurality of temperature measurements to compute a gradient. In one example, the processor440employs curve fitting over a plurality of successive temperature measurements, while in one example, the processor440employs curve fitting over a plurality of non-successive temperature measurements.

These and other means for determining a temperature gradient having a sign and a magnitude may be used in different examples. In this example, the processor440also determines the magnitude of the gradient and the sign of the gradient, or whether the gradient has a positive or negative slope. It should be noted that temperature gradient for purposes of this application relates to gradient with respect to time.

In block530, the processor440determines a frequency compensation parameter based on at least one or more of a temperature measurement, the sign of the temperature gradient, the magnitude of the temperature gradient, or any combination thereof. In this example, the processor440uses the temperature to access a lookup table having frequency compensation parameters corresponding to different measured temperatures. It will be understood that the temperature measurement may comprise one of the successive temperature measurements, or may be a temperature measurement taken independently of the successive temperature measurements, such as a temperature measurement taken at a specific time or sampling rate, or may be taken specifically for purposes of accessing a lookup table. In other examples, the sign of the temperature gradient or the magnitude of the temperature gradient, alone, may be used. For example, in one implementation, the processor440uses the sign of the temperature gradient to access a lookup table having frequency compensation parameters corresponding to temperature gradients having different signs. In another example, the processor440uses the magnitude of the temperature gradient to access a lookup table having frequency compensation parameters corresponding to temperature gradients of different magnitudes.

Thus, in some examples, only one of the temperature measurement, the sign of the temperature gradient, or the magnitude of the temperature gradient is used to determine a frequency compensation parameter. And while examples using lookup tables were discussed above, other examples are contemplated. For example, any one of the temperature measurement, the sign of the temperature gradient, or the magnitude of the temperature gradient may be used to calculate a variance from the first-order calculation of the vibration frequency, where the first-order calculation of the vibration frequency is based on the nominal vibration frequency of the crystal oscillator and the ideal frequency error. The variance may then be used to compute a frequency compensation parameter. In other implementations, the variance, along with the first-order calculation of the vibration frequency, is used to calculated a corrected vibration frequency, and the frequency compensation parameter is based on the nominal vibration frequency and the corrected vibration frequency.

And while some examples may employ only one of the values discussed above to determine a frequency compensation parameter, some examples may employ two. For example, in one implementation the processor440determines a frequency compensation parameter by employing at least the magnitude of the temperature gradient and the temperature to access a lookup table having frequency compensation parameters corresponding to different measured temperatures and temperature gradient magnitudes. In another example implementation, the processor440determines a frequency compensation parameter by employing the temperature measurement and the sign of the temperature gradient to access a lookup table having frequency compensation parameters corresponding to different temperatures and signs of the temperature gradient. And in a further example, the processor440determines a frequency compensation parameter by employing the magnitude of the temperature gradient and the sign of the temperature gradient to access a lookup table having frequency compensation parameters corresponding to different temperature gradient magnitudes and signs.

In some cases, the processor440may determine a frequency compensation parameter based on at least all three of the temperature gradient, the sign of the temperature gradient, and the frequency. In one example implementation, the processor440accesses a three-dimensional lookup table to determine a frequency compensation parameter. In some examples, the processor440may employ a plurality of lookup tables. For example a processor440may access a first lookup table based on the temperature measurement and the sign of the gradient, and use a resulting value from the first lookup table and the magnitude of the temperature gradient to access a second lookup table to determine a frequency compensation parameter. Thus, different examples may employ different means for determining a frequency compensation parameter based on any combination of two or more factors chosen from a set of factors including a temperature measurement, the sign of the temperature gradient, or the magnitude of the temperature gradient, including determining a frequency compensation parameter based on at least all three of the temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient. Further, some such means may comprise a means for determining the frequency compensation parameter based on a lookup table using at least the temperature measurement and the magnitude of the temperature gradient as a part of a means for determining the frequency compensation parameter. The means for determining the frequency compensation parameter may also include means for determining the frequency compensation parameter based on additional factors to those mentioned.

However, in some cases, the processor440may calculate a variance from an ideal frequency error based on the magnitude of the temperature gradient and a first-order calculation of the vibration frequency of the crystal oscillator. In this example method500, the processor440calculates a variance from an ideal frequency error by multiplying a scaling factor and a thermal gradient that has been filtered to remove noise. In another example, the processor440may calculate a first-order calculation of the corrected frequency value of the crystal oscillator using the function120shown inFIG. 1and the nominal vibration frequency, and the processor440may then use the calculated first-order value with the temperature gradient to determine the total frequency error or total variance relative to the nominal vibration frequency. In some cases, the processor440may simplify the calculation by assuming equal error or variance irrespective of the sign of the gradient. These and other means for determining a frequency compensation parameter may be employed in different examples. The processor440can then use the determined total frequency error or total variance to determine a frequency compensation parameter.

After obtaining the frequency compensation parameter, in this example the processor440determines how the frequency compensation parameter should be applied to the nominal frequency of the crystal oscillator420or the timing circuit410to adjust the frequency of the oscillation signal output by the timing circuit410. In this way, the processor440can compensate for the frequency error of the timing circuit410based on the frequency compensation parameter. For example, the frequency compensation parameter may be a value that can be a scaling factor that may be applied to a frequency divider or frequency multiplier circuit to adjust a sampling rate. In some examples, the frequency compensation parameter can be applied to a resampler to adjust a sampling rate to enable the output data to be provided at a corrected frequency. Or in some cases, the frequency compensation parameter may be applied to a phase rotator digitally.

In block540, the processor440compensates for a frequency error of the timing circuit410based on the frequency compensation parameter. For example, the processor440may cause the timing circuit410to generate an oscillation signal using the timing circuit410based on the frequency compensation parameter. For example, the timing circuit410may include a frequency multiplier or frequency divider. The processor440can cause the frequency multiplier or frequency divider to alter the signal output by the crystal oscillator420to generate an oscillation signal based on the frequency compensation parameter. However, in some embodiments, the processor440does not affect the timing circuit410, but instead provides the frequency compensation parameter to a component, such as GPS receiver, that receives the oscillation signal using the timing circuit410to allow the component to apply the frequency compensation parameter to the received oscillation signal. These and other means for compensating for a frequency error of the timing circuit410may be employed according to various examples of the disclosure herein.

Referring now toFIG. 5B,FIG. 5Bshows an example method550for compensating for hysteretic effects in crystal oscillators. The method550ofFIG. 5Bis described with reference to the example system400shown inFIG. 4, but is not limited to such a system400.

The method550begins in block560when the processor440obtains a plurality of successive temperature measurements from the temperature sensor430. This process is described above with respect to block510shown inFIG. 5A. After the processor440obtains a plurality of successive temperature measurements, the method550proceeds to block570.

At block570, the processor440determines a temperature gradient having a sign and a magnitude, the temperature gradient being based on at least two temperature measurements of the plurality of successive temperature measurements and a time between the at least two temperature measurements. This process is described above with respect to block520shown inFIG. 5A. After the processor440determines a temperature gradient, the method550proceeds to block580.

At block580, the processor440determines a frequency compensation parameter based on any combination of two or more factors chosen from a set of factors including a temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient. This process is described above with respect to block530shown inFIG. 5A. After the processor440determines a temperature gradient, the method550proceeds to block590.

At block590, the processor440compensates for a frequency error of the timing circuit based on the frequency compensation parameter. This process is described above with respect to block540shown inFIG. 5A. After the processor440determines a temperature gradient, the method550may end, or the method550may return to block560for a further iteration.

Referring now toFIG. 6,FIG. 6shows an example method600for compensating for hysteretic effects in crystal oscillators. The method600ofFIG. 6is described with reference to the example system400shown inFIG. 4, but is not limited to such a system400.

The method600begins in block610when the processor440obtains a plurality of successive temperature measurements from the temperature sensor430. This process is described above with respect to block510shown inFIG. 5A. In addition, if this is the first iteration of the method, a counter value is set to 0. The counter will be described in greater detail below. After the processor440obtains a plurality of successive temperature measurements, the method600proceeds to block620.

At block620, the processor440determines a temperature gradient having a sign and a magnitude, the temperature gradient based on the plurality of successive temperature measurements, the temperature measurements being received from a temperature sensor thermally coupled to the oscillation crystal. This process is described above with respect to block520shown inFIG. 5A. After the processor440determines a temperature gradient, the method600proceeds to block622.

At block622, the processor440determines whether the temperature gradient has a different sign during the then-current iteration of the method600as compared to the sign of the temperature gradient during the prior iteration of the method600. If the sign of the gradient has not changed, the method proceeds to630. However, if the sign of the gradient has changed, the method proceeds to block624.

At block624, the processor440resets the counter. As will be discussed in more detail below, the counter may be used to affect the maximum amount the current frequency compensation may be changed. Thus, for time periods shortly after a change in sign of the temperature gradient, the processor440may be allowed to change a frequency compensation by a greater amount than would be allowed after a period of time has elapsed. The method then proceeds to block630.

At block630, the processor440increments the counter and determines whether it exceeds a reference threshold value. In this example, the counter (which is discussed in greater detail below) and threshold value are employed to determine whether a greater or lesser correction should be applied to the oscillation signal. In some examples, if a magnitude of frequency error due to hysteretic effects in a timing circuit410exceeds a maximum incremental frequency compensation value, the processor440will apply an incremental frequency compensation to the oscillation signal that is configured to only partially correct for the frequency error. For example, if a frequency error does not exceed the maximum incremental frequency compensation value, the processor440may fully compensate for the frequency error in one iteration of the example method600. However, if the frequency error exceeds the maximum incremental frequency compensation value, the processor440may apply a maximum incremental frequency compensation, which only partially compensates for the determined frequency error. Thus, a full correction based on the determined frequency error may be applied over multiple iterations.

Further, in some examples, different maximum incremental frequency compensation values may be employed based on an elapsed period of time. In one example, if the processor440determines that the timing circuit410has recently begun to experience significant heating or cooling, it may allow for larger incremental changes in frequency compensation, but after the heating or cooling has continued for some period of time, a smaller maximum incremental frequency compensation value may be employed.

In some examples, the processor440may employ one or more maximum incremental frequency compensation values based on the magnitude of the temperature gradient. For example, where the magnitude of the temperature gradient exceeds a first threshold value, the processor440may use a greater maximum incremental frequency compensation value, and a lower maximum incremental frequency compensation value if the temperature gradient is below the threshold value. One such example may thus more quickly correct for rapid heating or cooling of the timing circuit410, e.g., due to cellular phone call, and reduce the rate of correction for gradual heating or cooling, such as due to changing environment conditions.

In the example illustrated inFIG. 6, the processor440selects between two maximum incremental frequency compensation values based on whether the counter exceeds a threshold counter value. If the counter value is below the threshold counter value, the processor440uses the first maximum incremental frequency compensation value, which is greater than the second maximum incremental frequency compensation value. Thus, while the counter is below the threshold counter value, the processor440may apply greater incremental frequency compensation. After the counter exceeds the threshold counter value, the processor440uses the second maximum incremental frequency compensation value. In this example, the method600iterates approximately every 100 milliseconds (“ms”), however, in other examples, the method600may iterate at greater or lesser rates. Further, in this example, the threshold counter value is set to 20, indicating that the processor440will employ the first maximum incremental frequency compensation value for up to approximately two seconds from the last time the counter was reset (as discussed above with respect to blocks622and624), after which, the processor440will employ the second maximum incremental frequency compensation value.

It should be noted that while the processor440may determine a frequency compensation based on an amount that is equal to a first or second maximum incremental frequency compensation value and based on the threshold counter value, in some examples, the processor440may determine a frequency compensation that is less than one or more maximum incremental frequency compensation values, or in some examples, the processor440may not employ one or more incremental frequency compensation values, and may instead determine the frequency compensation based on a determined frequency error of the timing circuit410. In this example, the processor440may determine a frequency compensation parameter based on an amount that is less than the selected maximum incremental frequency compensation value. For example, if the threshold counter value has not yet been reached and the measured frequency error would require a frequency compensation that is less than the first maximum incremental frequency compensation value, the processor440changes the frequency compensation by the determined frequency compensation. The above algorithms described additional means for determining a frequency compensation based on any combination of two or more factors chosen from a set of factors including a temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient. And in some examples, the processor440may determine a frequency compensation based on any combination of two or more factors selected from a group consisting of the temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient.

In this example, if the counter exceeds the threshold counter value, the method600proceeds to block632, otherwise the method600proceeds to block634.

At block632, the processor440determines a frequency compensation parameter based on any combination of two or more factors of a temperature measurement, the sign of the temperature gradient, or the magnitude of the temperature gradient, such as described above with respect to block530ofFIG. 5A. It is understood that the frequency compensation parameter may also be further based on additional factors in this or other implementations. In addition, the processor440maintains the current amount of frequency compensation applied to the oscillation signal. For example, in previous iterations of the method600, the processor440may have applied a frequency compensation to the oscillation signal; however, additional frequency compensation may be needed, or the current frequency compensation may need to be reduced. Thus, the processor440determines a desired frequency compensation and then determines the difference between the desired frequency compensation and the current frequency compensation. If the difference is less than the second maximum incremental frequency compensation value, the processor440determines that the current frequency compensation should be changed by applying the full difference to arrive at a current frequency compensation, resulting in a difference of 0 between the desired frequency compensation and the current frequency compensation. However, if the difference is greater than the second maximum incremental frequency compensation value, the processor440applies the second maximum incremental frequency compensation value to the current frequency compensation, which will result in a non-zero difference between the desired frequency compensation and the current frequency compensation. This difference may be addressed in a further iteration of the method600. After the current frequency compensation is determined, the method proceeds to block640.

At block634, similar to block632, the processor440determines a frequency compensation parameter based on any combination of two or more parameters of a temperature measurement, the sign of the temperature gradient, or the magnitude of the temperature gradient, such as described above with respect to block530ofFIG. 5A. As discussed with respect to632, the processor440maintains the current frequency compensation applied to the oscillation signal, determines a desired frequency compensation, and then determines the difference between the desired frequency compensation and the current frequency compensation. In block634, however, the processor440employs the first incremental frequency compensation value. Thus, if the difference is less than the first maximum incremental frequency compensation value, the processor440determines that the current frequency compensation should be changed by applying the difference, resulting in a difference of 0 between the desired frequency compensation and the current frequency compensation. However, if the difference is greater than the first maximum incremental frequency compensation value, the processor440applies the first maximum incremental frequency compensation value to the current frequency compensation, which will result in a non-zero difference between the desired frequency compensation and the current frequency compensation. As discussed above, this difference may be addressed in a further iteration of the method600. The functionality of blocks622-634provides various means for determining a frequency compensation parameter based on any combination of two or more factors chosen from a temperature measurement, the sign of the temperature gradient, and the magnitude of the temperature gradient, though others would be readily apparent to one of skill in the art. After the current frequency compensation is determined, the method proceeds to block640.

At block640, the processor440compensates for a determined frequency error of the timing circuit410based on the frequency compensation parameter. For example, and as discussed above with respect to block540of the method500shown inFIG. 5A, the timing circuit410may include a frequency multiplier or frequency divider. The processor440can cause the frequency multiplier or frequency divider to alter the signal output by the crystal oscillator420to generate an oscillation signal based on the current frequency compensation. However, in some embodiments, the processor440does not affect the timing circuit410, but instead provides the current frequency compensation to a component, such as GPS receiver, that receives the oscillation signal using the timing circuit410to allow the component to apply the current frequency compensation to the received oscillation signal. These and other means for compensating for a determined frequency error of the timing circuit410may be employed according to various examples of the disclosure herein.

Such processors may comprise, or may be in communication with, media, for example non-transitory computer-readable media, that may store instructions that, when executed by the processor, can cause the processor to perform the steps described herein as carried out, or assisted, by a processor. Embodiments of computer-readable media may comprise, but are not limited to, an electronic, optical, magnetic, or other storage device capable of providing a processor, such as the processor in a web server, with computer-readable instructions. Other examples of media comprise, but are not limited to, a floppy disk, CD-ROM, magnetic disk, memory chip, ROM, RAM, ASIC, configured processor, all optical media, all magnetic tape or other magnetic media, or any other medium from which a computer processor can read. The processor, and the processing, described may be in one or more structures, and may be dispersed through one or more structures. The processor may comprise code for carrying out one or more of the methods (or parts of methods) described herein.

Reference herein to an embodiment, example, or implementation means that a particular feature, structure, operation, or other characteristic described in connection with the embodiment may be included in at least one implementation of the disclosure. The disclosure is not restricted to the particular embodiments, examples, or implementations described as such. The appearance of the phrases “in one embodiment,” “in an embodiment,” “in one example,” or “in an example, “in one implementation,” or “in an implementation,” or variations of the same in various places in the specification does not necessarily refer to the same embodiment, example, or implementation. Any particular feature, structure, operation, or other characteristic described in this specification in relation to one embodiment, example, or implementation may be combined with other features, structures, operations, or other characteristics described in respect of any other embodiment, example, or implementation.