[go: up one dir, main page]

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

Oscillator device and oscillator frequency calibration method Download PDF

Info

Publication number
CN112636752B
CN112636752B CN202011594284.3A CN202011594284A CN112636752B CN 112636752 B CN112636752 B CN 112636752B CN 202011594284 A CN202011594284 A CN 202011594284A CN 112636752 B CN112636752 B CN 112636752B
Authority
CN
China
Prior art keywords
target
count value
oscillator
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.)
Active
Application number
CN202011594284.3A
Other languages
Chinese (zh)
Other versions
CN112636752A (en
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/CN112636752B/en
Publication of CN112636752A publication Critical patent/CN112636752A/en
Application granted granted Critical
Publication of CN112636752B publication Critical patent/CN112636752B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

  • Stabilization Of Oscillater, Synchronisation, Frequency Synthesizers (AREA)

Abstract

本发明提供一种振荡器装置及振荡器频率校准方法。所述振荡器装置包括:参考振荡器,用于输出参考振荡器信号;目标振荡器,用于输出目标振荡器信号;计数模块,用于在对参考振荡器信号的周期计数至预设计数值的时长内,对目标振荡器信号的周期进行计数,得到第一计数值;比较模块,用于将第一计数值与目标计数值进行比较,得到比较结果;修正模块,用于根据比较结果,修正目标振荡器输出的目标振荡器信号的频率;其中,参考振荡器信号的频率低于目标振荡器信号的频率。根据本发明实施例的振荡器装置,通过使目标振荡器信号跟踪参考振荡器信号,可以降低目标振荡器信号的频率波动,并且目标振荡器不需要使用接口时钟,因此负载较低、功耗也较小。

The present invention provides an oscillator device and an oscillator frequency calibration method. The oscillator device includes: a reference oscillator, which is used to output a reference oscillator signal; a target oscillator, which is used to output a target oscillator signal; a counting module, which is used to count the period of the target oscillator signal within the time length of counting the period of the reference oscillator signal to a pre-designed value, and obtain a first count value; a comparison module, which is used to compare the first count value with the target count value to obtain a comparison result; a correction module, which is used to correct 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 of an embodiment of the present invention, by making the target oscillator signal track the reference oscillator signal, the frequency fluctuation of the target oscillator signal can be reduced, and the target oscillator does not need to use an interface clock, so the load is low and the power consumption is also low.

Description

一种振荡器装置及振荡器频率校准方法Oscillator device and oscillator frequency calibration method

技术领域Technical Field

本发明涉及振荡器技术领域,具体涉及一种振荡器装置及振荡器频率校准方法。The present invention relates to the technical field of oscillators, and in particular to an oscillator device and an oscillator frequency calibration method.

背景技术Background Art

时钟在数字电路中具有重要的作用,数字信号需要用时钟脉冲来控制数据的接收和发送。因此,高精度和高稳定性的时钟信号十分重要。振荡器便是一种常见的时钟源,然而,在振荡器工作的过程中,周围环境及应用温度的变化将导致振荡器的频率偏离原来的振荡频率,从而使振荡器的频率产生较大的误差,最终影响显示面板的显示效果。Clocks play an important role in digital circuits. Digital signals require clock pulses to control the reception and transmission of data. Therefore, high-precision and high-stability clock signals are very important. Oscillators are a common clock source. However, during the operation of the oscillator, changes in the surrounding environment and application temperature will cause the oscillator frequency to deviate from the original oscillation frequency, resulting in a large error in the oscillator frequency, which ultimately affects the display effect of the display panel.

发明内容Summary of the invention

有鉴于此,本发明提供一种振荡器装置及振荡器频率校准方法,能够解决现有技术中振荡器容易受外部环境变化的影响,继而导致输出的时钟信号频率产生较大误差的问题。In view of this, the present invention provides an oscillator device and an oscillator frequency calibration method, which can solve the problem in the prior art that the oscillator is easily affected by changes in the external environment, which in turn causes a large error in the output clock signal frequency.

为解决上述技术问题,本发明采用以下技术方案:In order to solve the above technical problems, the present invention adopts the following technical solutions:

第一方面,本发明实施例提供了一种振荡器装置,该振荡器装置包括:In a first aspect, an embodiment of the present invention provides an oscillator device, the oscillator device comprising:

参考振荡器,用于输出参考振荡器信号;A reference oscillator, used for outputting a reference oscillator signal;

目标振荡器,用于输出目标振荡器信号;a target oscillator, configured to output a target oscillator signal;

计数模块,用于在对所述参考振荡器信号的周期计数至预设计数值的时长内,对所述目标振荡器信号的周期进行计数,得到第一计数值;A counting module, configured to count the period of the target oscillator signal within a time period for counting the period of the reference oscillator signal to a pre-set value, to obtain a first count value;

比较模块,用于将所述第一计数值与目标计数值进行比较,得到比较结果;A comparison module, used for comparing the first count value with a target count value to obtain a comparison result;

修正模块,用于根据所述比较结果,修正所述目标振荡器输出的目标振荡器信号的频率;a correction module, configured to correct the frequency of a target oscillator signal output by the target oscillator according to the comparison result;

其中,所述参考振荡器信号的频率低于所述目标振荡器信号的频率。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 the target output frequency of the target oscillator multiplied by the pre-designed value and divided by the frequency of the reference oscillator signal.

可选的,所述比较模块包括:Optionally, the comparison module includes:

计算单元,用于计算所述第一计数值和目标计数值的差值;A calculation unit, configured to calculate a difference between the first count value and a target count value;

所述振荡器装置还包括:The oscillator device further comprises:

误差控制模块,用于在所述差值超出预设误差范围的情况下,控制所述修正模块对所述目标振荡器输出的目标振荡器信号的频率进行修正,在所述差值未超出预设误差范围的情况下,控制所述修正模块停止对所述目标振荡器输出的目标振荡器信号的频率进行修正。The error control module is used to control the correction module to correct the frequency of the target oscillator signal output by the target oscillator when the difference exceeds the preset error range, and to control the correction module to stop correcting the frequency of the target oscillator signal output by the target oscillator when the difference does not exceed the preset error range.

可选的,所述修正模块包括:Optionally, the correction module includes:

第一修正单元,用于在所述第一计数值小于所述目标计数值的情况下,提高所述目标振荡器输出的目标振荡器信号的频率,直至所述第一计数值等于所述目标计数值;a first correction unit, configured to increase the frequency of a target oscillator signal output by the target oscillator when the first count value is less than the target count value, until the first count value is equal to the target count value;

第二修正单元,用于在所述第一计数值大于所述目标计数值的情况下,降低所述目标振荡器输出的目标振荡器信号的频率,直至所述第一计数值等于所述目标计数值。The second correction unit is configured to reduce the frequency of the target oscillator signal output by the target oscillator when the first count value is greater than the target count value, until the first count value is equal to the target count value.

可选的,还包括:Optionally, also include:

跟踪步长设置模块,用于根据所述比较结果,设置跟踪步长,所述跟踪步长用于确定所述修正模块在修正所述目标振荡器输出的目标振荡器信号的频率时的修正幅度。The tracking step length setting module is used to set the tracking step length according to the comparison result, and the tracking step length is used to determine the correction amplitude when the correction module corrects the frequency of the target oscillator signal output by the target oscillator.

可选的,所述跟踪步长:Optionally, the tracking step size:

ERVAL=A*|(N-K)|,ER VAL = A*|(NK)|,

其中,ERVAL为所述跟踪步长,A为预设系数,N为所述目标计数值,K为所述第一计数值。Among them, ER VAL is the tracking step size, A is the preset coefficient, N is the target count value, and K is the first count value.

本发明另一方面实施例提供了一种振荡器频率校准方法,该振荡器频率校准方法包括:Another aspect of the present invention provides an oscillator frequency calibration method, the oscillator frequency calibration method comprising:

在对参考振荡器输出的参考振荡器信号的周期计数至预设计数值的时长内,对目标振荡器输出的目标振荡器信号的周期进行计数,得到第一计数值;Within the time period when the period of the reference oscillator signal output by the reference oscillator is counted to a pre-set value, the period of the target oscillator signal output by the target oscillator is counted to obtain a first count value;

将所述第一计数值与目标计数值进行比较,得到比较结果;Comparing the first count value with the target count value to obtain a comparison result;

将所述第一计数值与目标计数值进行比较,得到比较结果;Comparing the first count value with the target count value to obtain a comparison result;

根据所述比较结果,修正所述目标振荡器输出的目标振荡器信号的频率;According to the comparison result, correcting the frequency of the target oscillator signal output by the target oscillator;

其中,所述参考振荡器信号的频率低于所述目标振荡器信号的频率。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 the target output frequency of the target oscillator multiplied by the pre-designed value and divided by the frequency of the reference oscillator signal.

可选的,所述将所述第一计数值与目标计数值进行比较,得到比较结果,包括:Optionally, comparing the first count value with a target count value to obtain a comparison result includes:

计算所述第一计数值和目标计数值的差值;Calculating a difference between the first count value and a target count value;

所述根据所述比较结果,修正所述目标振荡器输出的目标振荡器信号的频率,包括:The step of correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result includes:

在所述差值超出预设误差范围的情况下,对所述目标振荡器输出的目标振荡器信号的频率进行修正。When the difference exceeds a preset error range, the frequency of the target oscillator signal output by the target oscillator is corrected.

可选的,所述根据所述比较结果,修正所述目标振荡器输出的目标振荡器信号的频率,包括:Optionally, the correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result includes:

在所述第一计数值小于所述目标计数值的情况下,提高所述目标振荡器输出的目标振荡器信号的频率,直至所述第一计数值等于所述目标计数值;When the first count value is less than the target count value, increasing 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, the frequency of the target oscillator signal output by the target oscillator is reduced until the first count value is equal to the target count value.

可选的,还包括:Optionally, also include:

根据所述比较结果,设置跟踪步长,所述跟踪步长用于确定在修正所述目标振荡器输出的目标振荡器信号的频率时的修正幅度。A tracking step length is set according to the comparison result, and the tracking step length is used to determine a correction amplitude when correcting the frequency of a target oscillator signal output by the target oscillator.

可选的,所述跟踪步长:Optionally, the tracking step size:

ERVAL=A*|(N-K)|,ER VAL = A*|(NK)|,

其中,ERVAL为所述跟踪步长,A为预设系数,N为所述目标计数值,K为所述第一计数值。Among them, ER VAL is the tracking step size, A is the preset coefficient, N is the target count value, and K is the first count value.

本发明上述技术方案的有益效果如下:The beneficial effects of the above technical solution of the present invention are as follows:

根据本发明实施例的振荡器装置,通过使目标振荡器信号跟踪参考振荡器信号,可以降低目标振荡器信号的频率波动,并且目标振荡器不需要使用接口时钟,因此负载较低、功耗也较小。According to the oscillator device of the embodiment of the present invention, the frequency fluctuation of the target oscillator signal can be reduced by making the target oscillator signal track the reference oscillator signal, and the target oscillator does not need to use an interface clock, so the load is lower and the power consumption is also lower.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为现有技术中的一种RC振荡器的结构示意图;FIG1 is a schematic diagram of the structure of an RC oscillator in the prior art;

图2为现有技术中的一种采用锁相环的高速振荡器的结构示意图;FIG2 is a schematic diagram of the structure of a high-speed oscillator using a phase-locked loop in the prior art;

图3为本发明实施例提供的一种振荡器装置的结构示意图;FIG3 is a schematic structural diagram of an oscillator device provided by an embodiment of the present invention;

图4为本发明实施例提供的目标振荡器的预设误差范围的示意图;FIG4 is a schematic diagram of a preset error range of a target oscillator provided by an embodiment of the present invention;

图5为本发明实施例提供的第一计数值的示意图;FIG5 is a schematic diagram of a first counting value provided by an embodiment of the present invention;

图6为本发明实施例提供的跟踪步长的示意图;FIG6 is a schematic diagram of a tracking step length provided by an embodiment of the present invention;

图7为本发明实施例提供的一种振荡器频率校准方法的流程示意图。FIG. 7 is a schematic flow chart of an oscillator frequency calibration method provided in an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例的附图,对本发明实施例的技术方案进行清楚、完整地描述。显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例。基于所描述的本发明的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.

请参考图1,为现有技术中的一种RC振荡器的结构示意图。如图1所示,通用的RC振荡器原理较简单,具有体积较小、功耗较低的优点,但是在输出较高频率的时钟的情况下,由温度引起的频率变化较大。Please refer to Figure 1, which is a schematic diagram of the structure of an RC oscillator in the prior art. As shown in Figure 1, the general RC oscillator has a simple principle, small size and low power consumption, but when outputting a high-frequency clock, the frequency change caused by temperature is large.

请参考图2,为现有技术中的一种采用锁相环的高速振荡器的结构示意图。如图2所示,常见的采用锁相环(Phase Locked Loop,PLL)的高速振荡器包括相位检测器、充电泵、环路滤波器、压控振荡器、分频器等,其原理较复杂,具有输出的时钟信号的频率变化小、输出频率可实时跟踪的优点,但是这类振荡器尺寸很大、功耗也很高,并且,在显示系统中,采用锁相环属于过度设计,会造成成本的增加。Please refer to Figure 2, which is a schematic diagram of the structure of a high-speed oscillator using a phase-locked loop in the prior art. As shown in Figure 2, a common 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. Its principle is relatively complex, and it has the advantages of small frequency variation of the output clock signal and real-time tracking of the output frequency. However, this type of oscillator is large in size and has high power consumption. In addition, in a display system, the use of a phase-locked loop is an over-design, which will increase the cost.

由此,请参考图3,为本发明实施例提供的一种振荡器装置的结构示意图。如图3所示,本发明实施例提供的振荡器装置可以包括:Therefore, please refer to Figure 3, which is a schematic diagram of the structure of an oscillator device provided by an embodiment of the present invention. As shown in Figure 3, the oscillator device provided by an embodiment of the present invention may include:

参考振荡器31,用于输出参考振荡器信号;A reference oscillator 31, used to output a reference oscillator signal;

目标振荡器32,用于输出目标振荡器信号;A target oscillator 32, configured to output a target oscillator signal;

计数模块33,用于在对所述参考振荡器信号的周期计数至预设计数值的时长内,对所述目标振荡器信号的周期进行计数,得到第一计数值;The counting module 33 is used to count the period of the target oscillator signal within the time length of counting the period of the reference oscillator signal to a pre-set value to obtain a first count value;

比较模块34,用于将所述第一计数值与目标计数值进行比较,得到比较结果;A comparison module 34, configured to compare the first count value with a target count value to obtain a comparison result;

修正模块35,用于根据所述比较结果,修正所述目标振荡器输出的目标振荡器信号的频率;A correction module 35, configured to correct the frequency of a target oscillator signal output by the target oscillator according to the comparison result;

其中,所述参考振荡器信号的频率低于所述目标振荡器信号的频率。The frequency of the reference oscillator signal is lower than the frequency of the target oscillator signal.

本发明实施例中,参考振荡器31输出的参考振荡器信号的频率较低,受所处的环境条件(例如温度等因素)的影响几乎可以忽略,在设置参考振荡器31输出频率为一给定值的参考振荡器信号之后,可以认为参考振荡器31输出的参考振荡器信号的频率将一直保持不变。而目标振荡器的频率较高,较容易受所处的环境条件(例如温度等因素)的影响,即在设置目标振荡器32输出频率为一给定值的目标振荡器信号之后,若所处位置的温度升高或降低将导致其频率发生波动,因此在目标振荡器输出的目标振荡器信号的频率发生波动时,需要对其进行修正,以使目标振荡器信号的频率修正为目标输出频率。In the embodiment of the present invention, the frequency of the reference oscillator signal output by the reference oscillator 31 is relatively low, and the influence of the environmental conditions (such as temperature and other factors) is almost negligible. After the reference oscillator 31 is set to output a reference oscillator signal with a given frequency, 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 relatively high, and is more easily affected by the environmental conditions (such as temperature and other factors). That is, after the target oscillator 32 is set to output a target oscillator signal with a given frequency, if the temperature at the location increases or decreases, the frequency of the target oscillator signal will fluctuate. Therefore, when the frequency of the target oscillator signal output by the target oscillator fluctuates, it needs to be corrected so that the frequency of the target oscillator signal is corrected to the target output frequency.

本发明的一些实施例中,一定频率范围内,参考振荡器信号的频率越低,参考的可信度越高。其中,可以使参考振荡器信号为低速时钟信号,目标振荡器信号为高速时钟信号。In some embodiments of the present invention, within a certain frequency range, the lower the frequency of the reference oscillator signal, the higher the credibility of the reference. The reference oscillator signal can be a low-speed clock signal, and the target oscillator signal can be a high-speed clock signal.

在本发明实施例中,参考振荡器31输出的参考振荡器信号送至计数模块33中进行计数,同时,目标振荡器32输出的目标振荡器信号也被送至计数模块33中进行计数,所述计数是指计数模块33对输入的信号的周期进行计数。其中,可以预设对参考振荡器信号的计数值,从而在对参考振荡器信号的周期计数至预设计数值的时长内,也同步对目标振荡器信号的周期进行计数,得到第一计数值,也即,在对参考振荡器信号开始计数的同时,也对目标振荡器信号开始计数,在对参考振荡器信号的周期计数值预设计数值时,停止对参考振荡器信号和目标振荡器信号的计数,从而获得在该段时间内对目标振荡器信号的周期的第一计数值。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 at the same time, the target oscillator signal output by the target oscillator 32 is also sent to the counting module 33 for counting, and the counting refers to the counting module 33 counting the period of the input signal. Among them, the counting value of the reference oscillator signal can be preset, so that within the time length of counting the period of the reference oscillator signal to a pre-designed value, the period of the target oscillator signal is also synchronously counted to obtain a first counting value, that is, when counting of the reference oscillator signal starts, counting of the target oscillator signal also starts, and when the period counting value of the reference oscillator signal reaches a pre-designed value, counting of the reference oscillator signal and the target oscillator signal is stopped, so as to obtain a first counting value of the period of the target oscillator signal during this period of time.

本发明实施例中,比较模块34则用于将所述第一计数值与目标计数值进行比较,得到两者的比较结果;其中,由于参考振荡器信号为一给定值,而目标振荡器所要输出的目标输出频率也是一确定值,因此,对所述参考振荡器信号的周期的计数值确定时,目标计数值也被唯一确定。具体的,目标计数值可以等于所述目标振荡器的目标输出频率乘以所述预设计数值再除以所述参考振荡器信号的频率。也就是说,由于参考振荡器信号为一给定值,而目标振荡器的目标输出频率也是一确定值,因此两者的比值确定,对所述参考振荡器信号的周期的计数值确定时,目标计数值也可以被唯一确定;例如,参考振荡器信号的频率为1MHz,目标输出频率为100MHz,则参考振荡器信号的预设计数值为1时,也即参考振荡器信号的周期数为1时,目标计数值应等于目标输出频率100MHz乘以参考振荡器信号的周期数1,再除以参考振荡器信号的频率1MHz,最终得到目标计数值为100;又如,参考振荡器信号的预设计数值为10时,也即参考振荡器信号的周期数为10时,目标计数值应等于1000。In the embodiment of the present invention, the comparison module 34 is used to compare the first count value with the target count value to obtain a comparison result of the two; wherein, 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, therefore, when the count value of the period of the reference oscillator signal is determined, the target count value is also uniquely determined. Specifically, the target count value can be equal to the target output frequency of the target oscillator multiplied by the pre-designed value and then divided by the frequency of the reference oscillator signal. That is to say, since the reference oscillator signal is a given value and the target output frequency of the target oscillator is also a certain value, the ratio of the two is determined, and when the count value of the period of the reference oscillator signal is determined, the target count value can also be uniquely determined; for example, when the frequency of the reference oscillator signal is 1MHz and the target output frequency is 100MHz, then when the preset count value of the reference oscillator signal is 1, that is, when the number of periods of the reference oscillator signal is 1, the target count value should be equal to the target output frequency 100MHz multiplied by the number of periods of the reference oscillator signal 1, and then divided by the frequency of the reference oscillator signal 1MHz, and finally the target count value is 100; for another example, when the preset count value of the reference oscillator signal is 10, that is, when the number of periods of the reference oscillator signal is 10, the target count value should be equal to 1000.

最终,修正模块35用于根据所述比较结果,修正所述目标振荡器输出的目标振荡器信号的频率。由此,通过将第一计数值与目标计数值进行比较,两者之间的差异即可用来指导修正目标振荡器输出的目标振荡器信号,以使目标振荡器信号的频率趋向于目标输出频率。Finally, the correction module 35 is used 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 between the two can be used to guide the correction of the target oscillator signal output by the target oscillator so that the frequency of the target oscillator signal tends to the target output frequency.

根据本发明实施例的振荡器装置,目标振荡器输出的目标振荡器信号跟踪参考振荡器输出的参考振荡器信号,可以降低目标振荡器输出的目标振荡器信号的频率波动,并且由于采用参考振荡器,因此不需要使用接口时钟,因此负载较低、功耗也较小。According to the oscillator device of the embodiment of the present invention, the target oscillator signal output by the target oscillator tracks the reference oscillator signal output by the reference oscillator, which can reduce the frequency fluctuation of the target oscillator signal output by the target oscillator. Moreover, since a reference oscillator is used, there is no need to use an interface clock, so the load is lower and the power consumption is also lower.

在本申请的一些实施例中,所述比较模块包括:In some embodiments of the present application, the comparison module includes:

计算单元,用于计算所述第一计数值和目标计数值的差值;A calculation unit, configured to calculate a difference between the first count value and a target count value;

所述振荡器装置还包括:The oscillator device further comprises:

误差控制模块36,用于在所述差值超出预设误差范围的情况下,控制所述修正模块35对所述目标振荡器32输出的目标振荡器信号的频率进行修正,在所述差值未超出预设误差范围的情况下,控制所述修正模块停止对所述目标振荡器32输出的目标振荡器信号的频率进行修正。The error control module 36 is used 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 the preset error range, and to 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.

也就是说,本发明实施例中的振荡器装置还包括误差控制模块36,比较模块34中的计算单元用于计算所述第一计数值和目标计数值的差值,而误差控制模块36则用于根据计算单元计算得到的差值来判断是否控制修正模块35对目标振荡器32输出的目标振荡器信号的频率进行修正。具体的,在所述差值超出预设误差范围的情况下,控制修正模块35对目标振荡器32输出的目标振荡器信号的频率进行修正,在所述差值未超出预设误差范围的情况下,控制修正模块停止对目标振荡器32输出的目标振荡器信号的频率进行修正。从而,通过设定误差控制模块中的预设误差范围,使得振荡器装置只在所述差值超出预设误差范围的情况下才对目标振荡器信号的频率进行修正,从而避免了一直保持修正模式而导致的功耗上升问题。That is, the oscillator device in the embodiment of the present invention further includes an error control module 36, the calculation unit in the comparison module 34 is used to calculate the difference between the first count value and the target count value, and the error control module 36 is used to determine whether to control the correction module 35 to correct the frequency of the target oscillator signal output by the target oscillator 32 according to the difference calculated by the calculation unit. Specifically, when the difference exceeds the preset error range, the correction module 35 is controlled to correct the frequency of the target oscillator signal output by the target oscillator 32, and when the difference does not exceed the preset error range, the correction module is controlled to stop correcting the frequency of the target oscillator signal output by the target oscillator 32. Thus, 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, thereby avoiding the problem of increased power consumption caused by always maintaining the correction mode.

请参考图4,为本发明实施例提供的目标振荡器的预设误差范围的示意图。如图4所示,可以根据目标振荡器32所处的工作环境来设定所述预设误差范围。示例性的,在精度要求较高的场景下,所述预设误差范围可以为±1MHz,而在精度要求相对较低的场景下,所述预设允许误差范围可以为±2MHz,甚至为±4MHz。Please refer to Figure 4, which is a schematic diagram of a preset error range of a target oscillator provided in an embodiment of the present invention. As shown in Figure 4, the preset error range can be set according to the working environment of the target oscillator 32. Exemplarily, in a scenario with high accuracy requirements, the preset error range can be ±1MHz, and in a scenario with relatively low accuracy requirements, the preset allowable error range can be ±2MHz, or even ±4MHz.

在本申请实施例中,可选的,所述修正模块35包括:In the embodiment of the present application, optionally, the correction module 35 includes:

第一修正单元,用于在所述第一计数值小于所述目标计数值的情况下,提高所述目标振荡器输出的目标振荡器信号的频率,直至所述第一计数值等于所述目标计数值;a first correction unit, configured to increase the frequency of a target oscillator signal output by the target oscillator when the first count value is less than the target count value, until the first count value is equal to the target count value;

第二修正单元,用于在所述第一计数值大于所述目标计数值的情况下,降低所述目标振荡器输出的目标振荡器信号的频率,直至所述第一计数值等于所述目标计数值。The second correction unit is configured to reduce the frequency of the target oscillator signal output by the target oscillator when the first count value is greater than the target count value, 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, therefore, when the first count value is less than the target count value, it means that the frequency of the target oscillator signal currently output by the target oscillator is lower than the target output frequency. At this time, the frequency of the target oscillator signal 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 when the first count value is greater than the target count value, it means that the frequency of the target oscillator signal currently output by the target oscillator is higher than the target output frequency. At this time, the frequency of the target oscillator signal output by the target oscillator should be reduced 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.

请参考图5,为本发明实施例提供的第一计数值的示意图。如图5所示,示例性的,参考振荡器信号的周期数为1,对应的目标计数值为N,则如果第一计数值为N+1或N+2,则意味着目标振荡器当前输出的频率信号的频率高于目标输出频率,则此时应该降低所述目标振荡器输出的目标振荡器信号的频率,直至所述第一计数值等于N;而如果第一计数值为N-1或N-2,则意味着目标振荡器当前输出的频率信号的频率低于目标输出频率,则此时应该提高所述目标振荡器输出的目标振荡器信号的频率,直至所述第一计数值等于N。Please refer to Figure 5, which is a schematic diagram of the first count value provided by an embodiment of the present invention. As shown in Figure 5, exemplarily, 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, then the frequency of the target oscillator signal output by the target oscillator should be reduced 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, then the frequency of the target oscillator signal output by the target oscillator should be increased until the first count value is equal to N.

本发明的另一些实施例中,若利用误差控制模块设置了一定的预设误差范围,则只需要通过调整所述目标振荡器输出的目标振荡器信号的频率,直至第一计数值与目标计数值之间的差值落在所述预设误差范围内即可。例如,预设误差范围是±10,即目标计数值与第一计数值之间的差值的绝对值为10,则只需要通过调整所述目标振荡器输出的目标振荡器信号的频率,直至第一计数值与目标计数值之间的差值小于10即可。In some other embodiments of the present invention, if a certain preset error range is set by using the error control module, it is only necessary to adjust 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. 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, it is only necessary to adjust 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 is less than 10.

本发明实施例中,可选的,所述振荡器装置还包括:In the embodiment of the present invention, optionally, the oscillator device further includes:

跟踪步长设置模块37,用于根据所述比较结果,设置跟踪步长,所述跟踪步长用于确定所述修正模块在修正所述目标振荡器输出的目标振荡器信号的频率时的修正幅度。The tracking step length setting module 37 is used to set a tracking step length according to the comparison result, and the tracking step length is used to determine the correction amplitude when the correction module corrects 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 a certain extent, the embodiment of the present invention can also 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 difference, so that the target oscillator signal output by the target oscillator can better track the reference oscillator signal, and at the same time, power consumption can be reduced.

可选的,所述跟踪步长:Optionally, the tracking step size:

ERVAL=A*|(N-K)|,ER VAL = A*|(NK)|,

其中,ERVAL为所述跟踪步长,A为预设系数,N为所述目标计数值,K为所述第一计数值。A的值可以根据|(N-K)|的值的大小进行设定,若|(N-K)|的值减小,A的值可以相应设置减小,使得跟踪步长减小,反之亦然。Wherein, ER VAL is the tracking step length, A is the preset coefficient, N is the target count value, and K is the first count value. The value of A can be set according to the value of |(NK)|. If the value of |(NK)| decreases, the value of A can be set to decrease accordingly, so that the tracking step length decreases, and vice versa.

换言之,跟踪步长随差值|(N-K)|的变化规律可以为:差值|(N-K)|越大,跟踪步长越大,差值|(N-K)|越小,跟踪步长越小;也就是说,差值|(N-K)|越大,则表明目标振荡器输出的目标振荡器信号的频率和目标输出频率相差较大,此时应增大跟踪步长,即加大修正幅度,以快速地将误差缩小,而差值|(N-K)|越小,则表明目标振荡器输出的目标振荡器信号的频率和目标输出频率相差较小,输出的频率较为准确,此时可以减小跟踪步长,即缩小修正幅度,以更精确、更快速地将目标振荡器输出的目标振荡器信号的频率修正至和目标输出频率一致。In other words, the law of change of the tracking step with the difference |(N-K)| can be as follows: the larger the difference |(N-K)|, the larger the tracking step, and the smaller the difference |(N-K)|, the smaller the tracking step; that is, the larger the difference |(N-K)|, the larger the tracking step, indicating that the frequency of the target oscillator signal output by the target oscillator and the target output frequency differ greatly. At this time, the tracking step should be increased, that is, the correction amplitude should be increased to quickly reduce the error, and the smaller the difference |(N-K)|, the smaller the frequency of the target oscillator signal output by the target oscillator and the target output frequency differ little, and the output frequency is more accurate. At this time, the tracking step can be reduced, that is, the correction amplitude can be reduced to more accurately and quickly correct the frequency of the target oscillator signal output by the target oscillator to be consistent with the target output frequency.

请参考图6,为本发明实施例提供的跟踪步长的示意图。如图6所示,本发明实施例中,跟踪步长的大小随差值的变化而变化,从而使目标振荡器输出的目标振荡器信号更好地跟踪参考振荡器信号,同时也可以降低功耗。Please refer to Figure 6, which is a schematic diagram of the tracking step length provided by an embodiment of the present invention. As shown in Figure 6, in the embodiment of the present invention, the size of the tracking step length varies with the difference value, so that the target oscillator signal output by the target oscillator can better track the reference oscillator signal, and power consumption can also be reduced.

根据本发明实施例的振荡器装置,通过使目标振荡器信号跟踪参考振荡器信号,可以降低目标振荡器信号的频率波动,并且目标振荡器不需要使用接口时钟,因此负载较低、功耗也较小。According to the oscillator device of the embodiment of the present invention, the frequency fluctuation of the target oscillator signal can be reduced by making the target oscillator signal track the reference oscillator signal, and the target oscillator does not need to use an interface clock, so the load is lower and the power consumption is also lower.

请参考图7,为本发明实施例提供的一种振荡器频率校准方法的流程示意图。如图7所示,本发明另一方面实施例还提供了一种振荡器频率校准方法,该方法为与上述振荡器装置对应的方法实施例,该方法可以包括以下步骤:Please refer to Figure 7, which is a flow chart of an oscillator frequency calibration method provided by an embodiment of the present invention. As shown in Figure 7, another embodiment of the present invention further provides an oscillator frequency calibration method, which is a method embodiment corresponding to the above-mentioned oscillator device, and the method may include the following steps:

步骤71:在对参考振荡器输出的参考振荡器信号的周期计数至预设计数值的时长内,对目标振荡器输出的目标振荡器信号的周期进行计数,得到第一计数值。Step 71: Within the time period when the period of the reference oscillator signal output by the reference oscillator is counted to a preset value, the period of the target oscillator signal output by the target oscillator is counted to obtain a first count value.

本发明实施例中,具体的,可以通过参考振荡器输出参考振荡器信号,参考振荡器信号为一给定值;然后预设参考振荡器信号的计数值,也即利用计数器对参考振荡器信号的周期进行计数并预设计数值,例如预设计数值为1,即参考振荡器信号的预设周期数为1,预设计数值为100,则参考振荡器信号的预设周期数为100;在对所述参考振荡器信号的周期计数至预设计数值的时长内,即在计数器由0计数至参考振荡器信号的预设计数值的这段时间内,对目标振荡器输出的目标振荡器信号的周期进行计数,得到第一计数值。In an embodiment of the present invention, specifically, a reference oscillator can output a reference oscillator signal, and the reference oscillator signal is a given value; then the count value of the reference oscillator signal is preset, that is, a counter is used to count the period of the reference oscillator signal and pre-set the value, for example, the preset count value is 1, that is, the preset number of periods of the reference oscillator signal is 1, and the preset count value is 100, then the preset number of periods of the reference oscillator signal is 100; during the time period for counting the period of the reference oscillator signal to the pre-set value, that is, during the time period for the counter to count from 0 to the pre-set value of the reference oscillator signal, the period of the target oscillator signal output by the target oscillator is counted to obtain a first count value.

本发明实施例中,参考振荡器信号的频率低于目标振荡器输出的目标振荡器信号的频率,频率较低的参考振荡器信号具有较好的稳定性,并且受外界环境变化的影响小,可以保证频率参考的准确性,降低由于温度等引起的频率变化,一般来说,一定频率范围内,参考振荡器信号的频率越低,参考的可信度越高。其中,目标振荡器输出的目标振荡器信号可以为高速时钟信号。In the embodiment of the present invention, the frequency of the reference oscillator signal is lower than the frequency of the target oscillator signal output by the target oscillator. The reference oscillator signal with a lower frequency has better stability and is less affected by changes in the external environment. It can ensure the accuracy of the frequency reference and reduce the frequency change caused by temperature, etc. Generally speaking, within a certain frequency range, the lower the frequency of the reference oscillator signal, the higher the credibility of the reference. Among them, the target oscillator signal output by the target oscillator can be a high-speed clock signal.

步骤72:将所述第一计数值与目标计数值进行比较,得到比较结果。Step 72: Compare the first count value with the target count value to obtain a comparison result.

本发明实施例中,通过将所述第一计数值与目标计数值进行比较,得到两者的比较结果;其中,由于参考振荡器信号为一给定值,而目标振荡器所要输出的目标输出频率也是一确定值,因此,对所述参考振荡器信号的周期的计数值确定时,目标计数值也被唯一确定。In an embodiment of the present invention, a comparison result of the two is obtained by comparing the first count value with the target count value; wherein, 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, therefore, when the count value of the period of the reference oscillator signal is determined, the target count value is also uniquely determined.

在本发明实施例中,目标计数值可以等于所述目标振荡器的目标输出频率乘以所述预设计数值再除以所述参考振荡器信号的频率。也就是说,由于参考振荡器信号为一给定值,而目标振荡器的目标输出频率也是一确定值,因此两者的比值确定,对所述参考振荡器信号的周期的计数值确定时,目标计数值也可以被唯一确定;例如,参考振荡器信号的频率为1MHz,目标输出频率为100MHz,则参考振荡器信号的预设计数值为1时,也即参考振荡器信号的周期数为1时,目标计数值应等于目标输出频率100MHz乘以参考振荡器信号的周期数1,再除以参考振荡器信号的频率1MHz,最终得到目标计数值为100;又如,参考振荡器信号的预设计数值为10时,也即参考振荡器信号的周期数为10时,目标计数值应等于1000。In an embodiment of the present invention, the target count value may be equal to the target output frequency of the target oscillator multiplied by the pre-designed value and then divided by the 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 when the count value of the period of the reference oscillator signal is determined, the target count value can also be uniquely determined; for example, when the frequency of the reference oscillator signal is 1MHz and the target output frequency is 100MHz, when the preset count value of the reference oscillator signal is 1, that is, when the number of periods of the reference oscillator signal is 1, the target count value should be equal to the target output frequency 100MHz multiplied by the number of periods of the reference oscillator signal 1, and then divided by the frequency of the reference oscillator signal 1MHz, and finally the target count value is 100; for another example, when the preset count value of the reference oscillator signal is 10, that is, when the number of periods of the reference oscillator signal is 10, the target count value should be equal to 1000.

步骤73:根据所述比较结果,修正所述目标振荡器输出的目标振荡器信号的频率。Step 73: According to the comparison result, correct the frequency of the target oscillator signal output by the target oscillator.

最终,通过将第一计数值与目标计数值进行比较,两者之间的差异即可用来指导修正目标振荡器输出的目标振荡器信号,以使目标振荡器信号的频率趋向于目标输出频率。Finally, by comparing the first count value with the target count value, the difference between the two can be used to guide the correction of the target oscillator signal output by the target oscillator, so that the frequency of the target oscillator signal tends to the target output frequency.

根据本发明实施例的振荡器频率校准方法,目标振荡器输出的目标振荡器信号跟踪参考振荡器输出的参考振荡器信号,可以降低目标振荡器输出的目标振荡器信号的频率波动,并且由于采用参考振荡器,因此不需要使用接口时钟,因此负载较低、功耗也较小。According to the oscillator frequency calibration method of an embodiment of the present invention, the target oscillator signal output by the target oscillator tracks the reference oscillator signal output by the reference oscillator, which can reduce the frequency fluctuation of the target oscillator signal output by the target oscillator. Moreover, since a reference oscillator is used, there is no need to use an interface clock, so the load is lower and the power consumption is also lower.

本发明实施例中,可选的,所述将所述第一计数值与目标计数值进行比较,得到比较结果,包括:In the embodiment of the present invention, optionally, comparing the first count value with the target count value to obtain a comparison result includes:

计算所述第一计数值和目标计数值的差值;Calculating a difference between the first count value and a target count value;

所述根据所述比较结果,修正所述目标振荡器输出的目标振荡器信号的频率,包括:The step of correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result includes:

在所述差值超出预设误差范围的情况下,对所述目标振荡器输出的目标振荡器信号的频率进行修正。When the difference exceeds a preset error range, 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, the difference between the first count value and the target count value can be further calculated, and the calculated difference can be used to determine whether to correct the frequency of the target oscillator signal output by the target oscillator. Specifically, when the difference exceeds the preset error range, the frequency of the target oscillator signal output by the target oscillator is corrected, and when the difference does not exceed the preset error range, the frequency of the target oscillator signal output by the target oscillator is stopped from being corrected. Thus, 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, thereby avoiding the problem of increased power consumption caused by always maintaining the correction mode.

所述根据所述比较结果,修正所述目标振荡器输出的目标振荡器信号的频率,包括:The step of correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result includes:

在所述第一计数值小于所述目标计数值的情况下,提高所述目标振荡器输出的目标振荡器信号的频率,直至所述第一计数值等于所述目标计数值;When the first count value is less than the target count value, increasing 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, the frequency of the target oscillator signal output by the target oscillator is reduced 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, therefore, when the first count value is less than the target count value, it means that the frequency of the target oscillator signal currently output by the target oscillator is lower than the target output frequency. At this time, the frequency of the target oscillator signal 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 when the first count value is greater than the target count value, it means that the frequency of the target oscillator signal currently output by the target oscillator is higher than the target output frequency. At this time, the frequency of the target oscillator signal output by the target oscillator should be reduced 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:

根据所述比较结果,设置跟踪步长,所述跟踪步长用于确定在修正所述目标振荡器输出的目标振荡器信号的频率时的修正幅度。A tracking step length is set according to the comparison result, and the tracking step length is used to determine a correction amplitude when correcting the frequency of a 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 a certain extent, the embodiment of the present invention can also 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 difference, so that the target oscillator signal output by the target oscillator can better track the reference oscillator signal, and at the same time, power consumption can be reduced.

可选的,所述跟踪步长:Optionally, the tracking step size:

ERVAL=A*|(N-K)|,ER VAL = A*|(NK)|,

其中,ERVAL为所述跟踪步长,A为预设系数,N为所述目标计数值,K为所述第一计数值。A的值可以根据|(N-K)|的值的大小进行设定,若|(N-K)|的值减小,A的值可以相应设置减小,使得跟踪步长减小,反之亦然。Wherein, ER VAL is the tracking step length, A is the preset coefficient, N is the target count value, and K is the first count value. The value of A can be set according to the value of |(NK)|. If the value of |(NK)| decreases, the value of A can be set to decrease accordingly, so that the tracking step length decreases, and vice versa.

换言之,跟踪步长随差值|(N-K)|的变化规律可以为:差值|(N-K)|越大,跟踪步长越大,差值|(N-K)|越小,跟踪步长越小;也就是说,差值|(N-K)|越大,则表明目标振荡器输出的目标振荡器信号的频率和目标输出频率相差较大,此时应增大跟踪步长,即加大修正幅度,以快速地将误差缩小,而差值|(N-K)|越小,则表明目标振荡器输出的目标振荡器信号的频率和目标输出频率相差较小,输出的频率较为准确,此时可以减小跟踪步长,即缩小修正幅度,以更精确、更快速地将目标振荡器输出的目标振荡器信号的频率修正至和目标输出频率一致。In other words, the law of change of the tracking step with the difference |(N-K)| can be as follows: the larger the difference |(N-K)|, the larger the tracking step, and the smaller the difference |(N-K)|, the smaller the tracking step; that is, the larger the difference |(N-K)|, the larger the tracking step, indicating that the frequency of the target oscillator signal output by the target oscillator and the target output frequency differ greatly. At this time, the tracking step should be increased, that is, the correction amplitude should be increased to quickly reduce the error, and the smaller the difference |(N-K)|, the smaller the frequency of the target oscillator signal output by the target oscillator and the target output frequency differ little, and the output frequency is more accurate. At this time, the tracking step can be reduced, that is, the correction amplitude can be reduced to more accurately and 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 of an embodiment of the present invention, the frequency signal output by the oscillator tracks the reference oscillator signal, thereby reducing the frequency fluctuation of the frequency signal output by the oscillator, and the oscillator does not need to use an interface clock, so the load is lower and the power consumption is also lower.

以上所述是本发明的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are some embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims (6)

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 period of time for counting the period of the reference oscillator signal to a preset count value to obtain a first count 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;
the oscillator device further includes:
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 correcting the frequency of the target oscillator signal output by the target oscillator;
The target count value is equal to the target output frequency of the target oscillator multiplied by the preset count value and divided by the frequency of the reference oscillator signal;
the tracking step size:
ERVAL=A*|(N-K)|,
Wherein ER VAL is the tracking step length, A is a preset coefficient, N is the target count value, and K is the first count value.
2. The oscillator device according to claim 1, wherein the comparing module comprises:
A calculating unit configured to calculate 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.
3. The oscillator device according to claim 1, wherein the correction module includes:
A first correction unit, configured to increase a frequency of a target oscillator signal output by the target oscillator, when the first count value is smaller than the target count value, until the first count value is equal to the target count value;
and the second correction unit is used for reducing the frequency of the target oscillator signal output by the target oscillator under the condition that the first count value is larger than the target count value until the first count value is equal to the target count value.
4. A method of calibrating the frequency of an oscillator, comprising:
counting the period of the target oscillator signal output by the target oscillator within the period of time from counting the period of the reference oscillator signal output by the reference oscillator to the preset count value, so as to obtain a first count 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;
the calibration method further comprises:
Setting a tracking step length according to the comparison result, wherein the tracking step length is used for determining a correction amplitude when correcting the frequency of a target oscillator signal output by the target oscillator;
The target count value is equal to the target output frequency of the target oscillator multiplied by the preset count value and divided by the frequency of the reference oscillator signal;
the tracking step size:
ERVAL=A*|(N-K)|,
Wherein ER VAL is the tracking step length, A is a preset coefficient, N is the target count value, and K is the first count value.
5. The method of calibrating an oscillator frequency according to claim 4, wherein comparing the first count value with a target count value results in a comparison result, comprising:
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 the following steps:
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.
6. The oscillator frequency calibration method according to claim 4, wherein the correcting the frequency of the target oscillator signal output by the target oscillator according to the comparison result includes:
Under the condition that the first count value is smaller than the target count value, the frequency of a target oscillator signal output by the target oscillator is increased until the first count value is equal to the target count value;
and under the condition that the first count value is larger than the target count value, reducing the frequency of a target oscillator signal output by the target oscillator until the first count value is equal to the target count value.
CN202011594284.3A 2020-12-29 2020-12-29 Oscillator device and oscillator frequency calibration method Active CN112636752B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011594284.3A CN112636752B (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 CN112636752B (en) 2020-12-29 2020-12-29 Oscillator device and oscillator frequency calibration method

Publications (2)

Publication Number Publication Date
CN112636752A CN112636752A (en) 2021-04-09
CN112636752B true CN112636752B (en) 2024-08-20

Family

ID=75286104

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN112636752B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115132114A (en) * 2022-06-24 2022-09-30 北京奕斯伟计算技术股份有限公司 Frequency compensation method, compensation circuit and display device
CN116318120B (en) * 2023-03-30 2024-05-03 归芯科技(深圳)有限公司 Calibration circuit, calibration method, chip and electronic equipment of RC oscillation clock

Citations (2)

* 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
CN107579723A (en) * 2017-08-04 2018-01-12 大唐微电子技术有限公司 A kind of method and apparatus of calibrating clock frequency

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8564375B2 (en) * 2011-12-30 2013-10-22 Fairchild Semiconductor Corporation Methods and apparatus for self-trim calibration of an oscillator
CN104702278A (en) * 2013-12-10 2015-06-10 炬芯(珠海)科技有限公司 Methods and device for calibrating frequencies
CN104734696B (en) * 2013-12-24 2017-11-03 上海东软载波微电子有限公司 Phase-locked loop frequency calibrates circuit and method
CN110492848A (en) * 2019-08-15 2019-11-22 成都锐成芯微科技股份有限公司 The number adjustment device and its method of adjustment of RC oscillator

Patent Citations (2)

* 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
CN107579723A (en) * 2017-08-04 2018-01-12 大唐微电子技术有限公司 A kind of method and apparatus of calibrating clock frequency

Also Published As

Publication number Publication date
CN112636752A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
CN102089981B (en) Automatic synchronization of an internal oscillator to an external frequency reference
US8237482B2 (en) Circuit and method for generating a clock signal
US8049569B1 (en) Circuit and method for improving the accuracy of a crystal-less oscillator having dual-frequency modes
US20050168255A1 (en) Compensation technique to mitigate aging effects in integrated circuit components
CN112636752B (en) Oscillator device and oscillator frequency calibration method
US8188776B2 (en) Phase-locked loop circuit
US10416706B2 (en) Calibration unit for calibrating an oscillator, oscillator arrangement and method for calibrating an oscillator
US20240113722A1 (en) Systems and Methods for Online Gain Calibration of Digital-to-Time Converters
TWI613890B (en) Frequency calibration method for digitally controlled oscillator and apparatus using the same
CN113031428B (en) Real-time clock device and electronic apparatus
US7688151B2 (en) Aging compensation method and control module for an oscillator circuit device
CN103501178B (en) High-stability time base oscillator automatic calibration circuit and method
CN113970698A (en) Method and system for calibrating off-chip crystal oscillator
TWI638517B (en) Mitigation of long wake-up delay of a crystal oscillator
US9692356B2 (en) Oscillator frequency tuning using bulk acoustic wave resonator
CN116909351B (en) Clock chip internal clock precision correction method
CN118232840A (en) Frequency generating device and operation method thereof
CN105116712A (en) Method for automatically calibrating built-in crystal oscillator
CN115567137A (en) Crystal oscillator frequency offset correction device and method based on GNSS system
CN107741523B (en) A time-domain signal measurement device based on PLL phase-locked loop
CN115276607B (en) A clock calibration structure and calibration method thereof
US11967962B2 (en) Oscillation system including frequency-locked loop logic circuit and operating method thereof
CN104168015A (en) Oscillating device and method for generating clock signal
US20090231045A1 (en) Frequency-locking device and frequency-locking method thereof
CN117544170A (en) Soft synchronous sampling method, system, equipment and medium based on B spline interpolation

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 ESWIN 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.

GR01 Patent grant
GR01 Patent grant