CN103138749B - The frequency calibrating method improved and device - Google Patents

The frequency calibrating method improved and device Download PDF

Info

Publication number
CN103138749B
CN103138749B CN201110377740.3A CN201110377740A CN103138749B CN 103138749 B CN103138749 B CN 103138749B CN 201110377740 A CN201110377740 A CN 201110377740A CN 103138749 B CN103138749 B CN 103138749B
Authority
CN
China
Prior art keywords
frequency
signal
value
dividing ratio
remainder
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.)
Expired - Fee Related
Application number
CN201110377740.3A
Other languages
Chinese (zh)
Other versions
CN103138749A (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.)
WUXI RFDOT MICROELECTRONICS Inc
Original Assignee
WUXI RFDOT MICROELECTRONICS Inc
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 WUXI RFDOT MICROELECTRONICS Inc filed Critical WUXI RFDOT MICROELECTRONICS Inc
Priority to CN201110377740.3A priority Critical patent/CN103138749B/en
Publication of CN103138749A publication Critical patent/CN103138749A/en
Application granted granted Critical
Publication of CN103138749B publication Critical patent/CN103138749B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Oscillators With Electromechanical Resonators (AREA)
  • Stabilization Of Oscillater, Synchronisation, Frequency Synthesizers (AREA)

Abstract

The invention provides a kind of frequency calibrating method and device, described frequency calibrating method comprises: according to the frequency of target frequency signal and the expected frequency determination frequency dividing ratio of reference frequency signal; Determine the corrected value of described frequency dividing ratio according to the actual frequency of reference frequency signal and the frequency shift (FS) of its expected frequency and correct remainder; Utilize described corrected value to correct described frequency dividing ratio to obtain correcting frequency dividing ratio; Cycle based on described correction remainder and a predetermined signal of adjusting frequency determines remainder offset; According to described correction frequency dividing ratio, frequency division is carried out to the actual frequency of described reference frequency signal, utilize described remainder offset and described predetermined signal of adjusting frequency to compensate described frequency division and obtain target frequency signal.Like this, very accurately fixed target frequency signal can be obtained.

Description

