CN112636752A - Oscillator device and oscillator frequency calibration method - Google Patents

Oscillator device and oscillator frequency calibration method Download PDF

Info

Publication number
CN112636752A
CN112636752A CN202011594284.3A CN202011594284A CN112636752A CN 112636752 A CN112636752 A CN 112636752A CN 202011594284 A CN202011594284 A CN 202011594284A CN 112636752 A CN112636752 A CN 112636752A
Authority
CN
China
Prior art keywords
target
oscillator
count value
frequency
oscillator signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011594284.3A
Other languages
Chinese (zh)
Inventor
南炳在
郑永一
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Eswin Computing Technology Co Ltd
Original Assignee
Beijing Eswin Computing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Eswin Computing Technology Co Ltd filed Critical Beijing Eswin Computing Technology Co Ltd
Priority to CN202011594284.3A priority Critical patent/CN112636752A/en
Publication of CN112636752A publication Critical patent/CN112636752A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION, OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • H03L7/06Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
    • H03L7/16Indirect frequency synthesis, i.e. generating a desired one of a number of predetermined frequencies using a frequency- or phase-locked loop
    • H03L7/18Indirect frequency synthesis, i.e. generating a desired one of a number of predetermined frequencies using a frequency- or phase-locked loop using a frequency divider or counter in the loop
    • H03L7/197Indirect frequency synthesis, i.e. generating a desired one of a number of predetermined frequencies using a frequency- or phase-locked loop using a frequency divider or counter in the loop a time difference being used for locking the loop, the counter counting between numbers which are variable in time or the frequency divider dividing by a factor variable in time, e.g. for obtaining fractional frequency division

Abstract

The invention provides an oscillator device and an oscillator frequency calibration method. The oscillator device includes: a reference oscillator for outputting a reference oscillator signal; a target oscillator for outputting a target oscillator signal; the counting module is used for counting the period of the target oscillator signal within the time length from the period of the reference oscillator signal to a preset counting value to obtain a first counting value; the comparison module is used for comparing the first count value with a target count value to obtain a comparison result; the correction module is used for correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result; wherein the frequency of the reference oscillator signal is lower than the frequency of the target oscillator signal. According to the oscillator device provided by the embodiment of the invention, the target oscillator signal tracks the reference oscillator signal, so that the frequency fluctuation of the target oscillator signal can be reduced, and the target oscillator does not need to use an interface clock, so that the load is lower and the power consumption is lower.

Description

