Frequency measurement circuit with adaptive accuracy
11496139 · 2022-11-08
Assignee
Inventors
Cpc classification
H03L7/099
ELECTRICITY
H03L7/093
ELECTRICITY
H03L2207/06
ELECTRICITY
H03L7/1075
ELECTRICITY
H03L7/085
ELECTRICITY
International classification
H03L7/099
ELECTRICITY
H03L7/093
ELECTRICITY
Abstract
A frequency measurement circuit includes a counter circuit to receive a first digitally-controlled oscillator (DCO) clock signal corresponding to a first DCO input codeword and a measurement signal. The counter circuit is responsive to the measurement signal to generate a count representing a measured frequency of the first DCO clock signal. A control circuit is configured to selectively adjust a parameter of the measurement signal for generating a second count of a second DCO clock signal corresponding to a second DCO codeword. The control circuit selectively adjusts the parameter based on a received control signal.
Claims
1. A frequency measurement circuit, comprising: a counter circuit to receive a first digitally-controlled oscillator (DCO) clock signal corresponding to a first DCO input codeword and a measurement signal, the counter circuit responsive to the measurement signal to generate a count representing a measured frequency of the first DCO clock signal; and a control circuit configured to selectively adjust a parameter of the measurement signal for generating a second count of a second DCO clock signal corresponding to a subsequently selected DCO input codeword, the control circuit to selectively adjust the parameter based on a received control signal.
2. The frequency measurement circuit of claim 1, wherein: the parameter comprises a timing parameter associated with the measurement signal.
3. The frequency measurement circuit of claim 2, wherein: the timing parameter comprises a timing interval over which the measurement signal is asserted.
4. The frequency measurement circuit of claim 3, wherein: the counter circuit is responsive to the measurement signal to generate the count solely during the timing interval over which the measurement signal is asserted.
5. The frequency measurement circuit of claim 1, wherein the control circuit further comprises: a summing circuit to receive the count and a target frequency value, and wherein the control signal comprises a value representing a difference between the measured count and a target count corresponding to the target frequency value.
6. The frequency measurement circuit of claim 1, wherein: the control circuit adjusts the parameter in response to the control signal exceeding a threshold value.
7. The frequency measurement circuit of claim 1, wherein: the counter circuit is configured to count rising edges of the DCO clock signal in response to receiving the measurement signal.
8. A method, comprising: receiving a first digitally-controlled oscillator (DCO) clock signal corresponding to a first DCO input codeword and a measurement signal with a counter circuit; generating a count representing a measured frequency of the first DCO clock signal in response to the measurement signal; and selectively adjusting a parameter of the measurement signal with a control circuit for generating a second count of a second DCO clock signal corresponding to a subsequently selected DCO input codeword, the selectively adjusting of the parameter based on a received control signal.
9. The method according to claim 8, wherein the parameter comprises a timing parameter associated with the measurement signal.
10. The method according to claim 9, wherein the timing parameter comprises a timing interval over which the measurement signal is asserted.
11. The method according to claim 10, wherein the generating of the count is carried out solely during the timing interval over which the measurement signal is asserted.
12. The method according to claim 8, wherein the selectively adjusting further comprises: summing the count and a target count corresponding to a target frequency value to generate a difference value; and wherein the control signal comprises the difference value.
13. The method according to claim 8, wherein the selectively adjusting further comprises: adjusting the parameter in response to the control signal exceeding a threshold value.
14. The method according to claim 8, wherein the generating of the count further comprises: counting rising edges of the DCO clock signal in response to receiving the measurement signal.
15. A method of searching for a digitally-controlled oscillator codeword corresponding to a target frequency value, the method comprising: selecting an initial DCO codeword to generate a corresponding initial DCO clock signal; generating a first frequency measurement signal having a first measurement interval, the measurement interval enabling a frequency measurement of the first DCO clock signal with a first accuracy during the measurement interval; performing the frequency measurement during the first measurement interval to generate a measured frequency value; and selectively adjusting the measurement interval to an adjusted interval for a subsequently selected DCO codeword based on a control signal, the adjusted interval having an associated accuracy that is different than the initial accuracy.
16. The method of claim 15, wherein the measured frequency value comprises a count that is generated during the first measurement interval.
17. The method of claim 15, wherein the control signal comprises: a difference value between the measured frequency value and an expected frequency value corresponding to the target frequency.
18. The method of claim 17, wherein the adjusting of the measurement interval further comprises: adjusting the measurement interval to an adjusted interval for a subsequently selected DCO codeword based on a control signal exceeding a threshold value.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) Embodiments of the disclosure are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
DETAILED DESCRIPTION
(14) Embodiments of locked-loop circuits and methods are provided. In one embodiment, a method of operation in a locked-loop circuit. The locked-loop circuit includes a loop filter and a digitally-controlled oscillator (DCO). The loop filter includes a first input to receive a digital word representing a difference between a reference clock frequency and a DCO output frequency. The loop filter includes internal storage. The method includes selecting a desired DCO output frequency that is generated in response to a calibration DCO codeword. A start value is retrieved from the loop filter internal storage. The start value corresponds to the calibration DCO codeword. The locked-loop circuit is then started with the retrieved start value.
(15)
(16) With continued reference to
(17) Further referring to
(18) With continued reference to
(19) In some situations, an expected frequency resulting from application of the selected DCO codeword differs significantly from an actual frequency. This is often the case for physical implementations of the PLL on an actual semiconductor chip.
(20) Generally, for one embodiment, the DCO gain normalization process determines the run-time scaling factor, K.sub.scale that may be applied to the PLL loop filter gain constants, K.sub.i and K.sub.p, to map them to a nominal or expected DCO gain that was used to calculate the unmodified K.sub.i and K.sub.p values. This mapping of the run-time constants to the nominal gain eliminates or significantly reduces the gain variation associated with PVT (process, voltage, and temperature). The DCO gain normalization may be simplified based upon the following assumptions:
(21) i) The nominal and measured gain curves are linear, or approximately linear.
(22) ii) Being within a predefined percentage of error is acceptable.
(23) iii) That the minimum counter value for all gain curves corresponds to a zero frequency value, and can be approximated to being the same without a significant loss in accuracy.
(24)
(25) Once the DCO operating point has been determined, at 304 (
count=output frequency/input frequency(e.g. 4 GHz/25 MHz=160)
where: “output frequency” is the frequency of the PLL output signal, and “input frequency” is the frequency of the reference clock signal.
Or equivalently:
count=DCO gain*DCO/input frequency
(26) Further, the count value may be viewed as equivalent to a frequency control word, FCW, that is used in a closed loop mode. The FCW is often defined by a setting in the DCO register, such as at 120, whereas during calibration the FCW is determined by the DCO setting. As a result, the relationship above becomes:
FCW.sub.cal=DCOgain.sub.nom*DCO.sub.cal/input frequency (1)
The nomenclature “FCW” instead of “counter” is thus used in the following discussion for clarity purposes, especially in a context involving frequency acquisition, more fully discussed below. Additionally, the input frequency may be represented as F.sub.ref/FCWDIV.sub.cal, where FCWDIV.sub.cal defines the external frequency division value that divides down the input reference frequency. The relationship then becomes:
FCW.sub.cal=DCOgain.sub.nom*DCO.sub.cal*FCWDIV.sub.cal/F.sub.ref
(27) In the above equation, all variables are known except for DCOgain.sub.nom/F.sub.ref which is used to perform the calibration, so it may be supplied by a run-time register variable stored in, for example, the register storage 120. This may be carried out in step 306 of
(28) After determining an optimal DCO calibration codeword, and utilizing the calibration setting, the FCW.sub.cal value is measured to match the nominal gain based upon equation (1) above. However, due to the PVT variation, a different counter value is measured, called FCW.sub.measured. The K.sub.scale variable may then be determined, at step 310 of
K.sub.scale=FCW.sub.measured/FCW.sub.cal
(29) A straightforward lookup table stored in storage 118 may be employed for the 1/X relationship exhibited by the above equation, while other implementations for 1/X may be logic based. Note that the K.sub.scale variable is specific to the DCO gain in the system, so even if the FCWDIV variable is changed, the K.sub.scale value does not change.
(30) For one embodiment, to minimize the PLL lock time, the approximate DCO codeword is determined when the PLL is locked, represented by the variable DCO.sub.acq, and the output DCO clock phase is set to match the input phase. The DCO setting for frequency acquisition is calculated by scaling the DCO codeword setting that was found in normalization. The scaling accounts for the PVT variation, K.sub.scale and the different operating frequency defined by the variable FCW.sub.acq. The DCO acquisition value may be determined via the following relationship:
DCO.sub.acq=1/K.sub.scale*FCW.sub.acq/FCW.sub.cal*FCWDIV.sub.cal/FCWDIV.sub.acq*DCO.sub.cal
(31) By using the same FCWDIV value for both the calibration and acquisition and substituting for K.sub.scale, the following expression may be derived:
DCO.sub.acq=FCW.sub.cal/FCW.sub.measured*FCW.sub.acq/FCW.sub.cal*DCO.sub.cal
Which simplifies to:
DCO.sub.acq=FCW.sub.acq/FCW.sub.measured*DCO.sub.cal
(32) In the above equation, FCW.sub.acq is the user's operational FCW value, so this is a straightforward calculation but requires the same 1/X calculation that was used previously.
(33) Generally, in most cases, a user will calibrate with the same FCWDIV as during the frequency acquisition. If this is not the case, then an additional scale factor should be added during frequency acquisition to account for the change in FCWDIV:
DIV.sub.scale=FCWDIV.sub.cal/FCWDIV.sub.acq
Using this additional scale factor, we get:
DCO′.sub.acq=DIV.sub.scale*DCO.sub.acq
(34) For one embodiment, and with continued reference to
(35) As explained above, the approximate locked PLL frequency is pre-determined and used to start the PLL, at 312, and the DCO started at an almost zero phase error relative to the reference clock, at 314. Mechanically, this means that we set the DCO codeword to DCO.sub.acq and set the DCO phase to match the phase of the reference clock. Simulations indicate that we can lock in less than 30 reference clock cycles, whereas without this acquisition logic the lock time is approximately 90 reference clock cycles with our digital implementation. Most other PLL design implementations lock in many hundreds of clock cycles.
(36) In a further embodiment, an alternative DCO gain normalization process may be carried out that has added flexibility over the embodiments described above. Specifically, the following discussion describes a DCO gain normalization process that may be accomplished even if a DCO codeword of “zero” corresponds to a frequency other than zero.
(37) Referring now to
(38) Alternatively, and further referring to
(39) For some embodiments, when performing the binary search, the state machine assumes that a higher DCO codeword corresponds to a higher output frequency. If it ever finds that a higher frequency causes a lower DCO count value, then it assumes that this is due to a timing violation and it stops the search and uses the previously valid “lower limit” value.
(40) Once the operating point is determined, a slope of the DCO curve at the operating point is calculated. This represents the gain of the DCO at the operating point. The gain is the change in the DCO output frequency for each step in the DCO code. For one embodiment, this involves selecting a DCO codeword value that is “N” DCO codeword values away from the operating point, and driving the DCO with the offset codeword value. This is done to increase the difference in counts and to average the slope of the curve through a wider portion of the gain curve. The count value for the frequency associated with the offset codeword value is then determined, and the slope “m.sub.actual” determined, at 414, by the following relationship:
m.sub.actual=(count.sub.op−count.sub.offset)/(offset*clkref.sub.cycles)
where: count.sub.op is the number of DCO counts at the operating point frequency, count.sub.offset is the number of DCO counts at the DCO code that is offset from the operating point frequency, offset is the difference in the DCO codeword values at the operating point and the offset, and clkref.sub.cycles is the number of clkref cycles over which the DCO counter runs.
(41) For one embodiment, in order to measure the frequency of the DCO at each code, the processing circuitry of the loop filter measures the number of DCO counts that have occurred in a given number of “m” reference clock cycles. In one specific embodiment, the processing circuitry may average the number of counts running on the oscillator clock over sixteen reference clock cycles. The number of counts thus measures how far a counter running on the DCO clock has advanced during the m reference cycles, and accounts for wrap-around in the counter running on the DCO clock.
(42) Once the slope of the actual frequency curve has been calculated, the scaling factor k.sub.scale may then be calculated, at 416, by taking the ratio of m.sub.nominal to m.sub.actual, where m.sub.nominal is the ratio of the DCO frequency change to the change in DCO codeword, and represents the difference in the number of DCO counts that should occur per DCO codeword difference, in other words, the slope of the DCO frequency curve. In specific implementations, the value for m.sub.nominal is a fixed point number with fractional precision as defined by system parameters. In general, the greater the slope of the true frequency curve as compared to the nominal curve, the smaller the scaling factor k.sub.scale.
(43) Once the scaling factor is determined, it may then be applied to the loop filter control coefficients Ki and Kp, at 418, to generate normalized loop filter coefficients as substitutes for the nominal ones. As noted above, the loop filter includes storage that allows for configurability or programmability of loop filter coefficients such as the integral and proportional coefficients Ki and Kp. The internal storage of the loop filter may also store a start value, derived from the calibration DCO control word determined from the above steps. The start value may correspond to the calibration DCO code word such that it matches the value to the codeword, or forms a fractional value of the DCO codeword, for example. Nominal values for the integral and proportional coefficients Ki and Kp may generally be programmed prior to the initialization process described above. By applying the scaling factor to those nominal values, scaled or calibrated values for Ki and Kp may be used as replacements for the nominal values, thereby normalizing the DCO gain for the PLL.
(44) For some embodiments, the gain curve is only normalized in a region of the operating point. This reduces the time needed to perform the initialization process. Other embodiments may normalize the entire curve and store the normalized coefficient values and/or the K.sub.SCALE factor for future use. This would effectively map the curve and allow for quick locking when changing from one frequency to another.
(45) Once the scaling factor has been calculated and applied to the loop filter coefficients, the PLL may be operated to go into a locked state almost immediately, in a similar manner as that described above. With continued reference to
(46) By locking the PLL in this manner, the control loop is effectively locked immediately since the correct frequency has been selected via the calibration DCO control word found during normalization, and the phase error is forcibly reduced close to zero. In addition, by starting the control loop close to its quiescent state, it does not require time to ramp up to the point at which the internal loop filter accumulators contain their steady-state values (the quiescent state). Setting the internal loop filter phase to match the output clock phase allows for zeroing out of the phase error, while also not altering the phase of the output clock generated by the oscillator. In this way, a jump to a locked state may be accomplished without changing the phase of the output clock.
(47)
(48) For some embodiments, the frequency search methods described above may be further enhanced by adaptively varying one or more accuracy parameters during the search. For instance, during the early stages of the DCO calibration frequency search, the DCO frequency generally highly deviates from the desired frequency. For such circumstances, only a low accuracy measurement is needed. As the DCO frequency approaches the desired frequency, a more accurate frequency measurement is desired to detect the difference between the current frequency and the desired frequency. However, increasing the accuracy of the measurement correspondingly increases the frequency search time.
(49)
(50) Further referring to
(51)
(52) As shown in
(53)
(54)
(55) For some embodiments, the frequency search may be aided by circuitry that is capable of detecting timing violations during the search. In some situations, the counter circuitry used to measure the DCO output frequency may be susceptible to timing violations, possibly causing the counter circuitry to produce random results that are outside the range of expected results. One example involves a situation where a subsequent codeword that is higher than a previous codeword is measured as having a frequency that is lower than the previous codeword (with an expectation that higher codewords are associated with higher frequencies). Such results typically force the search to restart. Consequently, many frequency search techniques employ a “slower” algorithm to reduce the risks of timing violations.
(56)
(57) Further referring to
(58) With continued reference to
(59) Further referring to
(60) The frequency counter circuit 1000 described above provides a relatively wide detection range. As long as the respective pre-divider circuits 1006 and 1010 are able to function at maximum DCO frequencies across all process-voltage-temperature (PVT) variations, one can choose an appropriate value for “m” such that any timing violations within the DCO frequency range can be detected. This greatly relaxes design constraints for the counter circuitry, since one need only design counters for the maximum targeted DCO frequency, rather than the entire DCO frequency range across the PVT variations. More importantly, faster and wider range frequency search algorithms may be used without the risk of measurement errors due to frequency overshoot.
(61) In the foregoing description and in the accompanying drawings, specific terminology and drawing symbols have been set forth to provide a thorough understanding of the present invention. In some instances, the terminology and symbols may imply specific details that are not required to practice the invention. For example, any of the specific numbers of bits, signal path widths, signaling or operating frequencies, component circuits or devices and the like may be different from those described above in alternative embodiments. Also, the interconnection between circuit elements or circuit blocks shown or described as multi-conductor signal links may alternatively be single-conductor signal links, and single conductor signal links may alternatively be multi-conductor signal links. Signals and signaling paths shown or described as being single-ended may also be differential, and vice-versa. Similarly, signals described or depicted as having active-high or active-low logic levels may have opposite logic levels in alternative embodiments. Component circuitry within integrated circuit devices may be implemented using metal oxide semiconductor (MOS) technology, bipolar technology or any other technology in which logical and analog circuits may be implemented. With respect to terminology, a signal is said to be “asserted” when the signal is driven to a low or high logic state (or charged to a high logic state or discharged to a low logic state) to indicate a particular condition. Conversely, a signal is said to be “deasserted” to indicate that the signal is driven (or charged or discharged) to a state other than the asserted state (including a high or low logic state, or the floating state that may occur when the signal driving circuit is transitioned to a high impedance condition, such as an open drain or open collector condition). A signal driving circuit is said to “output” a signal to a signal receiving circuit when the signal driving circuit asserts (or deasserts, if explicitly stated or indicated by context) the signal on a signal line coupled between the signal driving and signal receiving circuits. A signal line is said to be “activated” when a signal is asserted on the signal line, and “deactivated” when the signal is deasserted. Additionally, the prefix symbol “/” attached to signal names indicates that the signal is an active low signal (i.e., the asserted state is a logic low state). A line over a signal name (e.g., ‘
(62) While the invention has been described with reference to specific embodiments thereof, it will be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. For example, features or aspects of any of the embodiments may be applied, at least where practicable, in combination with any other of the embodiments or in place of counterpart features or aspects thereof. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.