The frequency calibrating method improved and device
[technical field]
The present invention relates to Clock Design field, particularly a kind of frequency calibrating method and device.
[background technology]
In clock chip design, the precision of clock frequency is decided by the frequency accuracy of the quartz crystal used.Can both normally or synchronous working, in design of electronic circuits, accurate clock signal be provided to be very important in order to ensure all electronic devices.Described clock signal generally can be produced by crystal oscillator, and wherein said crystal oscillator utilizes the mechanical resonant of the oscillating crystal of piezoelectric to produce the electronic circuit of the certain frequency signal of telecommunication.This frequency is generally used for timing, also may be used for for digital integrated circuit provides clock signal, can also be used for the frequency of stable wireless launcher/receiver.The reason causing clock signal to be different from design is temperature, and it may affect the running of piezoelectric and crystal oscillator.Along with the change of temperature, the frequency that crystal oscillator exports also can change thereupon, and under normal circumstances, the frequency of quartz crystal generally presents the frequency stability of 20ppm ~ 100ppm to temperature.In high-precision applications as in global positioning system, such frequency accuracy can not meet the demands; Or usually need in the application to use chip or device year error in 5 minutes, it necessarily requires within the stability of 10ppm, and common crystal oscillator or frequency division frequency out may not reach this precision.
Therefore be necessary that the technical scheme proposing a kind of improvement is to overcome the problems referred to above.
[summary of the invention]
The object of this part is some aspects of general introduction embodiments of the invention and briefly introduces some preferred embodiments.May do in the specification digest and denomination of invention of this part and the application a little simplify or omit with avoid making this part, specification digest and denomination of invention object fuzzy, and this simplification or omit and can not be used for limiting the scope of the invention.
The object of the present invention is to provide a kind of frequency calibrating method and device, it can obtain target frequency signal accurately according to the reference frequency signal with frequency shift (FS).
According to object of the present invention, according to an aspect of the present invention, the invention provides a kind of frequency calibrating method, it comprises: obtain the actual frequency of reference frequency signal and the frequency shift (FS) of this actual frequency and its expected frequency; According to the frequency of target frequency signal and the expected frequency determination frequency dividing ratio of described reference frequency signal; Determine the corrected value of described frequency dividing ratio according to described frequency shift (FS) and correct remainder; Utilize described corrected value to correct described frequency dividing ratio to obtain correcting frequency dividing ratio; Cycle based on described correction remainder and a predetermined signal of adjusting frequency determines remainder offset; According to described correction frequency dividing ratio, frequency division is carried out to the actual frequency of described reference frequency signal, utilize described remainder offset and described predetermined signal of adjusting frequency to compensate described frequency division and obtain target frequency signal, the frequency of signal of wherein adjusting frequency is greater than the frequency of described reference frequency signal.
Further, described frequency dividing ratio adds or deducts described corrected value and obtain described correction frequency dividing ratio, the number of cycles of the predetermined signal of adjusting frequency shared by described correction remainder determines described remainder offset.
Further, the number in the cycle of the expected frequency of the reference frequency signal shared by the 1/2ft of described frequency shift (FS) determines described corrected value, remainder after the number of cycles of the expected frequency of the reference frequency signal shared by the 1/2ft of described frequency shift (FS) is determined to correct remainder, and ft is the frequency of target frequency signal.
Further, describedly according to described correction frequency dividing ratio, frequency division is carried out to the actual frequency of described reference frequency signal, utilize described remainder offset and described predetermined signal of adjusting frequency to compensate described frequency division to obtain target frequency signal and comprise: from initial value, count to get the first count value to the cycle of the actual frequency of described reference frequency signal, when the first count value reaches current correction frequency dividing ratio, again from initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, and start to count to get the second count value to the cycle of described signal of adjusting frequency, when the second count value reaches current compensation aggregate-value, the signal upset of described target frequency signal is with a upper half period of target end frequency signal, start the next half period of target frequency signal, the initial value of wherein said compensation aggregate-value equals initial remainder offset, in end after a half period, if previous compensation aggregate-value adds that up-to-date remainder offset exceedes predetermined carry value, then with previous compensation aggregate-value and up-to-date remainder offset and deduct value that described predetermined carry value obtains as current compensation aggregate-value, the up-to-date correction frequency dividing ratio that now current correction frequency dividing ratio equals to calculate adds 1, otherwise, with previous compensation aggregate-value and up-to-date remainder offset and as current compensation aggregate-value, now current correction frequency dividing ratio equals the up-to-date correction frequency dividing ratio calculated.
Again further, again recalculate according to the current actual frequency of described reference frequency signal and the current frequency offset of its expected frequency after the half period starting target frequency signal and obtain up-to-date correction frequency dividing ratio and up-to-date remainder offset.
According to another aspect of the present invention, the invention provides a kind of frequency correcting apparatus, it comprises: temperature acquisition module, obtains the temperature of crystal oscillator; Frequency signal generation module, obtains the actual frequency of reference frequency signal from described crystal oscillator; Frequency shift (FS) generation module, obtains the actual frequency of described reference frequency signal and the frequency shift (FS) of its expected frequency according to described temperature; And frequency correction module, according to described correction frequency dividing ratio, frequency division is carried out to the actual frequency of described reference frequency signal, utilize described remainder offset and described predetermined signal of adjusting frequency to compensate described frequency division and obtain target frequency signal.
Further, described frequency correction module adds or deducts described corrected value and obtains described correction frequency dividing ratio in described frequency dividing ratio, and the number of cycles of predetermined the adjust frequency signal of described frequency correction module shared by described correction remainder determines described remainder offset.
Further, the number in the cycle of the expected frequency of the reference frequency signal of described frequency correction module shared by the 1/2ft of described frequency shift (FS) determines described corrected value, remainder after the number of cycles of the expected frequency of the reference frequency signal shared by the 1/2ft of described frequency shift (FS) is determined to correct remainder, and ft is the frequency of target frequency signal.
Further, from initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, when the first count value reaches current correction frequency dividing ratio, again from initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, and start to count to get the second count value to the cycle of described signal of adjusting frequency, when the second count value reaches current compensation aggregate-value, the signal upset of described target frequency signal is with a upper half period of target end frequency signal, start the next half period of target frequency signal, the initial value of wherein said compensation aggregate-value equals initial remainder offset, in end after a half period, if previous compensation aggregate-value adds that up-to-date remainder offset exceedes predetermined carry value, then with previous compensation aggregate-value and up-to-date remainder offset and deduct value that described predetermined carry value obtains as current compensation aggregate-value, the up-to-date correction frequency dividing ratio that now current correction frequency dividing ratio equals to calculate adds 1, otherwise, with previous compensation aggregate-value and up-to-date remainder offset and as current compensation aggregate-value, now current correction frequency dividing ratio equals the up-to-date correction frequency dividing ratio calculated.
Further, again recalculate according to the current actual frequency of described reference frequency signal and the current frequency offset of its expected frequency after the half period starting target frequency signal and obtain up-to-date correction frequency dividing ratio and up-to-date remainder offset.
Compared with prior art, in frequency correction scheme provided by the invention, obtain corrected value according to the skew between the actual frequency of reference frequency signal and expected frequency and correct remainder, described corrected value is utilized to correct described frequency dividing ratio, utilize described correction remainder to carry out certain frequency division to compensate, target frequency signal more accurately can be obtained according to reference frequency signal like this.
[accompanying drawing explanation]
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.Wherein:
Fig. 1 is medium frequency bearing calibration of the present invention flow chart in one embodiment;
Fig. 2 is the temperature frequency characteristic curve schematic diagram in one embodiment of crystal oscillator;
One actual frequency signal frequency split is the schematic diagram of target frequency signal by Fig. 3 medium frequency bearing calibration of the present invention in one embodiment; With
Fig. 4 is medium frequency means for correcting of the present invention structural representation in one embodiment.
[embodiment]
Detailed description of the present invention carrys out the running of direct or indirect simulation technical solution of the present invention mainly through program, step, logical block, process or other symbolistic descriptions.For thorough understanding the present invention, in ensuing description, set forth a lot of specific detail.And when not having these specific detail, the present invention then may still can realize.Affiliated those of skill in the art use the work that these describe and statement effectively introduces them to the others skilled in the art in affiliated field herein essential.In other words, be object of the present invention of avoiding confusion, due to the method known and program easy understand, therefore they are not described in detail.
Alleged herein " embodiment " or " embodiment " refers to special characteristic, structure or the characteristic that can be contained at least one implementation of the present invention.Different local in this manual " in one embodiment " occurred not all refers to same embodiment, neither be independent or optionally mutually exclusive with other embodiments embodiment.In addition, represent sequence of modules in the method for one or more embodiment, flow chart or functional block diagram and revocablely refer to any particular order, not also being construed as limiting the invention.
The invention provides a kind of frequency calibrating method, it obtains corrected value according to the frequency shift (FS) of reference frequency signal and corrects remainder, utilize described corrected value to correct frequency dividing ratio to obtain correcting frequency dividing ratio, correction frequency dividing ratio is utilized to carry out frequency division to described reference frequency signal afterwards, described correction remainder is utilized to carry out frequency division compensation subsequently, can by equal for any reference frequency signal frequency division to required target frequency signal.
Fig. 1 is medium frequency bearing calibration 100 of the present invention flow chart in one embodiment, and described frequency calibrating method 100 comprises:
Step 110, obtains the actual frequency of reference frequency signal and the frequency shift (FS) of this actual frequency and its expected frequency.
Described reference frequency signal can be produced by crystal oscillator.Output frequency due to described crystal oscillator can be subject to the impact of temperature and produce drift, and actual frequency and its expected frequency of the reference frequency signal of therefore described crystal oscillator generation have certain frequency shift (FS) usually.For example, the expected frequency (or being called ideal frequency) of the reference frequency signal that one crystal oscillator produces is 32768HZ, and reality is due to the impact of temperature, the actual frequency obtained may only have 32760HZ or 32770HZ, so just there is certain frequency shift (FS).
Here frequency shift (FS) Δ ppm can be represented, this Δ ppm is relevant with the temperature of crystal oscillator.Under normal circumstances, the crystal oscillator produced has a temperature frequency characteristic curve schematic diagram according to the impact of internal material temperature factor, as shown in Figure 2, the actual frequency all corresponding different at each temperature according to the known crystal oscillator of this curve, and the difference between the expected frequency that this actual frequency and needs obtain can represent with Δ ppm, in Fig. 2 when temperature is T0, actual frequency f0 is 32760, and the frequency shift (FS) Δ ppm between expected frequency 32.768kHZ is (32768-32760)/32768*10 6=244.1ppm, i.e. alternatively frequency shift (FS) difference 244.1us per second under temperature T0.
A temperature frequency offset look-up table (lookup table) can be generated according to described temperature frequency characteristic curve in advance, corresponding frequency shift (FS) can be found according to Current Temperatures in this look-up table.Certainly, also can form a temperature frequency offset algorithm according to described temperature frequency characteristic curve, calculate corresponding frequency shift (FS) according to Current Temperatures and described temperature frequency offset algorithm.
In one embodiment, the temperature in crystal oscillator can be responded to by temperature inductor, then the temperature that described temperature inductor obtains is carried out digital-to-analogue conversion to obtain digital temperature, learn the actual frequency of the output signal of described crystal oscillator according to this digital temperature and the temperature frequency characteristic curve of the described crystal oscillator provided, and under learning this temperature further according to described actual frequency, need the frequency shift (FS) of correction.Certainly, the frequency shift (FS) of its correspondence also directly can be obtained according to digital temperature.
Step 120, according to the frequency of target frequency signal and the expected frequency determination frequency dividing ratio of described reference frequency signal.
In one embodiment, described frequency dividing ratio can be the half of the ratio of the expected frequency of described reference frequency signal and the frequency of described target frequency signal, assuming that the expected frequency of described reference frequency signal is f m, the frequency of described target frequency signal is f t, then described frequency dividing ratio is f m/ 2f t.Such as, expected frequency f mfor 32768HZ, want the frequency f of the target frequency signal obtained tfor 1HZ, then frequency dividing ratio is 16384, namely 2 14.And for example expected frequency f mfor 32768HZ, and want the frequency f of the target frequency signal obtained tfor 2HZ, then frequency dividing ratio is 8192, namely 213.
Step 130, according to corrected value and the correction remainder of described frequency shift (FS) determination frequency dividing ratio.
Because frequency dividing ratio obtains according to expected frequency, and under normal circumstances, the actual frequency of reference frequency signal and its expected frequency have certain frequency departure, so need to obtain the corrected value of described frequency dividing ratio according to frequency shift (FS) and correct remainder.
Be the half of the ratio of the expected frequency of described reference frequency signal and the frequency of described target frequency signal due to described frequency dividing ratio, then can according to the 1/2f of described frequency shift (FS) tthe number in the cycle of shared expected frequency determines described corrected value, can according to the 1/2f of described frequency shift (FS) tremainder after the number of cycles of shared expected frequency determines described correction remainder.
In one embodiment, when the expected frequency of described reference frequency signal is 32768HZ, the one-period of expected frequency is equal to 30.5 ppm (or the duration of one-period saying expected frequency is 30.5us), so be 100 (or saying 1 second difference 100us) at described frequency shift (FS) Δ ppm, the frequency f of target frequency signal tduring for 1HZ, the number in the cycle of its expected frequency shared by 1/2 is 1, and remaining mark is 19.5, and the corrected value namely obtained is 1, and correcting remainder is 19.5.Now, if the frequency f of target frequency signal tduring for 2HZ, frequency shift (FS) 1/4 shared by the number in cycle of expected frequency be 0, remaining mark is 25, and the integer corrected value namely obtained is 0, and remainder corrected value is 25.
Can find out, the one-period of the expected frequency mentioned above all refers to its minimum period.
Step 140, utilizes described corrected value to correct described frequency dividing ratio to obtain correcting frequency dividing ratio.
In one embodiment, when described frequency shift (FS) is for just (namely expected frequency is greater than actual frequency), described frequency dividing ratio is subtracted described corrected value as the integer correcting frequency dividing ratio, when described frequency shift (FS) is for negative (namely expected frequency is less than actual frequency), described frequency dividing ratio is added described corrected value as correction frequency dividing ratio.
It is understood that positive and negative all can define, frequency shift (FS) when such as also expected frequency can be greater than actual frequency is orientated as negative, in addition, and also can by upper for frequency shift (FS), integer corrected value and remaining mark corrected value definition itself symbol.On the basis of this paper disclosure content, affiliated those of skill in the art can also do other any apparent changes.
Step 150, the cycle (can refer to half period, 1 cycle or multiple cycle) based on described correction remainder and a predetermined signal of adjusting frequency determines remainder offset.
In fact, the time of 1 ppm is equivalent to 1us.Can find out, because described correction remainder is generally the multiple of 0.5us, so half period generally can be adopted to be the i.e. frequency of 0.5us be the frequency signal of 1MHZ as signal of adjusting frequency, now can count the number of the half period of described signal of adjusting frequency.One-period can certainly be adopted to be the frequency of 0.5us be the frequency signal of 2MHZ as described signal of adjusting frequency, now also can count the number of 1 of described signal of adjusting frequency or half period.If the frequency that one-period is 0.25us be the frequency signal of 4MHZ as described signal of adjusting frequency, so also can count the number of 1 of described signal of adjusting frequency or half period.
Therefore, adjust frequency cycle of signal (for the cycle counted described in shared by described correction remainder, such as half period, 1 cycle etc.) number determine described remainder offset, if be 6.5us than the remainder of described correction frequency dividing ratio, signal of adjusting frequency is 1MHZ, the cycle unit of counting is half period (0.5us), then described remainder offset is 13, if adjusted frequency, signal is 2MHZ, the cycle unit of counting is half period (0.25us), and so described remainder offset is just 26.Obviously, the frequency of the more described reference frequency signal of this signal of adjusting frequency is high, therefore for the skew in an inadequate reference frequency signal cycle, will compensate, can produce target frequency signal accurately like this based on this signal of adjusting frequency.
Step 160, carries out frequency division according to described correction frequency dividing ratio to the actual frequency of described reference frequency signal, utilizes described remainder offset and described predetermined signal of adjusting frequency to compensate described frequency division and obtains target frequency signal.
From initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, when the first count value reaches current correction frequency dividing ratio, again from initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, and start to count to get the second count value to the cycle of described signal of adjusting frequency, when the second count value reaches current compensation aggregate-value, the signal upset of described target frequency signal (such as overturns as low level from high level, or overturn as high level from low level) with a upper half period of target end frequency signal, start the next half period of target frequency signal.The initial value of wherein said compensation aggregate-value equals initial remainder offset, in end after a half period, if previous compensation aggregate-value (the compensation aggregate-value used when producing a half period) adds that up-to-date remainder offset exceedes predetermined carry value, then with previous compensation aggregate-value and up-to-date remainder offset and deduct value that described predetermined carry value obtains as current compensation aggregate-value, the up-to-date correction frequency dividing ratio that now current correction frequency dividing ratio equals to calculate adds 1, otherwise, with previous compensation aggregate-value and up-to-date remainder offset and as current compensation aggregate-value, now current correction frequency dividing ratio equals the up-to-date correction frequency dividing ratio calculated.
Due to frequency shift (FS) real-time change along with variations in temperature, the correction frequency dividing ratio thus obtained based on described frequency shift (FS) and remainder offset also need to vary with temperature and real-time change.In a preferred embodiment, at set intervals again based on the once up-to-date correction frequency dividing ratio of frequency offset computations and remainder offset, such as can just recalculate once up-to-date correction frequency dividing ratio and remainder offset every the half period of target frequency signal.
In one embodiment, be one-period to the cycle during the cycle of the actual frequency of described reference frequency signal counts.Cycle in counting the cycle of described adjustment reference frequency signal can for referring to half period, 1 cycle or multiple cycle, and this introduced in step 150.
For example, as shown in Figure 3, it illustrates the schematic diagram that the actual frequency frequency division of a reference frequency signal is target frequency signal by the present invention in one embodiment.Suppose that the frequency of described expected frequency signal is 32768, the initial value of the first count value is 0, the frequency needing the target frequency signal obtained is 1HZ, the up-to-date correction frequency dividing ratio calculated is 16382 always, correct remainder is 6.5 always, the frequency of the signal of adjusting frequency adopted is 1MHZ, and up-to-date remainder offset is 13 always, and described predetermined carry value is 30.5/0.5=61.
First count value starts the half period of described target frequency signal when being 0, from 0, the cycle of the actual frequency of described reference frequency signal is counted, when described first count value reaches current correction frequency dividing ratio 16382 (owing to not having carry, therefore up-to-date correction frequency dividing ratio is exactly current correction frequency dividing ratio) after, again start to count to get the first count value to the cycle of the actual frequency of described reference frequency signal from 0, from 0, the second count value is counted to get to the half period of described signal of adjusting frequency simultaneously, when the second count value reaches current compensation aggregate-value 13 (when counting first, current compensation aggregate-value equals initial remainder and compensates offset 13) time, the level upset of described target frequency signal, terminate a upper half period, start next half period.
Along with the counting of described first calculated value, when described first count value reaches current correction frequency dividing ratio 16382 (non-carry) again, again from 0, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, again from 0, the second count value is counted to get to the half period of described signal of adjusting frequency simultaneously, when the second count value reaches current compensation aggregate-value 26 (owing to not reaching predetermined carry value, current compensation aggregate-value now equals previous compensation aggregate-value 13 and adds up-to-date remainder offset 13) time, the level upset of described target frequency signal, terminate again the half period of described target frequency signal, start another half period of described target frequency signal.
Along with the counting of described first calculated value, when described first count value reaches current correction frequency dividing ratio 16382 (non-carry) again, again from 0, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, again from 0, the second count value is counted to get to the half period of described signal of adjusting frequency simultaneously, when the second count value reaches current compensation aggregate-value 39 (owing to not reaching predetermined carry value, current compensation aggregate-value now equals previous compensation aggregate-value 26 and adds up-to-date remainder offset 13) time, the level upset of described target frequency signal, terminate again the half period of described target frequency signal, start another half period of described target frequency signal.
As shown in Figure 3, when producing the 5th half period of described target frequency signal, previous compensation aggregate-value 52 adds that up-to-date remainder offset 13 is greater than described predetermined carry value 61, therefore when described first count value reaches current correction frequency dividing ratio 16382+1 (having carry) again, just again from 0, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, just again from 0, the second count value is counted to get to the half period of described signal of adjusting frequency, when the second count value reaches current compensation aggregate-value 4 (52+13-61=4), the level upset of described target frequency signal, terminate the half period of described target frequency frequency signal.
Continuous repetition above-mentioned steps just can produce accurate target frequency signal by continuous print.
It is to be noted that in this frequency calibrating method to the calculating correcting frequency dividing ratio and remainder offset be all a predetermined instant after the beginning in every half target frequency cycle carry out to obtain up-to-date correction frequency dividing ratio and remainder offset, in other words, in the first count value to starting during a predetermined value to calculate corresponding correction frequency dividing ratio and remainder offset.Such as, described predetermined instant can be, after every half target frequency cycle starting timing, start to calculate correction frequency dividing ratio and remainder offset when counting up to 2 or 3 to the cycle of described reference frequency signal.That is, the starting point starting to count in the first count value carries out the calculating of frequency dividing ratio soon.The up-to-date correction frequency dividing ratio at every turn calculated may be identical with up-to-date remainder offset, also may be different.
In sum, the present invention corrects frequency dividing ratio according to the skew between the actual frequency of reference frequency signal and expected frequency, can by equal for any reference frequency signal frequency division to required target frequency signal.The method wide accommodation, implementation method is simple.
The present invention also provides a kind of frequency correcting apparatus, it obtains corrected value according to the frequency shift (FS) of reference frequency signal and corrects remainder, utilize described corrected value to correct frequency dividing ratio to obtain correcting frequency dividing ratio, correction frequency dividing ratio is utilized to carry out frequency division to described reference frequency signal afterwards, described correction remainder is utilized to carry out frequency division compensation subsequently, can by equal for any reference frequency signal frequency division to required target frequency signal.
Fig. 4 is the device structural representation in one embodiment that medium frequency of the present invention corrects.The device 400 of described temperature and frequency correcting comprises temperature acquisition module 410, frequency signal generation module 420, frequency shift (FS) generation module 430 and frequency correction module 440.
Described temperature acquisition module 410, for obtaining the temperature in crystal oscillator, as temperature inductor can be utilized to obtain indoor temperature, and converts the analog temperature of described acquisition to digital temperature by A/D conversion circuit or device.This step is that those of ordinary skill in the field can both realize, and just no longer describes in detail here.
Described frequency signal generation module 420 obtains the actual frequency of reference frequency signal from described crystal oscillator.
Described frequency shift (FS) generation module 430 obtains the frequency shift (FS) between the actual frequency of described reference frequency signal and expected frequency according to described temperature.
Described reference frequency signal can be produced by crystal oscillator.Output frequency due to described crystal oscillator can be subject to the impact of temperature and produce drift, and actual frequency and its expected frequency of the reference frequency signal of therefore described crystal oscillator generation have certain frequency shift (FS) usually.For example, the expected frequency (or being called ideal frequency) of the reference frequency signal that one crystal oscillator produces is 32768HZ, and reality is due to the impact of temperature, the actual frequency obtained may only have 32760HZ or 32770HZ, so just there is certain frequency shift (FS).
Here frequency shift (FS) Δ ppm can be represented, this Δ ppm is relevant with the temperature of crystal oscillator.Under normal circumstances, the crystal oscillator produced has a temperature frequency characteristic curve schematic diagram according to the impact of internal material temperature factor, as shown in Figure 2, the actual frequency all corresponding different at each temperature according to the known crystal oscillator of this curve, and the difference between the expected frequency that this actual frequency and needs obtain can represent with Δ ppm, in Fig. 2 when temperature is T0, actual frequency f0 is 32760, and the frequency shift (FS) Δ ppm between expected frequency 32.768kHZ is (32768-32760)/32768*10 6=244.1ppm.
A temperature frequency offset look-up table (lookup table) can be generated according to described temperature frequency characteristic curve in advance, corresponding frequency shift (FS) can be found according to Current Temperatures in this look-up table.Certainly, also can form a temperature frequency offset algorithm according to described temperature frequency characteristic curve, calculate corresponding frequency shift (FS) according to Current Temperatures and described temperature frequency offset algorithm.
In one embodiment, the temperature in crystal oscillator can be responded to by temperature inductor, then the temperature that described temperature inductor obtains is carried out analog-to-digital conversion to obtain digital temperature, learn the actual frequency of the output signal of described crystal oscillator according to this digital temperature and the temperature frequency characteristic curve of the described crystal oscillator provided, and under learning this temperature further according to described actual frequency, need the frequency shift (FS) of correction.Certainly, the frequency shift (FS) of its correspondence also directly can be obtained according to digital temperature.
Described frequency correction module 440 carries out frequency division according to described correction frequency dividing ratio to the actual frequency of described reference frequency signal, utilizes described remainder offset and described predetermined signal of adjusting frequency to compensate described frequency division and obtains target frequency signal.
Concrete, described frequency correction module 440 counts to get the first count value to the cycle of the actual frequency of described reference frequency signal from initial value, when the first count value reaches current correction frequency dividing ratio, again from initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, and start to count to get the second count value to the cycle of described signal of adjusting frequency, when the second count value reaches current compensation aggregate-value, the signal upset of described target frequency signal (such as overturns as low level from high level, or overturn as high level from low level) with a upper half period of target end frequency signal, start the next half period of target frequency signal.The initial value of wherein said compensation aggregate-value equals initial remainder offset, in end after a half period, if previous compensation aggregate-value (the compensation aggregate-value used when producing a half period) adds that up-to-date remainder offset exceedes predetermined carry value, then with previous compensation aggregate-value and up-to-date remainder offset and deduct value that described predetermined carry value obtains as current compensation aggregate-value, the up-to-date correction frequency dividing ratio that now current correction frequency dividing ratio equals to calculate adds 1, otherwise, with previous compensation aggregate-value and up-to-date remainder offset and as current compensation aggregate-value, now current correction frequency dividing ratio equals the up-to-date correction frequency dividing ratio calculated.
In a preferred embodiment, again recalculate according to the current actual frequency of described reference frequency signal and the current frequency offset of its expected frequency after the half period starting target frequency signal and obtain up-to-date correction frequency dividing ratio and up-to-date remainder offset.
The concrete example obtaining target frequency signal can reference diagram 3 and associated description above, no longer repeats herein.
Above-mentioned explanation fully discloses the specific embodiment of the present invention.It is pointed out that the scope be familiar with person skilled in art and any change that the specific embodiment of the present invention is done all do not departed to claims of the present invention.Correspondingly, the scope of claim of the present invention is also not limited only to previous embodiment.