Oscillator device and oscillator frequency calibration method
Technical Field
The invention relates to the technical field of oscillators, in particular to an oscillator device and an oscillator frequency calibration method.
Background
Clocks have an important role in digital circuits, and digital signals require clock pulses to control the reception and transmission of data. Therefore, a high-precision and high-stability clock signal is important. However, in the working process of the oscillator, the frequency of the oscillator deviates from the original oscillation frequency due to the change of the ambient environment and the application temperature, so that a large error is generated in the frequency of the oscillator, and the display effect of the display panel is finally affected.
Disclosure of Invention
In view of the above, the present invention provides an oscillator device and an oscillator frequency calibration method, which can solve the problem in the prior art that an oscillator is easily affected by external environment changes, and thus a large error is generated in the frequency of an output clock signal.
In order to solve the technical problems, the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides an oscillator apparatus, including:
a reference oscillator for outputting a reference oscillator signal;
a target oscillator for outputting a target oscillator signal;
the counting module is used for counting the period of the target oscillator signal within the time length from the period of the reference oscillator signal to a preset counting value to obtain a first counting value;
the comparison module is used for comparing the first count value with a target count value to obtain a comparison result;
the correction module is used for correcting the frequency of a target oscillator signal output by the target oscillator according to the comparison result;
wherein the frequency of the reference oscillator signal is lower than the frequency of the target oscillator signal.
Optionally, the target count value is equal to a target output frequency of the target oscillator multiplied by the preset count value and divided by a frequency of the reference oscillator signal.
Optionally, the comparing module includes:
a calculating unit for calculating a difference between the first count value and a target count value;
the oscillator device further includes:
and the error control module is used for controlling the correction module to correct the frequency of the target oscillator signal output by the target oscillator under the condition that the difference value exceeds a preset error range, and controlling the correction module to stop correcting the frequency of the target oscillator signal output by the target oscillator under the condition that the difference value does not exceed the preset error range.
Optionally, the modification module includes:
a first correction unit configured to increase a frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value, when the first count value is smaller than the target count value;
a second correction unit configured to decrease the frequency of the target oscillator signal output by the target oscillator until the first count value is equal to the target count value, when the first count value is greater than the target count value.
Optionally, the method further includes:
and the tracking step length setting module is used for setting a tracking step length according to the comparison result, and the tracking step length is used for determining the correction amplitude of the correction module when the frequency of the target oscillator signal output by the target oscillator is corrected.
Optionally, the tracking step size is:
ERVAL=A*|(N-K)|,
wherein, ERVALAnd for the tracking step length, A is a preset coefficient, N is the target counting value, and K is the first counting value.
Another embodiment of the present invention provides an oscillator frequency calibration method, including:
counting the period of a target oscillator signal output by a target oscillator within the time length from the period counting of a reference oscillator signal output by a reference oscillator to a preset counting value to obtain a first counting value;
comparing the first count value with a target count value to obtain a comparison result;
comparing the first count value with a target count value to obtain a comparison result;
correcting the frequency of a target oscillator signal output by the target oscillator according to the comparison result;
wherein the frequency of the reference oscillator signal is lower than the frequency of the target oscillator signal.
Optionally, the target count value is equal to a target output frequency of the target oscillator multiplied by the preset count value and divided by a frequency of the reference oscillator signal.
Optionally, the comparing the first count value with the target count value to obtain a comparison result includes:
calculating a difference value between the first count value and a target count value;
the correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result comprises:
and correcting the frequency of the target oscillator signal output by the target oscillator under the condition that the difference value exceeds a preset error range.
Optionally, the modifying, according to the comparison result, the frequency of the target oscillator signal output by the target oscillator includes:
increasing the frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value, if the first count value is less than the target count value;
in the case where the first count value is greater than the target count value, decreasing the frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value.
Optionally, the method further includes:
and setting a tracking step length according to the comparison result, wherein the tracking step length is used for determining the correction amplitude when the frequency of the target oscillator signal output by the target oscillator is corrected.
Optionally, the tracking step size is:
ERVAL=A*|(N-K)|,
wherein, ERVALAnd for the tracking step length, A is a preset coefficient, N is the target counting value, and K is the first counting value.
The technical scheme of the invention has the following beneficial effects:
according to the oscillator device provided by the embodiment of the invention, the target oscillator signal tracks the reference oscillator signal, so that the frequency fluctuation of the target oscillator signal can be reduced, and the target oscillator does not need to use an interface clock, so that the load is lower and the power consumption is lower.
Drawings
Fig. 1 is a schematic structural diagram of an RC oscillator in the prior art;
FIG. 2 is a schematic diagram of a high-speed oscillator using a phase-locked loop in the prior art;
fig. 3 is a schematic structural diagram of an oscillator device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a preset error range of a target oscillator according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a first count value according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of tracking steps provided by an embodiment of the present invention;
fig. 7 is a flowchart illustrating an oscillator frequency calibration method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the drawings of the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the invention, are within the scope of the invention.
Fig. 1 is a schematic diagram of an RC oscillator in the prior art. As shown in fig. 1, the general RC oscillator has the advantages of a simple principle, a small size, and low power consumption, but when a clock with a high frequency is output, the frequency change due to temperature is large.
Fig. 2 is a schematic diagram of a high-speed oscillator using a phase-locked loop in the prior art. As shown in fig. 2, a conventional high-speed oscillator using a Phase Locked Loop (PLL) includes a Phase detector, a charge pump, a Loop filter, a voltage controlled oscillator, a frequency divider, etc., which has a complex principle and has advantages of small frequency variation of an output clock signal and real-time tracking of an output frequency, but such an oscillator has a large size and high power consumption, and in a display system, the PLL is over-designed, which may cause an increase in cost.
Therefore, please refer to fig. 3, which is a schematic structural diagram of an oscillator device according to an embodiment of the present invention. As shown in fig. 3, an oscillator device provided in an embodiment of the present invention may include:
a reference oscillator 31 for outputting a reference oscillator signal;
a target oscillator 32 for outputting a target oscillator signal;
the counting module 33 is configured to count the period of the target oscillator signal within a time period from the period of the reference oscillator signal to a preset count value, so as to obtain a first count value;
a comparing module 34, configured to compare the first count value with a target count value to obtain a comparison result;
a correcting module 35, configured to correct a frequency of a target oscillator signal output by the target oscillator according to the comparison result;
wherein the frequency of the reference oscillator signal is lower than the frequency of the target oscillator signal.
In the embodiment of the present invention, the frequency of the reference oscillator signal output by the reference oscillator 31 is low and is almost negligibly affected by the environmental conditions (such as temperature), and after the reference oscillator signal whose frequency is set to a given value is output by the reference oscillator 31, it can be considered that the frequency of the reference oscillator signal output by the reference oscillator 31 will remain unchanged. The frequency of the target oscillator is high and is easily affected by the environmental conditions (such as temperature) in which the target oscillator 32 is set to output a target oscillator signal having a given frequency, and the frequency of the target oscillator signal fluctuates if the temperature of the target oscillator is increased or decreased.
In some embodiments of the invention, the lower the frequency of the reference oscillator signal within a certain frequency range, the higher the confidence of the reference. The reference oscillator signal may be a low-speed clock signal, and the target oscillator signal may be a high-speed clock signal.
In the embodiment of the present invention, the reference oscillator signal output by the reference oscillator 31 is sent to the counting module 33 for counting, and the target oscillator signal output by the target oscillator 32 is also sent to the counting module 33 for counting, where the counting module 33 counts the period of the input signal. The counting value of the reference oscillator signal may be preset, so that the period of the target oscillator signal is also synchronously counted within a time period from the period counting of the reference oscillator signal to the preset counting value to obtain a first counting value, that is, the target oscillator signal is also counted while the period counting of the reference oscillator signal is started, and the counting of the reference oscillator signal and the target oscillator signal is stopped when the period counting value of the reference oscillator signal is preset to obtain the first counting value of the period of the target oscillator signal within the period.
In the embodiment of the present invention, the comparing module 34 is configured to compare the first count value with a target count value to obtain a comparison result of the first count value and the target count value; since the reference oscillator signal is a given value and the target output frequency to be output by the target oscillator is also a determined value, the target count value is uniquely determined when the count value of the period of the reference oscillator signal is determined. Specifically, the target count value may be equal to a target output frequency of the target oscillator multiplied by the preset count value divided by a frequency of the reference oscillator signal. That is, since the reference oscillator signal is a given value and the target output frequency of the target oscillator is also a determined value, the ratio of the two is determined, and the target count value can be uniquely determined when the count value of the period of the reference oscillator signal is determined; for example, if the frequency of the reference oscillator signal is 1MHz, the target output frequency is 100MHz, and the preset count value of the reference oscillator signal is 1, that is, if the cycle number of the reference oscillator signal is 1, the target count value should be equal to the target output frequency 100MHz multiplied by the cycle number 1 of the reference oscillator signal, and then divided by the frequency 1MHz of the reference oscillator signal, so as to finally obtain a target count value of 100; for another example, when the preset count value of the reference oscillator signal is 10, that is, when the number of cycles of the reference oscillator signal is 10, the target count value should be equal to 1000.
Finally, the correcting module 35 is configured to correct the frequency of the target oscillator signal output by the target oscillator according to the comparison result. Thus, by comparing the first count value with the target count value, the difference therebetween can be used as a guide to modify the target oscillator signal output by the target oscillator so that the frequency of the target oscillator signal tends toward the target output frequency.
According to the oscillator device provided by the embodiment of the invention, the target oscillator signal output by the target oscillator tracks the reference oscillator signal output by the reference oscillator, the frequency fluctuation of the target oscillator signal output by the target oscillator can be reduced, and an interface clock is not required to be used due to the adoption of the reference oscillator, so that the load is lower, and the power consumption is lower.
In some embodiments of the present application, the comparison module comprises:
a calculating unit for calculating a difference between the first count value and a target count value;
the oscillator device further includes:
an error control module 36, configured to control the correction module 35 to correct the frequency of the target oscillator signal output by the target oscillator 32 when the difference exceeds a preset error range, and control the correction module to stop correcting the frequency of the target oscillator signal output by the target oscillator 32 when the difference does not exceed the preset error range.
That is to say, the oscillator apparatus in the embodiment of the present invention further includes an error control module 36, the calculating unit in the comparing module 34 is configured to calculate a difference between the first counting value and the target counting value, and the error control module 36 is configured to determine whether to control the correcting module 35 to correct the frequency of the target oscillator signal output by the target oscillator 32 according to the difference calculated by the calculating unit. Specifically, the control and correction module 35 corrects the frequency of the target oscillator signal output by the target oscillator 32 when the difference exceeds the preset error range, and stops correcting the frequency of the target oscillator signal output by the target oscillator 32 when the difference does not exceed the preset error range. Therefore, by setting the preset error range in the error control module, the oscillator device corrects the frequency of the target oscillator signal only when the difference exceeds the preset error range, so that the problem of power consumption increase caused by keeping a correction mode all the time is avoided.
Fig. 4 is a schematic diagram of a preset error range of a target oscillator according to an embodiment of the present invention. As shown in fig. 4, the preset error range may be set according to an operating environment in which the target oscillator 32 is located. For example, in a scenario with a high precision requirement, the preset error range may be ± 1MHz, and in a scenario with a relatively low precision requirement, the preset allowable error range may be ± 2MHz, or even ± 4 MHz.
In this embodiment of the present application, optionally, the modification module 35 includes:
a first correction unit configured to increase a frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value, when the first count value is smaller than the target count value;
a second correction unit configured to decrease the frequency of the target oscillator signal output by the target oscillator until the first count value is equal to the target count value, when the first count value is greater than the target count value.
Since the difference between the first count value and the target count value represents the difference between the frequency of the target oscillator signal currently output by the target oscillator and the target output frequency, when the first count value is smaller than the target count value, which means that the frequency of the target oscillator signal currently output by the target oscillator is lower than the target output frequency, the frequency of the target oscillator signal currently output by the target oscillator should be increased until the first count value is equal to the target count value, that is, the frequency of the target oscillator signal currently output by the target oscillator is equal to the target output frequency; and if the first count value is greater than the target count value, which means that the frequency of the target oscillator signal currently output by the target oscillator is higher than the target output frequency, the frequency of the target oscillator signal currently output by the target oscillator should be decreased until the first count value is equal to the target count value, that is, the frequency of the target oscillator signal currently output by the target oscillator is equal to the target output frequency.
Fig. 5 is a schematic diagram of a first count value according to an embodiment of the present invention. As shown in fig. 5, for example, if the number of cycles of the reference oscillator signal is 1 and the corresponding target count value is N, if the first count value is N +1 or N +2, it means that the frequency of the frequency signal currently output by the target oscillator is higher than the target output frequency, and the frequency of the target oscillator signal output by the target oscillator should be decreased until the first count value is equal to N; and if the first count value is N-1 or N-2, it means that the frequency of the frequency signal currently output by the target oscillator is lower than the target output frequency, and the frequency of the target oscillator signal output by the target oscillator should be increased until the first count value is equal to N.
In other embodiments of the present invention, if a certain preset error range is set by using the error control module, only by adjusting the frequency of the target oscillator signal output by the target oscillator until the difference between the first count value and the target count value falls within the preset error range, the target oscillator signal is output by the target oscillator. For example, if the preset error range is ± 10, that is, the absolute value of the difference between the target count value and the first count value is 10, the frequency of the target oscillator signal output by the target oscillator is only required to be adjusted until the difference between the first count value and the target count value is less than 10.
In this embodiment of the present invention, optionally, the oscillator device further includes:
and a tracking step setting module 37, configured to set a tracking step according to the comparison result, where the tracking step is used to determine a correction amplitude of the correction module when correcting the frequency of the target oscillator signal output by the target oscillator.
That is to say, in the embodiment of the present invention, since the difference between the first count value and the target count value may change to some extent, the embodiment of the present invention may further set the tracking step according to the difference between the first count value and the target count value, that is, the tracking step changes with the change of the difference, so that the target oscillator signal output by the target oscillator better tracks the reference oscillator signal, and meanwhile, the power consumption may also be reduced.
Optionally, the tracking step size is:
ERVAL=A*|(N-K)|,
wherein, ERVALAnd for the tracking step length, A is a preset coefficient, N is the target counting value, and K is the first counting value. The value of a may be set according to the value of | (N-K) |, and if the value of | (N-K) | decreases, the value of a may be set to decrease accordingly, so that the tracking step length decreases, and vice versa.
In other words, the change rule of the tracking step length along with the difference | (N-K) | may be: the larger the difference (N-K) is, the larger the tracking step length is, the smaller the difference (N-K) is, and the smaller the tracking step length is; that is, the larger the difference (N-K) |, the larger the difference is, the larger the difference between the frequency of the target oscillator signal output by the target oscillator and the target output frequency is, the larger the tracking step size should be, i.e., the correction amplitude should be increased, so as to quickly reduce the error, and the smaller the difference (N-K) |, the smaller the difference is, the smaller the difference between the frequency of the target oscillator signal output by the target oscillator and the target output frequency is, so that the output frequency is more accurate, and at this time, the tracking step size can be decreased, i.e., the correction amplitude can be reduced, so as to more accurately and more quickly correct the frequency of the target oscillator signal output by the target oscillator to be consistent with the target output frequency.
Fig. 6 is a schematic diagram of a tracking step according to an embodiment of the present invention. As shown in fig. 6, in the embodiment of the present invention, the size of the tracking step varies with the variation of the difference, so that the target oscillator signal output by the target oscillator better tracks the reference oscillator signal, and the power consumption can be reduced.
According to the oscillator device provided by the embodiment of the invention, the target oscillator signal tracks the reference oscillator signal, so that the frequency fluctuation of the target oscillator signal can be reduced, and the target oscillator does not need to use an interface clock, so that the load is lower and the power consumption is lower.
Fig. 7 is a flowchart illustrating an oscillator frequency calibration method according to an embodiment of the present invention. As shown in fig. 7, another embodiment of the present invention further provides an oscillator frequency calibration method, where the method is an embodiment of a method corresponding to the oscillator apparatus described above, and the method may include the following steps:
step 71: and counting the period of the target oscillator signal output by the target oscillator within the time length from the period counting of the reference oscillator signal output by the reference oscillator to the preset counting value to obtain a first counting value.
In the embodiment of the present invention, specifically, a reference oscillator signal may be output by a reference oscillator, where the reference oscillator signal is a given value; then, presetting a count value of the reference oscillator signal, that is, counting the period of the reference oscillator signal by using a counter and presetting the count value, for example, if the preset count value is 1, that is, if the preset period number of the reference oscillator signal is 1 and the preset count value is 100, the preset period number of the reference oscillator signal is 100; and counting the period of the target oscillator signal output by the target oscillator within the time period from the period of the reference oscillator signal to the preset count value, namely within the time period from 0 counting of the counter to the preset count value of the reference oscillator signal, so as to obtain a first count value.
In the embodiment of the invention, the frequency of the reference oscillator signal is lower than that of the target oscillator signal output by the target oscillator, the reference oscillator signal with lower frequency has better stability and is less influenced by the change of the external environment, the accuracy of frequency reference can be ensured, and the frequency change caused by temperature and the like is reduced. The target oscillator signal output by the target oscillator may be a high-speed clock signal.
Step 72: and comparing the first counting value with a target counting value to obtain a comparison result.
In the embodiment of the invention, the first counting value is compared with the target counting value to obtain a comparison result of the first counting value and the target counting value; since the reference oscillator signal is a given value and the target output frequency to be output by the target oscillator is also a determined value, the target count value is uniquely determined when the count value of the period of the reference oscillator signal is determined.
In an embodiment of the present invention, the target count value may be equal to a target output frequency of the target oscillator multiplied by the preset count value divided by a frequency of the reference oscillator signal. That is, since the reference oscillator signal is a given value and the target output frequency of the target oscillator is also a determined value, the ratio of the two is determined, and the target count value can be uniquely determined when the count value of the period of the reference oscillator signal is determined; for example, if the frequency of the reference oscillator signal is 1MHz, the target output frequency is 100MHz, and the preset count value of the reference oscillator signal is 1, that is, if the cycle number of the reference oscillator signal is 1, the target count value should be equal to the target output frequency 100MHz multiplied by the cycle number 1 of the reference oscillator signal, and then divided by the frequency 1MHz of the reference oscillator signal, so as to finally obtain a target count value of 100; for another example, when the preset count value of the reference oscillator signal is 10, that is, when the number of cycles of the reference oscillator signal is 10, the target count value should be equal to 1000.
Step 73: and correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result.
Finally, by comparing the first count value with the target count value, the difference between the first count value and the target count value can be used as a guide for correcting the target oscillator signal output by the target oscillator so as to lead the frequency of the target oscillator signal to approach the target output frequency.
According to the oscillator frequency calibration method provided by the embodiment of the invention, the target oscillator signal output by the target oscillator tracks the reference oscillator signal output by the reference oscillator, the frequency fluctuation of the target oscillator signal output by the target oscillator can be reduced, and an interface clock is not required to be used due to the adoption of the reference oscillator, so that the load is lower and the power consumption is lower.
In this embodiment of the present invention, optionally, the comparing the first count value with the target count value to obtain a comparison result includes:
calculating a difference value between the first count value and a target count value;
the correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result comprises:
and correcting the frequency of the target oscillator signal output by the target oscillator under the condition that the difference value exceeds a preset error range.
That is to say, in the embodiment of the present invention, a difference between the first count value and the target count value may be further calculated, and whether to correct the frequency of the target oscillator signal output by the target oscillator may be determined according to the calculated difference. Specifically, the frequency of the target oscillator signal output by the target oscillator is corrected when the difference exceeds a preset error range, and the correction of the frequency of the target oscillator signal output by the target oscillator is stopped when the difference does not exceed the preset error range. Therefore, by setting the preset error range in the error control module, the oscillator device corrects the frequency of the target oscillator signal only when the difference exceeds the preset error range, so that the problem of power consumption increase caused by keeping a correction mode all the time is avoided.
The correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result comprises:
increasing the frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value, if the first count value is less than the target count value;
in the case where the first count value is greater than the target count value, decreasing the frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value.
Since the difference between the first count value and the target count value represents the difference between the frequency of the target oscillator signal currently output by the target oscillator and the target output frequency, when the first count value is smaller than the target count value, which means that the frequency of the target oscillator signal currently output by the target oscillator is lower than the target output frequency, the frequency of the target oscillator signal currently output by the target oscillator should be increased until the first count value is equal to the target count value, that is, the frequency of the target oscillator signal currently output by the target oscillator is equal to the target output frequency; and if the first count value is greater than the target count value, which means that the frequency of the target oscillator signal currently output by the target oscillator is higher than the target output frequency, the frequency of the target oscillator signal currently output by the target oscillator should be decreased until the first count value is equal to the target count value, that is, the frequency of the target oscillator signal currently output by the target oscillator is equal to the target output frequency.
In some embodiments of the present invention, optionally, the frequency calibration method further includes:
and setting a tracking step length according to the comparison result, wherein the tracking step length is used for determining the correction amplitude when the frequency of the target oscillator signal output by the target oscillator is corrected.
That is to say, in the embodiment of the present invention, since the difference between the first count value and the target count value may change to some extent, the embodiment of the present invention may further set the tracking step according to the difference between the first count value and the target count value, that is, the tracking step changes with the change of the difference, so that the target oscillator signal output by the target oscillator better tracks the reference oscillator signal, and meanwhile, the power consumption may also be reduced.
Optionally, the tracking step size is:
ERVAL=A*|(N-K)|,
wherein, ERVALAnd for the tracking step length, A is a preset coefficient, N is the target counting value, and K is the first counting value. The value of a may be set according to the value of | (N-K) |, and if the value of | (N-K) | decreases, the value of a may be set to decrease accordingly, so that the tracking step length decreases, and vice versa.
In other words, the change rule of the tracking step length along with the difference | (N-K) | may be: the larger the difference (N-K) is, the larger the tracking step length is, the smaller the difference (N-K) is, and the smaller the tracking step length is; that is, the larger the difference (N-K) |, the larger the difference is, the larger the difference between the frequency of the target oscillator signal output by the target oscillator and the target output frequency is, the larger the tracking step size should be, i.e., the correction amplitude should be increased, so as to quickly reduce the error, and the smaller the difference (N-K) |, the smaller the difference is, the smaller the difference between the frequency of the target oscillator signal output by the target oscillator and the target output frequency is, so that the output frequency is more accurate, and at this time, the tracking step size can be decreased, i.e., the correction amplitude can be reduced, so as to more accurately and more quickly correct the frequency of the target oscillator signal output by the target oscillator to be consistent with the target output frequency.
According to the frequency calibration method provided by the embodiment of the invention, the frequency signal output by the oscillator tracks the reference oscillator signal, so that the frequency fluctuation of the frequency signal output by the oscillator can be reduced, and the oscillator does not need to use an interface clock, so that the load is lower and the power consumption is lower.
While the foregoing is directed to embodiments of the present invention, it will be appreciated by those skilled in the art that various changes and modifications may be made without departing from the principles of the invention, and it is intended that all such changes and modifications be considered as within the scope of the invention.

Claims (12)

1. An oscillator device, comprising:
a reference oscillator for outputting a reference oscillator signal;
a target oscillator for outputting a target oscillator signal;
the counting module is used for counting the period of the target oscillator signal within the time length from the period of the reference oscillator signal to a preset counting value to obtain a first counting value;
the comparison module is used for comparing the first count value with a target count value to obtain a comparison result;
the correction module is used for correcting the frequency of a target oscillator signal output by the target oscillator according to the comparison result;
wherein the frequency of the reference oscillator signal is lower than the frequency of the target oscillator signal.
2. The oscillator device of claim 1, wherein the target count value is equal to a target output frequency of the target oscillator multiplied by the preset count value divided by a frequency of the reference oscillator signal.
3. The oscillator device of claim 1, wherein the comparison module comprises:
a calculating unit for calculating a difference between the first count value and a target count value;
the oscillator device further includes:
and the error control module is used for controlling the correction module to correct the frequency of the target oscillator signal output by the target oscillator under the condition that the difference value exceeds a preset error range, and controlling the correction module to stop correcting the frequency of the target oscillator signal output by the target oscillator under the condition that the difference value does not exceed the preset error range.
4. The oscillator device of claim 1, wherein the correction module comprises:
a first correction unit configured to increase a frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value, when the first count value is smaller than the target count value;
a second correction unit configured to decrease the frequency of the target oscillator signal output by the target oscillator until the first count value is equal to the target count value, when the first count value is greater than the target count value.
5. The oscillator device according to claim 1, further comprising:
and the tracking step length setting module is used for setting a tracking step length according to the comparison result, and the tracking step length is used for determining the correction amplitude of the correction module when the frequency of the target oscillator signal output by the target oscillator is corrected.
6. The oscillator arrangement according to claim 5, characterized in that the tracking step size is:
ERVAL=A*|(N-K)|,
wherein, ERVALFor the tracking step length, A is a preset coefficient, and N isThe target count value, K, is the first count value.
7. A method of oscillator frequency calibration, comprising:
counting the period of a target oscillator signal output by a target oscillator within the time length from the period counting of a reference oscillator signal output by a reference oscillator to a preset counting value to obtain a first counting value;
comparing the first count value with a target count value to obtain a comparison result;
correcting the frequency of a target oscillator signal output by the target oscillator according to the comparison result;
wherein the frequency of the reference oscillator signal is lower than the frequency of the target oscillator signal.
8. The oscillator frequency calibration method of claim 7, wherein the target count value is equal to a target output frequency of the target oscillator multiplied by the preset count value divided by a frequency of the reference oscillator signal.
9. The oscillator frequency calibration method according to claim 7, wherein the comparing the first count value with a target count value to obtain a comparison result comprises:
calculating a difference value between the first count value and a target count value;
the correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result comprises:
and correcting the frequency of the target oscillator signal output by the target oscillator under the condition that the difference value exceeds a preset error range.
10. The oscillator frequency calibration method according to claim 7, wherein the correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result comprises:
increasing the frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value, if the first count value is less than the target count value;
in the case where the first count value is greater than the target count value, decreasing the frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value.
11. The oscillator frequency calibration method of claim 7, further comprising:
and setting a tracking step length according to the comparison result, wherein the tracking step length is used for determining the correction amplitude when the frequency of the target oscillator signal output by the target oscillator is corrected.
12. The oscillator frequency calibration method of claim 11, wherein the tracking step size is:
ERVAL=A*|(N-K)|,
wherein, ERVALAnd for the tracking step length, A is a preset coefficient, N is the target counting value, and K is the first counting value.
CN202011594284.3A 2020-12-29 2020-12-29 Oscillator device and oscillator frequency calibration method Pending CN112636752A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011594284.3A CN112636752A (en) 2020-12-29 2020-12-29 Oscillator device and oscillator frequency calibration method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011594284.3A CN112636752A (en) 2020-12-29 2020-12-29 Oscillator device and oscillator frequency calibration method