Claims (6)

1. a frequency calibrating method, is characterized in that, it comprises:
Obtain the actual frequency of reference frequency signal and the frequency shift (FS) of this actual frequency and its expected frequency;
According to the frequency of target frequency signal and the expected frequency determination frequency dividing ratio of described reference frequency signal;
Determine the corrected value of described frequency dividing ratio according to described frequency shift (FS) and correct remainder;
Utilize described corrected value to correct described frequency dividing ratio to obtain correcting frequency dividing ratio;
Cycle based on described correction remainder and a predetermined signal of adjusting frequency determines remainder offset;
According to described correction frequency dividing ratio, frequency division is carried out to the actual frequency of described reference frequency signal, utilizes described remainder offset and described predetermined signal of adjusting frequency to compensate described frequency division and obtain target frequency signal,
The frequency of wherein said predetermined signal of adjusting frequency is greater than the frequency of described reference frequency signal,
According to described correction frequency dividing ratio, frequency division is carried out to the actual frequency of described reference frequency signal, utilizes described remainder offset and described predetermined signal of adjusting frequency to compensate described frequency division and obtain target frequency signal and comprise:
From initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, when the first count value reaches current correction frequency dividing ratio, again from initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, and start to count to get the second count value to the cycle of described signal of adjusting frequency, when the second count value reaches current compensation aggregate-value, the signal upset of described target frequency signal is with a upper half period of target end frequency signal, start the next half period of target frequency signal,
The initial value of wherein said compensation aggregate-value equals initial remainder offset, in end after a half period, if previous compensation aggregate-value adds that up-to-date remainder offset exceedes predetermined carry value, then with previous compensation aggregate-value and up-to-date remainder offset and deduct value that described predetermined carry value obtains as current compensation aggregate-value, the up-to-date correction frequency dividing ratio that now current correction frequency dividing ratio equals to calculate adds 1, otherwise, with previous compensation aggregate-value and up-to-date remainder offset and as current compensation aggregate-value, now current correction frequency dividing ratio equals the up-to-date correction frequency dividing ratio calculated,
Again recalculate according to the current actual frequency of described reference frequency signal and the current frequency offset of its expected frequency after the half period starting target frequency signal starts and obtain up-to-date correction frequency dividing ratio and up-to-date remainder offset.
2. frequency calibrating method according to claim 1, it is characterized in that: in described frequency dividing ratio, add or deduct described corrected value obtain described correction frequency dividing ratio, the number of cycles of the predetermined signal of adjusting frequency shared by described correction remainder determines described remainder offset.
3. frequency calibrating method according to claim 1, is characterized in that: according to the 1/2f of described frequency shift (FS) tthe number in the cycle of the expected frequency of shared reference frequency signal determines described corrected value, according to the 1/2f of described frequency shift (FS) tremainder after the number of cycles of the expected frequency of shared reference frequency signal is determined to correct remainder, f tfor the frequency of target frequency signal.
4. a frequency correcting apparatus, is characterized in that, it comprises:
Temperature acquisition module, obtains the temperature of crystal oscillator;
Frequency signal generation module, obtains the actual frequency of reference frequency signal from described crystal oscillator;
Frequency shift (FS) generation module, obtains the actual frequency of described reference frequency signal and the frequency shift (FS) of its expected frequency according to described temperature; With
Frequency correction module, according to the frequency of target frequency signal and the expected frequency determination frequency dividing ratio of described reference frequency signal, determine the corrected value of described frequency dividing ratio according to described frequency shift (FS) and correct remainder, utilize described corrected value to correct described frequency dividing ratio to obtain correcting frequency dividing ratio, cycle based on described correction remainder and a predetermined signal of adjusting frequency determines remainder offset, according to described correction frequency dividing ratio, frequency division is carried out to the actual frequency of described reference frequency signal, utilize described remainder offset and described predetermined signal of adjusting frequency to compensate described frequency division and obtain target frequency signal, the frequency of wherein said predetermined signal of adjusting frequency is greater than the frequency of described reference frequency signal,
From initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, when the first count value reaches current correction frequency dividing ratio, again from initial value, the first count value is counted to get to the cycle of the actual frequency of described reference frequency signal, and start to count to get the second count value to the cycle of described predetermined signal of adjusting frequency, when the second count value reaches current compensation aggregate-value, the signal upset of described target frequency signal is with a upper half period of target end frequency signal, start the next half period of target frequency signal,
The initial value of wherein said compensation aggregate-value equals initial remainder offset, in end after a half period, if previous compensation aggregate-value adds that up-to-date remainder offset exceedes predetermined carry value, then with previous compensation aggregate-value and up-to-date remainder offset and deduct value that described predetermined carry value obtains as current compensation aggregate-value, the up-to-date correction frequency dividing ratio that now current correction frequency dividing ratio equals to calculate adds 1, otherwise, with previous compensation aggregate-value and up-to-date remainder offset and as current compensation aggregate-value, now current correction frequency dividing ratio equals the up-to-date correction frequency dividing ratio calculated,
Again recalculate according to the current actual frequency of described reference frequency signal and the current frequency offset of its expected frequency after the half period starting target frequency signal and obtain up-to-date correction frequency dividing ratio and up-to-date remainder offset.
5. frequency correcting apparatus according to claim 4, it is characterized in that: described frequency correction module adds or deducts described corrected value and obtains described correction frequency dividing ratio in described frequency dividing ratio, the number of cycles of predetermined the adjust frequency signal of described frequency correction module shared by described correction remainder determines described remainder offset.
6. frequency correcting apparatus according to claim 5, is characterized in that: described frequency correction module is according to the 1/2f of described frequency shift (FS) tthe number in the cycle of the expected frequency of shared reference frequency signal determines described corrected value, according to the 1/2f of described frequency shift (FS) tremainder after the number of cycles of the expected frequency of shared reference frequency signal is determined to correct remainder, f tfor the frequency of target frequency signal.
CN201110377740.3A 2011-11-24 2011-11-24 The frequency calibrating method improved and device Expired - Fee Related CN103138749B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110377740.3A CN103138749B (en) 2011-11-24 2011-11-24 The frequency calibrating method improved and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110377740.3A CN103138749B (en) 2011-11-24 2011-11-24 The frequency calibrating method improved and device