Publications (1)

Publication Number Publication Date
CN112636752A true CN112636752A (en) 2021-04-09

Family

ID=75286104

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011594284.3A Pending CN112636752A (en) 2020-12-29 2020-12-29 Oscillator device and oscillator frequency calibration method

Country Status (1)

Country Link
CN (1) CN112636752A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116318120A (en) * 2023-03-30 2023-06-23 归芯科技(深圳)有限公司 Calibration circuit, calibration method, chip and electronic equipment of RC oscillation clock
CN116318120B (en) * 2023-03-30 2024-05-03 归芯科技(深圳)有限公司 Calibration circuit, calibration method, chip and electronic equipment of RC oscillation clock

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201801A (en) * 2010-03-23 2011-09-28 三星半导体(中国)研究开发有限公司 High-accuracy oscillator and self-calibration method thereof
CN103187969A (en) * 2011-12-30 2013-07-03 飞兆半导体公司 Methods and apparatus for self-trim calibration of an oscillator
CN104702278A (en) * 2013-12-10 2015-06-10 炬芯(珠海)科技有限公司 Methods and device for calibrating frequencies
CN104734696A (en) * 2013-12-24 2015-06-24 上海海尔集成电路有限公司 Phase-locked loop frequency calibration circuit and method
CN107579723A (en) * 2017-08-04 2018-01-12 大唐微电子技术有限公司 A kind of method and apparatus of calibrating clock frequency
CN110492848A (en) * 2019-08-15 2019-11-22 成都锐成芯微科技股份有限公司 The number adjustment device and its method of adjustment of RC oscillator

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201801A (en) * 2010-03-23 2011-09-28 三星半导体(中国)研究开发有限公司 High-accuracy oscillator and self-calibration method thereof
CN103187969A (en) * 2011-12-30 2013-07-03 飞兆半导体公司 Methods and apparatus for self-trim calibration of an oscillator
CN104702278A (en) * 2013-12-10 2015-06-10 炬芯(珠海)科技有限公司 Methods and device for calibrating frequencies
CN104734696A (en) * 2013-12-24 2015-06-24 上海海尔集成电路有限公司 Phase-locked loop frequency calibration circuit and method
CN107579723A (en) * 2017-08-04 2018-01-12 大唐微电子技术有限公司 A kind of method and apparatus of calibrating clock frequency
CN110492848A (en) * 2019-08-15 2019-11-22 成都锐成芯微科技股份有限公司 The number adjustment device and its method of adjustment of RC oscillator

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116318120A (en) * 2023-03-30 2023-06-23 归芯科技(深圳)有限公司 Calibration circuit, calibration method, chip and electronic equipment of RC oscillation clock
CN116318120B (en) * 2023-03-30 2024-05-03 归芯科技(深圳)有限公司 Calibration circuit, calibration method, chip and electronic equipment of RC oscillation clock

Similar Documents

Publication Publication Date Title
EP2291916B1 (en) Automatic synchronization of an internal oscillator to an external frequency reference
CN107256065B (en) Real-time clock processing system and method
US8471619B2 (en) Circuit and method for generating a clock signal
EP1304603A2 (en) Time error compensating apparatus and method in a terminal
US5483201A (en) Synchronization circuit using a high speed digital slip counter
CN110262210B (en) Crystal oscillator time keeping method based on counter
US8188776B2 (en) Phase-locked loop circuit
US20190013778A1 (en) Systems and methods for frequency compensation of real-time-clock systems
US20050253646A1 (en) Global Automatic RC Time Constant Tuning Circuit and Method for on Chip RC Filters
CN101834598A (en) Frequency correction circuit and frequency correction method thereof
CN116192125B (en) Method and device for correcting DTC delay stepping based on stepping LDO
CN114665848A (en) Duty ratio calibration circuit and method, chip and electronic equipment
TWI613890B (en) Frequency calibration method for digitally controlled oscillator and apparatus using the same
EP0647933A1 (en) Dot clock generator for liquid crystal display device
JPH0856153A (en) Oscillation circuit having frequency correction function
CN111934683B (en) Digital frequency correction method and system for temperature control RTC
US10069498B2 (en) Simultaneous multi-effect oscillator compensation using piecewise interdependent polynomials
CN112636752A (en) Oscillator device and oscillator frequency calibration method
CN108988832B (en) Method for detecting a delay associated with an electronic device and corresponding electronic device
US7688151B2 (en) Aging compensation method and control module for an oscillator circuit device
US20180287617A1 (en) Locked loop circuit with reference signal provided by un-trimmed oscillator
CN105116712A (en) Method for automatically calibrating built-in crystal oscillator
JP2002016438A (en) Crystal oscillation circuit, clock device and measuring instrument
JPH0340356B2 (en)
CN111897202A (en) RTC (real time clock) calibration circuit and method of smoke detector MCU (microprogrammed control Unit)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Nan Bingzai

Inventor after: Zheng Guirong

Inventor before: Nan Bingzai

Inventor before: Zheng Yongyi

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100176 no.2179, 2 / F, building D, 33, 99 Kechuang 14th Street, Beijing Economic and Technological Development Zone, Beijing (centralized office area)

Applicant after: Beijing yisiwei Computing Technology Co.,Ltd.

Address before: 100176 no.2179, 2 / F, building D, 33, 99 Kechuang 14th Street, Beijing Economic and Technological Development Zone, Beijing (centralized office area)

Applicant before: Beijing yisiwei Computing Technology Co.,Ltd.