Publications (2)

Publication Number Publication Date
CN103138749A CN103138749A (en) 2013-06-05
CN103138749B true CN103138749B (en) 2015-09-09

Family

ID=48498142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110377740.3A Expired - Fee Related CN103138749B (en) 2011-11-24 2011-11-24 The frequency calibrating method improved and device

Country Status (1)

Country Link
CN (1) CN103138749B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066030B (en) * 2016-12-30 2020-01-14 深圳市鼎阳科技股份有限公司 Signal source and multi-frequency output compensation method and system thereof
CN107818542B (en) * 2017-10-30 2021-06-04 凌云光技术股份有限公司 Image deformation repairing method and device
CN112422084B (en) * 2019-08-20 2024-04-19 Oppo广东移动通信有限公司 Temperature compensation method and device for crystal oscillator, electronic equipment and storage medium
WO2021102678A1 (en) * 2019-11-26 2021-06-03 深圳市欢太科技有限公司 Vibration control method, terminal device, and storage medium
CN111669346B (en) * 2020-05-29 2023-05-26 上海橙群微电子有限公司 GFSK frequency offset correction method for low-power consumption Bluetooth
CN113933601B (en) * 2021-09-13 2023-09-15 北京车和家信息技术有限公司 Pulse width modulation signal acquisition method, device, computer equipment and storage medium
CN114347679B (en) * 2021-12-31 2022-11-29 东莞市启思达智能技术有限公司 Variable-precision signal processing method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1420632A (en) * 2002-04-17 2003-05-28 湘潭师范学院 Virtual signal generator for generating square wave by remainder interpolation comparision
CN101861701A (en) * 2007-11-14 2010-10-13 松下电器产业株式会社 Synthesizer, synthesizer module, and reception device and electronic device using same
CN102141771A (en) * 2011-03-08 2011-08-03 无锡辐导微电子有限公司 Frequency correction method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102118159B (en) * 2009-12-30 2013-06-05 意法半导体研发(深圳)有限公司 Circuit and method for generating clock signal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1420632A (en) * 2002-04-17 2003-05-28 湘潭师范学院 Virtual signal generator for generating square wave by remainder interpolation comparision
CN101861701A (en) * 2007-11-14 2010-10-13 松下电器产业株式会社 Synthesizer, synthesizer module, and reception device and electronic device using same
CN102141771A (en) * 2011-03-08 2011-08-03 无锡辐导微电子有限公司 Frequency correction method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
宋跃等."一种新的矩形波设计方法-余数插补比较法研究".《仪器仪表学报》.2004,第25卷(第2期),正文第240页. *

Also Published As

Publication number Publication date
CN103138749A (en) 2013-06-05

Similar Documents

Publication Publication Date Title
CN103138749B (en) The frequency calibrating method improved and device
CN102141771B (en) Frequency correction method and device
JP3085511B2 (en) Reference frequency generator
CN100456858C (en) Time error compensation device and method for terminal
CN105049040A (en) Method for correcting output frequency of CPT (Coherent Population Trapping) atomic clock through GNSS(Global Navigation Satellite System)
CN106292839B (en) Real-time clock compensation circuit and calibration method, device
CN102231907A (en) Clock synchronization method and apparatus in transmission system
CN102388536A (en) Reference frequency generator device
CN106569544A (en) Real time clock chip, and clock calibration method and apparatus
JP5972450B2 (en) Signal processing device
CN101090547A (en) Method and device for calibrating sleep clock of TD-SCDMA terminal
RU2012101223A (en) DEVICE AND METHOD AND ADJUSTMENT OF TIME AND FREQUENCY HETERODYN
CN106383438B (en) One kind taming and dociling clock method based on sliding window time extension high-precision
CN114205045B (en) TTE network clock calibration method and system
EP1756678A1 (en) Measuring clock jitter
JP2012195840A (en) Communication apparatus and communication control method
CN103684358A (en) Sampling pulse generation method and device
CN111010174B (en) Method and circuit for improving time-keeping metering precision
US11537087B2 (en) Method for adjusting the mean frequency of a time base incorporated in an electronic watch
CN106612104B (en) Real-time clock error compensation device and method
TW201740230A (en) Method for testing the rate of a quartz watch
CN114594669B (en) Accurate synchronization method for transient wave recording type fault indicator
JP5142167B2 (en) Multiple point simultaneous measurement method, multiple point simultaneous measurement system of electric station, and internal clock used therefor
CN104635193A (en) SOC chip real-time clock high-precision compensation method for electric meters
CN106444966A (en) Device and method for adjusting real time clock (RTC)

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150909

Termination date: 20161124