CN106292839A - Real-time clock compensates circuit and calibration steps, device - Google Patents

Real-time clock compensates circuit and calibration steps, device Download PDF

Info

Publication number
CN106292839A
CN106292839A CN201610655911.7A CN201610655911A CN106292839A CN 106292839 A CN106292839 A CN 106292839A CN 201610655911 A CN201610655911 A CN 201610655911A CN 106292839 A CN106292839 A CN 106292839A
Authority
CN
China
Prior art keywords
frequency
real
steps
circuit
deviation values
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.)
Granted
Application number
CN201610655911.7A
Other languages
Chinese (zh)
Other versions
CN106292839B (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.)
Shanghai Eastsoft Microelectronics Co Ltd
Original Assignee
Shanghai Eastsoft Microelectronics 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 Shanghai Eastsoft Microelectronics Co Ltd filed Critical Shanghai Eastsoft Microelectronics Co Ltd
Priority to CN201610655911.7A priority Critical patent/CN106292839B/en
Publication of CN106292839A publication Critical patent/CN106292839A/en
Application granted granted Critical
Publication of CN106292839B publication Critical patent/CN106292839B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/14Time supervision arrangements, e.g. real time clock

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Electric Clocks (AREA)

Abstract

A kind of real-time clock compensates circuit and calibration steps, device, and described real-time clock compensates circuit and includes that agitator, described calibration steps include: obtains described real-time clock and compensates the current temperature value of circuit local environment;Corresponding exemplary frequency deviation values is obtained according to described current temperature value;Being adjusted described exemplary frequency deviation values, and calculate first frequency adjustment number of steps according to the exemplary frequency deviation values after adjusting, it is integer that described first frequency adjusts number of steps;Adjust number of steps according to described first frequency the frequency of oscillation of described agitator is adjusted.Use such scheme, real-time clock can be improved and compensate the output accuracy of circuit.

Description

Real-time clock compensates circuit and calibration steps, device
Technical field
The present invention relates to field of electronic devices, particularly relate to a kind of real-time clock and compensate circuit and calibration steps, device.
Background technology
Real-time clock (Real Time Clock, RTC) circuit is that one need not communication sync identification and can realize the time The module calculated, is generally made up of quartz crystal, oscillating circuit and frequency counting and frequency dividing circuit etc..By to 32768Hz The frequency of crystal counts, it is achieved Continuous plus and the output to the time.Real-time clock is at necks such as electronic watch, intelligent electric meters Territory is widely used.
When RTC dispatches from the factory, although can be clock accuracy adjustment to the highest precision, such as, at 1PPM (Percent Per Million, part per million) within, but in actual use, the ambient temperature of RTC circuit changes and can cause Clock frequency is drifted about.If do not calibrated RTC circuit, then clock can produce the deviation of about ± 2.6 seconds every day.
In prior art, generally by the method for temperature-compensating, RTC circuit is calibrated.Generally, by temperature Inductive circuit detection temperature value, and use the mode tabled look-up to determine the exemplary frequency deviation values under this temperature value, so that RTC to be carried out accordingly Compensate.
The compensation precision of existing RTC temperature compensation is relatively low, and the output accuracy causing RTC is relatively low.
Summary of the invention
Present invention solves the technical problem that the output accuracy being how to improve real-time clock.
For solving above-mentioned technical problem, the embodiment of the present invention provides a kind of real-time clock to compensate the calibration steps of circuit, institute State real-time clock compensation circuit and include that agitator, described calibration steps include: obtain described real-time clock and compensate ring residing for circuit The current temperature value in border;Corresponding exemplary frequency deviation values is obtained according to described current temperature value;Described exemplary frequency deviation values is adjusted Whole, and calculate first frequency adjustment number of steps according to the exemplary frequency deviation values after adjusting, it is whole that described first frequency adjusts number of steps Number;Adjust number of steps according to described first frequency the frequency of oscillation of described agitator is adjusted.
Optionally, described according to adjust after exemplary frequency deviation values calculate first frequency adjust number of steps, including: according to described The frequency of oscillation of agitator, calculates single step corresponding to described frequency of oscillation and adjusts frequency values;By the frequency departure after described adjustment Value and described single step adjust frequency values and are divided by, and the quotient obtained adjusts number of steps as described first frequency.
Optionally, described according to described first frequency adjust number of steps the frequency of oscillation of described agitator is adjusted, Including: the number of oscillation described first frequency adjusting number of steps corresponding with the output 1s pulse of described agitator is added, and obtains Compensate, as the described real-time clock after adjusting, the number of oscillation that circuit output 1s pulse is corresponding with value.
Optionally, described described exemplary frequency deviation values is adjusted, including: described exemplary frequency deviation values is adjusted with described single step Whole frequency values is divided by, and obtains second frequency and adjusts number of steps;When described second frequency adjustment number of steps is non-integer, to described Exemplary frequency deviation values is adjusted.
Optionally, described real-time clock compensates circuit and includes capacitor array, described adjusts described exemplary frequency deviation values Whole, including: calculate the frequency adjustment that described exemplary frequency deviation values is corresponding;Obtain the capacitor array corresponding to described frequency adjustment Target number n of the middle electric capacity that need to close;The electric capacity number being in closure state in described capacitor array is adjusted to n, with right Described exemplary frequency deviation values is adjusted so that described exemplary frequency deviation values is the integral multiple that described single step adjusts frequency values.
Optionally, described frequency adjustment meet following relation: f (n)=| X1-X0|, wherein, X0Described in before adjusting Exemplary frequency deviation values;X1For the described exemplary frequency deviation values after adjusting, and X1The integral multiple numerical value of frequency values is adjusted in all described single steps In, with X0Absolute difference minimum;F (n) is described frequency adjustment.
Optionally, the exemplary frequency deviation values after described adjustment meets following relation: work as n1During > 1/2 × Δ f, X1=(M+1) × Δf;Work as n1During <-1/2 × Δ f, X1=(M-1) × Δ f;Wherein: n1For X0The remainder that division arithmetic obtains, M is carried out with Δ f Adjust the integer part of number of steps for described second frequency, Δ f is that described single step adjusts frequency values.
Optionally, described calibration steps also includes: when described second frequency adjustment number of steps is integer, by described second The number of oscillation that frequency adjusts the output 1s pulse of number of steps and described agitator corresponding is added, after that obtain and value is as adjustment Described real-time clock compensates the number of oscillation that circuit output 1s pulse is corresponding.
For solving the problems referred to above, the embodiment of the present invention additionally provides a kind of real-time clock and compensates the calibrating installation of circuit, institute State real-time clock to compensate circuit and include that agitator, described calibrating installation include: temperature value acquiring unit, be used for obtaining described in real time The current temperature value of clock compensation circuit local environment;Exemplary frequency deviation values acquiring unit, for obtaining according to described current temperature value Take the exemplary frequency deviation values of correspondence;Exemplary frequency deviation values adjustment unit, for being adjusted described exemplary frequency deviation values;Computing unit, Adjusting number of steps for calculating first frequency according to the exemplary frequency deviation values after adjusting, it is whole that described first frequency adjusts number of steps Number;Frequency of oscillation adjustment unit, is carried out the frequency of oscillation of described agitator for adjusting number of steps according to described first frequency Adjust.
Optionally, described computing unit, for the frequency of oscillation according to described agitator, calculate described frequency of oscillation corresponding Single step adjust frequency values;Exemplary frequency deviation values after described adjustment and described single step are adjusted frequency values be divided by, the quotient obtained Number of steps is adjusted as described first frequency.
Optionally, described frequency of oscillation adjustment unit, for adjusting number of steps and described agitator by described first frequency The number of oscillation addition that output 1s pulse is corresponding, obtain and value compensates circuit output 1s as the described real-time clock after adjusting The number of oscillation that pulse is corresponding.
Optionally, described exemplary frequency deviation values adjustment unit, for adjusting frequency by described exemplary frequency deviation values with described single step Value is divided by, and obtains second frequency and adjusts number of steps;When described second frequency adjustment number of steps is non-integer, inclined to described frequency Difference is adjusted.
Optionally, described real-time clock compensates circuit and includes capacitor array, described exemplary frequency deviation values adjustment unit, is used for Calculate the frequency adjustment that described exemplary frequency deviation values is corresponding;Obtain and the capacitor array corresponding to described frequency adjustment needs Guan Bi Target number n of electric capacity;The electric capacity number being in closure state in described capacitor array is adjusted to n, with to described frequency Deviation value is adjusted so that described exemplary frequency deviation values is the integral multiple that described single step adjusts frequency values.
Optionally, described frequency adjustment meet following relation: f (n)=| X1-X0|, wherein, X0Described in before adjusting Exemplary frequency deviation values;X1For the described exemplary frequency deviation values after adjusting, and X1The integral multiple numerical value of frequency values is adjusted in all described single steps In, with X0Absolute difference minimum;F (n) is described frequency adjustment.
Optionally, the exemplary frequency deviation values after described adjustment meets following relation: work as n1During > 1/2 × Δ f, X1=(M+1) × Δf;Work as n1During <-1/2 × Δ f, X1=(M-1) × Δ f;Wherein: n1For X0The remainder that division arithmetic obtains, M is carried out with Δ f Adjust the integer part of number of steps for described second frequency, Δ f is that described single step adjusts frequency values.
Optionally, described frequency of oscillation adjustment unit, it is additionally operable to when described second frequency adjustment number of steps is integer, will The number of oscillation that described second frequency adjusts number of steps corresponding with the output 1s pulse of described agitator is added, obtain and value conduct Described real-time clock after adjustment compensates the number of oscillation that circuit output 1s pulse is corresponding.
The embodiment of the present invention additionally provides a kind of real-time clock and compensates circuit, including: agitator, and any of the above-described kind of institute The real-time clock stated compensates the calibrating installation of circuit, wherein: described agitator, for exporting the vibration letter of built-in oscillation frequency Number.
Compared with prior art, the technical scheme of the embodiment of the present invention has the advantages that
After getting exemplary frequency deviation values according to current temperature value, exemplary frequency deviation values is adjusted so that according to tune It is integer that the calculated first frequency of exemplary frequency deviation values after whole adjusts number of steps, such that it is able to avoid the occurrence of because choosing and the One frequency adjusts the close integer value of number of steps and is adjusted frequency of oscillation and the error that causes, therefore can be accurately to shaking The frequency of oscillation swinging device is adjusted, and improves the output accuracy of real-time clock.
Accompanying drawing explanation
Fig. 1 is the flow chart that a kind of real-time clock in the embodiment of the present invention compensates the calibration steps of circuit;
Fig. 2 is the function curve of the electric capacity number knots modification in one embodiment of the invention and second output bias value knots modification;
Fig. 3 is the flow chart that the another kind of real-time clock in the embodiment of the present invention compensates the calibration steps of circuit;
Fig. 4 is the structural representation that a kind of real-time clock in the embodiment of the present invention compensates the calibrating installation of circuit;
Fig. 5 is the structural representation that a kind of real-time clock in the embodiment of the present invention compensates circuit.
Detailed description of the invention
In prior art, generally by the method for temperature-compensating, RTC is calibrated, can be by the timing error control of RTC Make in the range of ± 5PPM (1/1000000th), it is ensured that the RTC accuracy of timekeeping error of a day is in 0.5s.
In existing temperature compensation, generally detect temperature value by temperature sensor either internally or externally.Root According to current temperature value, tabling look-up and obtain the frequency compensation value that current temperature value is corresponding, the output to RTC compensates.Such as, exist After getting current temperature value, by searching frequency-temperature characteristic curve table, find the frequency departure that current temperature value is corresponding Value, changes pulse frequency division value according to exemplary frequency deviation values and realizes clock alignment.
But, in existing RTC temperature compensation, generally cannot get the frequency departure that all of temperature value is corresponding Value, therefore, the current temperature value got may not exist in frequency-temperature characteristic curve table, now, can only be in frequency temperature Degree characteristic curve table selects the frequency compensation value that a temperature value immediate with current temperature value is corresponding.Therefore, existing There is the problem that compensation precision is relatively low in RTC temperature compensation, the output accuracy causing RTC is relatively low.
In embodiments of the present invention, after getting exemplary frequency deviation values according to current temperature value, exemplary frequency deviation values is entered Row sum-equal matrix so that adjusting number of steps according to the calculated first frequency of exemplary frequency deviation values after adjusting is integer, such that it is able to Avoid the occurrence of and adjust the close integer value of number of steps with first frequency and frequency of oscillation is adjusted and the error that causes because choosing, Therefore accurately the frequency of oscillation of agitator can be adjusted, improve the output accuracy of real-time clock.
Understandable for enabling the above-mentioned purpose of the present invention, feature and beneficial effect to become apparent from, below in conjunction with the accompanying drawings to this The specific embodiment of invention is described in detail.
Embodiments provide a kind of real-time clock and compensate the calibration steps of circuit, with reference to Fig. 1, below by way of specifically Step is described in detail.
Step S101, obtains described real-time clock and compensates the current temperature value of circuit local environment.
In being embodied as, real-time clock can be obtained by temperature sensing elements such as temperature sensors and compensate ring residing for circuit The current temperature value in border, it is also possible to obtain real-time clock by warming circuit and compensate the current temperature value of circuit local environment.
Temperature sensor can compensate circuit with real-time clock and integrate, it is also possible to compensate electricity independent of real-time clock Road is arranged.Warming circuit can also be arranged on real-time clock and compensate inside circuit, or sets independent of real-time clock compensation circuit Put.
Step S102, obtains corresponding exemplary frequency deviation values according to described current temperature value.
Step S103, is adjusted described exemplary frequency deviation values, and calculates the first frequency according to the exemplary frequency deviation values after adjusting Rate adjusts number of steps.
In being embodied as, after getting exemplary frequency deviation values, can first the exemplary frequency deviation values got be adjusted Whole, and calculate first frequency adjustment number of steps according to the exemplary frequency deviation values after adjusting.Now, calculated first frequency is adjusted Whole number of steps is integer.
In embodiments of the present invention, single step corresponding to frequency of oscillation can be calculated adjust first according to the frequency of oscillation of agitator Whole frequency values, it is that agitator often vibrates frequency shift amount once that single step adjusts frequency values.Set the frequency of oscillation of agitator as f0, then single step adjusts frequency values is Δ f=1/f0, generally, Δ f is adjusted in units of PPM.
After being calculated single step and adjusting frequency values, the exemplary frequency deviation values after adjusting and single step adjust frequency values and carry out Division arithmetic, the quotient obtained is first frequency and adjusts number of steps, and now, it is whole that the first frequency obtained adjusts number of steps Number.
In embodiments of the present invention, before exemplary frequency deviation values is adjusted, can first determine a need for frequency Deviation value is adjusted.First the exemplary frequency deviation values got in step S102 and single step can be adjusted frequency values and carry out division fortune Calculate, the quotient obtained is adjusted number of steps as second frequency, namely: m2=X0/ Δ f, wherein: m2Step is adjusted for second frequency Enter number, X0For exemplary frequency deviation values, the unit of exemplary frequency deviation values can be PPM.
When the second frequency obtained adjusts number of steps m2During for integer, can be without exemplary frequency deviation values be adjusted;When The second frequency obtained adjusts number of steps m2During for non-integer, namely exemplary frequency deviation values X0Cannot coverlet successive step frequency values Δ f whole Except time, exemplary frequency deviation values can be adjusted, the exemplary frequency deviation values after adjustment be single step adjust frequency values Δ f integral multiple.
In being embodied as, default capacitor array can be adjusted, realize the adjustment to exemplary frequency deviation values.
In embodiments of the present invention, capacitor array can be provided with in real-time clock compensates circuit, can in capacitor array To include multiple electric capacity parallel with one another.The capacitance of each electric capacity is equal, and each electric capacity exists one and goes here and there therewith The switch of connection.The disconnection switched by control or Guan Bi, the electric capacity that can control correspondence disconnects or Guan Bi.
In an embodiment of the present invention, capacitor array includes 1024 electric capacity, and accordingly, capacitor array includes 1024 Individual switch, connects with 1024 electric capacity one_to_one corresponding respectively.
In capacitor array, when the electric capacity number difference closed in capacitor array, the output capacitance of capacitor array can be sent out Changing.When the output capacitance of capacitor array changes, the frequency of oscillation of agitator can be produced certain impact, cause The frequency of oscillation of agitator changes.
Therefore, by adjusting the electric capacity number of Guan Bi in capacitor array, the frequency of oscillation of agitator can be adjusted.
It is known that the frequency of oscillation temperature influence of agitator can produce frequency departure from the above embodiment of the present invention Value.Additionally, when the output capacitance of capacitor array changes, the frequency of oscillation of agitator can be affected.Therefore, it can lead to Cross the output capacitance to capacitor array to be adjusted, thus realize exemplary frequency deviation values is adjusted.
In embodiments of the present invention, can realize frequency inclined by adjusting the electric capacity number of Guan Bi in capacitor array Difference is adjusted.The purpose being adjusted exemplary frequency deviation values is: exemplary frequency deviation values is adjusted to single step and adjusts frequency values Integral multiple.When exemplary frequency deviation values is adjusted, can first calculate the frequency adjustment that exemplary frequency deviation values is corresponding, according to frequency Rate adjustment amount obtains target number n of the electric capacity needing Guan Bi in capacitor array, and the unit of frequency adjustment can be PPM.It After, the electric capacity number being in closure state in capacitor array is adjusted to n, thus realizes exemplary frequency deviation values is adjusted.
In embodiments of the present invention, frequency adjustment can meet following relation: f (n)=| X1-X0|, wherein, X0For adjusting Exemplary frequency deviation values before whole, X1For the exemplary frequency deviation values after adjusting, f (n) is frequency adjustment;X1Frequency is adjusted for all single steps In the integral multiple numerical value of value, with X0The minimum numerical value of the absolute value of difference.
In an embodiment of the present invention, n is worked as1During > 1/2 × Δ f, exemplary frequency deviation values is adjusted to X1=(M+1) × Δ f, Namely frequency adjustment f (n) of exemplary frequency deviation values=(M+1) × Δ f-X0;Work as n1During <-1/2 × Δ f, exemplary frequency deviation values is adjusted Whole for X1=(M-1) × Δ f, namely frequency adjustment f (n) of exemplary frequency deviation values=X0-(M-1)×Δf;Wherein, n1For X0With Δ f carries out the remainder that division arithmetic obtains, and M is the integer part that second frequency adjusts number of steps.
After frequency adjustment f (n) getting exemplary frequency deviation values, exemplary frequency deviation values can be adjusted, then adopt Carrying out division arithmetic by the exemplary frequency deviation values after adjusting with single step adjustment frequency values Δ f, the quotient obtained is first frequency and adjusts Whole number of steps.
Below to the electricity being in closure state in frequency adjustment f (n) provided in the embodiment of the present invention and capacitor array The relation holding number n illustrates.
In actual applications, compensate circuit chip for each piece of real-time clock, can be in advance to each piece of real-time clock The capacitor array compensated in circuit chip carries out substantial amounts of test, knows the electric capacity number of Guan Bi and the frequency of oscillation of agitator The mapping relations of change, the change of the frequency of oscillation of agitator can be represented by second output bias value, second output bias value Unit can be PPM.
Such as, capacitor array includes 1024 electric capacity, then test the electric capacity number of Guan Bi when being followed successively by 0~1024, right The second output bias value of the 1025 groups of agitators answered.
In actual applications, when the electric capacity number that capacitor array includes is more, if the second of 1025 groups of agitators of test Output bias value, may spend the more testing time.For reducing the testing time, can only choose several numerical value, test The second output bias value of agitator frequency of oscillation when the electric capacity number of Guan Bi is the numerical value chosen.
Such as, choose 0,1,2,4,8,16,32,64,128,256,512,513,514,516,520,528,544,576, 640,768,1023 as the electric capacity number of the Guan Bi in capacitor array, and the electric capacity number testing Guan Bi respectively is above-mentioned 21 Second output bias value corresponding during numerical value.
Table 1
With reference to table 1, give the electric capacity number of Guan Bi in one embodiment of the invention and the mapping table of second output bias value, Give the electric capacity number of Guan Bi be respectively 0,1,2,4,8,16,32,64,128,256,512,513,514,516,520,528, 544,576,640,768,1023 time corresponding second output bias value.
For ease of calculating, being 512 as datum mark using the electric capacity number of Guan Bi, the electric capacity number obtaining Guan Bi respectively is relative In the electric capacity number knots modification of datum mark, and second output knots modification is relative to the second output bias value knots modification of datum mark.As, When the electric capacity number of Guan Bi is 0, relative to datum mark, electric capacity number knots modification is 0-512=-512, and second output bias value changes Amount is 71.22-11.93=59.29PPM.And for example, when the electric capacity number of Guan Bi is 256, relative to datum mark, electric capacity number changes Variable is 256-512=-256, and second output bias value knots modification is 33.97-11.93=22.04PPM.
To in table 1, use Function Fitting software that the mapping of electric capacity number knots modification with second output bias value knots modification is closed System is fitted, and the fitting function obtained is:
Y=-0.00098x3+0.16092x2-14.71337x-2.03670; (1)
Wherein, x is second output bias value knots modification, and y is electric capacity number knots modification.
With reference to Fig. 2, for formula (1), the curve that formula (1) is corresponding can be obtained.In Fig. 2, abscissa x is that second output is inclined Difference knots modification, vertical coordinate y is electric capacity number knots modification.
When the electric capacity number of the Guan Bi in capacitor array is other values, the electric capacity number of Guan Bi can be updated to formula (1), in, i.e. would know that the second output bias value knots modification that the electric capacity number of Guan Bi is corresponding.
In an embodiment of the present invention, after getting frequency adjustment f (n), f (n) is brought into above-mentioned matching as x In function (1), the y value obtained being added with 512, obtain and value is in the capacitor array corresponding to frequency adjustment f (n) The electric capacity number of Guan Bi.
Such as, f (n) is brought in formula (1) as x, obtains y=1, then Guan Bi in corresponding for f (n) capacitor array Electric capacity number is 512+1=513.
When described second frequency adjustment number of steps is integer, second frequency can be directly used to adjust number of steps to vibration The frequency of oscillation of device is adjusted.In a particular embodiment, second frequency can be adjusted number of steps and export 1s arteries and veins with agitator The number of oscillation addition that punching is corresponding, obtain compensates, for real-time clock, the number of oscillation that circuit output 1s pulse is corresponding with value.
In embodiments of the present invention, agitator can be sheet internal oscillator, can be off-chip agitator.
Step S104, adjusts number of steps according to described first frequency and is adjusted the frequency of oscillation of described agitator.
In embodiments of the present invention, after being calculated first frequency adjustment number of steps, first frequency can be used to adjust The frequency of oscillation of agitator is adjusted by number of steps.In embodiments of the present invention, first frequency can be adjusted number of steps with The number of oscillation addition that agitator output 1s pulse is corresponding, obtain and value is real-time clock and compensates circuit output 1s pulse pair The number of oscillation answered.
Such as, the reference oscillating frequency of agitator is 32768Hz, namely the number of oscillation that agitator output 1s pulse is corresponding Being 32768 times, calculated first frequency adjusts number of steps m1=3, then, after being adjusted, real-time clock compensates circuit output The number of oscillation corresponding to 1s pulse is 32768+m1=32771 times.
Below by citing, the calibration steps that the real-time clock provided in the above embodiment of the present invention compensates circuit is carried out Explanation.
With reference to Fig. 3, give the flow process that the another kind of real-time clock in the embodiment of the present invention compensates the calibration steps of circuit Figure.
Step S301, adjusts frequency values by the exemplary frequency deviation values got and single step and does division arithmetic.
In an embodiment of the present invention, real-time clock compensates circuit and uses reference oscillating frequency to be the agitator of 32768Hz, Namely: agitator often vibrate 32768 times time, real-time clock compensate circuit output 1 1s pulse.
It is Δ f=(1/32768) × 10 that the single step that reference oscillating frequency is corresponding adjusts frequency values6≈30.5PPM。
For ease of calculating, make Δ f=30.5PPM, getting exemplary frequency deviation values X0Afterwards, by X0Frequency is adjusted with single step Value Δ f is divided by, and the business obtained adjusts number of steps m for second frequency2, m2=X0/Δf.Work as m2During for integer, by m2With 32768 phases Adding, obtain is the number of oscillation that real-time clock compensates the corresponding agitator of pulse of circuit output 1s with value, it may be assumed that agitator The number of oscillation is (m2+ 32768) pulse of output 1s time secondary.
As the business m obtained2During for decimal, obtain remainder n1And m2Integer part M, n1=X0% Δ f, i.e. n1For X0Right The value that Δ f delivery obtains.
Step S302, it is judged that n1Whether more than 1/2 × Δ f.
Work as n1During > 1/2 × Δ f, namely n1> 15.25PPM, performs step S303;Otherwise, perform step S304.
Step S303, calculates first frequency and adjusts number of steps m1, m1=M+1, and by n1It is updated to n1=n1-Δf.Afterwards, Perform step S306.
Step S304, it is judged that n1Whether less than-1/2 × Δ f.
Work as n1During <-1/2 × Δ f, namely n1During <-15.25PPM, perform step S305;Otherwise, work as n1≥-1/2×Δ During f, perform step S306.
Step S305, calculates first frequency and adjusts number of steps m1, m1=M-1, and by n1It is updated to n1=n1+Δf.Afterwards, Perform step S306.
Step S306, the number of oscillation that agitator is often exported 1s pulse corresponding is adjusted to 32768+m1
Step S307, calculates the electric capacity number of Guan Bi in capacitor array.
In an embodiment of the present invention, the n after updating1It is brought in formula (1) as x, electric capacity can be calculated Number knots modification y.Electric capacity number knots modification y and 512 is added, i.e. can get the electric capacity number of Guan Bi in capacitor array.
Step S308, controlling the electric capacity number of Guan Bi in capacitor array is y+512.
Such as, y=10, then controlling the electric capacity number of Guan Bi in capacitor array is in 10+512=522, namely capacitor array The electric capacity number being in closure state is 522.
With reference to Fig. 4, the embodiment of the present invention additionally provides a kind of real-time clock and compensates the calibrating installation 40 of circuit, described in real time Clock compensation circuit includes that agitator, described calibrating installation 40 include: temperature value acquiring unit 401, exemplary frequency deviation values obtain single Unit 402, exemplary frequency deviation values adjustment unit 403, computing unit 404 and frequency of oscillation adjustment unit 405, wherein:
Temperature value acquiring unit 401, compensates the current temperature value of circuit local environment for obtaining described real-time clock;
Exemplary frequency deviation values acquiring unit 402, for obtaining corresponding exemplary frequency deviation values according to described current temperature value;
Exemplary frequency deviation values adjustment unit 403, for being adjusted described exemplary frequency deviation values;
Computing unit 404, the exemplary frequency deviation values calculating first frequency adjustment number of steps after being used for according to adjustment, described first It is integer that frequency adjusts number of steps;
Frequency of oscillation adjustment unit 405, for adjusting the number of steps vibration to described agitator according to described first frequency Frequency is adjusted.
In being embodied as, described computing unit 404, may be used for the frequency of oscillation according to described agitator, calculate institute State single step corresponding to frequency of oscillation and adjust frequency values;Exemplary frequency deviation values after described adjustment is adjusted frequency values phase with described single step Removing, the quotient obtained adjusts number of steps as described first frequency.
In being embodied as, described frequency of oscillation adjustment unit 405, may be used for described first frequency is adjusted number of steps The number of oscillation corresponding with the output 1s pulse of described agitator is added, and obtain and value is mended as the described real-time clock after adjusting Repay the number of oscillation that circuit output 1s pulse is corresponding.
In being embodied as, described exemplary frequency deviation values adjustment unit 403, may be used for described exemplary frequency deviation values with described Single step adjusts frequency values and is divided by, and obtains second frequency and adjusts number of steps;When described second frequency adjustment number of steps is non-integer, Described exemplary frequency deviation values is adjusted.
In being embodied as, described real-time clock compensates and can include in circuit that capacitor array, described exemplary frequency deviation values are adjusted Whole unit 403, may be used for calculating the frequency adjustment that described exemplary frequency deviation values is corresponding;Obtain corresponding to described frequency adjustment Capacitor array in need target number n of electric capacity of Guan Bi;The electric capacity number being in closure state in described capacitor array is adjusted Whole for n, so that described exemplary frequency deviation values is adjusted so that described exemplary frequency deviation values is the integer that described single step adjusts frequency values Times.
In being embodied as, described frequency adjustment meet following relation: f (n)=| X1-X0|, wherein, X0Before adjusting Described exemplary frequency deviation values;X1For the described exemplary frequency deviation values after described adjustment, and X1Frequency values is adjusted with all described single steps In integral multiple numerical value, with X0Absolute difference minimum;F (n) is described frequency adjustment.
In being embodied as, the exemplary frequency deviation values after described adjustment meets following relation: work as n1During > 1/2 × Δ f, X1= (M+1)×Δf;Work as n1During <-1/2 × Δ f, X1=(M-1) × Δ f;Wherein: n1For X0Carry out what division arithmetic obtained with Δ f Remainder, M is the integer part that described second frequency adjusts number of steps, and Δ f is that described single step adjusts frequency values.
In being embodied as, described frequency of oscillation adjustment unit 405, it is also possible to for adjusting stepping when described second frequency When number is for integer, the number of oscillation described second frequency adjusting number of steps corresponding with the output 1s pulse of described agitator is added, Obtain compensates, as the described real-time clock after adjusting, the number of oscillation that circuit output 1s pulse is corresponding with value.
In being embodied as, with reference to Fig. 5, the embodiment of the present invention additionally provides a kind of real-time clock and compensates circuit, including: shake Swing device 501, and the real-time clock provided in the above embodiment of the present invention compensate the calibrating installation 502 of circuit, wherein:
Described agitator 501, is the agitator for exporting built-in oscillation frequency signal.
In being embodied as, described real-time clock compensates circuit and can also include: capacitor array 503;Described real-time clock Compensate the calibrating installation 502 of circuit, may be used for calculating the frequency adjustment that described exemplary frequency deviation values is corresponding;Obtain described frequency Capacitor array corresponding to adjustment amount needs target number n of the electric capacity of Guan Bi;Described capacitor array will be in closure state Electric capacity number be adjusted to n, so that described exemplary frequency deviation values to be adjusted so that described exemplary frequency deviation values be described single step adjust The integral multiple of frequency values.
In embodiments of the present invention, capacitor array 503 can include multiple electric capacity parallel with one another.Each electric capacity Capacitance is equal, and each electric capacity exists a switch connected in series.The disconnection switched by control or Guan Bi, can To control corresponding electric capacity disconnection or Guan Bi.In an embodiment of the present invention, capacitor array 503 includes 1024 electric capacity, Accordingly, capacitor array 503 includes 1024 switches, connects with 1024 electric capacity one_to_one corresponding respectively.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can Completing instructing relevant hardware by program, this program can be stored in a computer-readable recording medium, storage Medium may include that ROM, RAM, disk or CD etc..
Although present disclosure is as above, but the present invention is not limited to this.Any those skilled in the art, without departing from this In the spirit and scope of invention, all can make various changes or modifications, therefore protection scope of the present invention should be with claim institute Limit in the range of standard.

Claims (17)

1. the calibration steps of a real-time clock compensation circuit, it is characterised in that described real-time clock compensates circuit and includes vibration Device, described calibration steps includes:
Obtain described real-time clock and compensate the current temperature value of circuit local environment;
Corresponding exemplary frequency deviation values is obtained according to described current temperature value;
Described exemplary frequency deviation values is adjusted, and calculates first frequency adjustment number of steps according to the exemplary frequency deviation values after adjusting, It is integer that described first frequency adjusts number of steps;
Adjust number of steps according to described first frequency the frequency of oscillation of described agitator is adjusted.
2. real-time clock as claimed in claim 1 compensates the calibration steps of circuit, it is characterised in that described according to adjusting after Exemplary frequency deviation values calculates first frequency and adjusts number of steps, including:
According to the frequency of oscillation of described agitator, calculate single step corresponding to described frequency of oscillation and adjust frequency values;
Exemplary frequency deviation values after described adjustment and described single step being adjusted frequency values be divided by, the quotient obtained is as described first frequency Rate adjusts number of steps.
3. real-time clock as claimed in claim 2 compensates the calibration steps of circuit, it is characterised in that described according to described first Frequency adjust number of steps the frequency of oscillation of described agitator is adjusted, including: by described first frequency adjust number of steps with The number of oscillation addition that the output 1s pulse of described agitator is corresponding, obtain and value compensates as the described real-time clock after adjusting The number of oscillation that circuit output 1s pulse is corresponding.
4. real-time clock as claimed in claim 2 compensates the calibration steps of circuit, it is characterised in that described inclined to described frequency Difference is adjusted, including:
Described exemplary frequency deviation values and described single step are adjusted frequency values be divided by, obtain second frequency and adjust number of steps;When described When two frequencies adjustment number of steps are non-integer, described exemplary frequency deviation values is adjusted.
5. real-time clock as claimed in claim 4 compensates the calibration steps of circuit, it is characterised in that described real-time clock compensates Circuit includes capacitor array, described is adjusted described exemplary frequency deviation values, including: calculate described exemplary frequency deviation values corresponding Frequency adjustment;
Obtain target number n of the electric capacity needing Guan Bi in the capacitor array corresponding to described frequency adjustment;
The electric capacity number being in closure state in described capacitor array is adjusted to n, so that described exemplary frequency deviation values is adjusted, Making described exemplary frequency deviation values is the integral multiple that described single step adjusts frequency values.
6. real-time clock as claimed in claim 5 compensates the calibration steps of circuit, it is characterised in that described frequency adjustment is full Following relation: the f (n) of foot=| X1-X0|, wherein, X0For the described exemplary frequency deviation values before adjusting;X1For the described frequency after adjusting Deviation value, and X1In all described single steps adjust the integral multiple numerical value of frequency values, with X0Absolute difference minimum;F (n) is Described frequency adjustment.
7. real-time clock as claimed in claim 6 compensates the calibration steps of circuit, it is characterised in that the frequency after described adjustment Deviation value meets following relation:
Work as n1During > 1/2 × Δ f, X1=(M+1) × Δ f;
Work as n1During <-1/2 × Δ f, X1=(M-1) × Δ f;
Wherein: n1For X0Carrying out, with Δ f, the remainder that division arithmetic obtains, M is the integer portion that described second frequency adjusts number of steps Point, Δ f is that described single step adjusts frequency values.
8. real-time clock as claimed in claim 4 compensates the calibration steps of circuit, it is characterised in that also include: when described the When two frequencies adjustment number of steps are integer, described second frequency is adjusted number of steps corresponding with the output 1s pulse of described agitator The number of oscillation is added, and obtain compensates, as the described real-time clock after adjusting, the vibration time that circuit output 1s pulse is corresponding with value Number.
9. the calibrating installation of a real-time clock compensation circuit, it is characterised in that described real-time clock compensates circuit and includes vibration Device, described calibrating installation includes:
Temperature value acquiring unit, compensates the current temperature value of circuit local environment for obtaining described real-time clock;
Exemplary frequency deviation values acquiring unit, for obtaining corresponding exemplary frequency deviation values according to described current temperature value;
Exemplary frequency deviation values adjustment unit, for being adjusted described exemplary frequency deviation values;
Computing unit, adjusts number of steps for calculating first frequency according to the exemplary frequency deviation values after adjusting, and described first frequency is adjusted Whole number of steps is integer;
Frequency of oscillation adjustment unit, is carried out the frequency of oscillation of described agitator for adjusting number of steps according to described first frequency Adjust.
10. real-time clock as claimed in claim 9 compensates the calibrating installation of circuit, it is characterised in that described computing unit, uses In the frequency of oscillation according to described agitator, calculate single step corresponding to described frequency of oscillation and adjust frequency values;After described adjustment Exemplary frequency deviation values and described single step adjust frequency values and be divided by, the quotient obtained adjusts number of steps as described first frequency.
11. real-time clocks as claimed in claim 10 compensate the calibrating installation of circuit, it is characterised in that described frequency of oscillation is adjusted Whole unit, is added for the number of oscillation described first frequency adjusting number of steps corresponding with the output 1s pulse of described agitator, Obtain compensates, as the described real-time clock after adjusting, the number of oscillation that circuit output 1s pulse is corresponding with value.
12. real-time clocks as claimed in claim 10 compensate the calibrating installation of circuit, it is characterised in that described exemplary frequency deviation values Adjustment unit, is divided by for described exemplary frequency deviation values and described single step are adjusted frequency values, obtains second frequency and adjusts number of steps; When described second frequency adjustment number of steps is non-integer, described exemplary frequency deviation values is adjusted.
13. real-time clocks as claimed in claim 12 compensate the calibrating installation of circuit, it is characterised in that described real-time clock is mended Repaying circuit and include capacitor array, described exemplary frequency deviation values adjustment unit, for calculating the frequency that described exemplary frequency deviation values is corresponding Adjustment amount;Obtain target number n of the electric capacity needing Guan Bi in the capacitor array corresponding to described frequency adjustment;By described electric capacity The electric capacity number being in closure state in array is adjusted to n, to be adjusted described exemplary frequency deviation values so that described frequency is inclined Difference is the integral multiple that described single step adjusts frequency values.
14. real-time clocks as claimed in claim 13 compensate the calibrating installation of circuit, it is characterised in that described frequency adjustment Meet following relation: f (n)=| X1-X0|, wherein, X0For the described exemplary frequency deviation values before adjusting;X1For the described frequency after adjusting Rate deviation value, and X1In all described single steps adjust the integral multiple numerical value of frequency values, with X0Absolute difference minimum;f(n) For described frequency adjustment.
15. real-time clocks as claimed in claim 14 compensate the calibrating installation of circuit, it is characterised in that the frequency after described adjustment Rate deviation value meets following relation:
Work as n1During > 1/2 × Δ f, X1=(M+1) × Δ f;
Work as n1During <-1/2 × Δ f, X1=(M-1) × Δ f;
Wherein: n1For X0Carrying out, with Δ f, the remainder that division arithmetic obtains, M is the integer portion that described second frequency adjusts number of steps Point, Δ f is that described single step adjusts frequency values.
16. real-time clocks as claimed in claim 12 compensate the calibrating installation of circuit, it is characterised in that described frequency of oscillation is adjusted Whole unit, is additionally operable to, when described second frequency adjustment number of steps is integer, described second frequency adjust number of steps with described The number of oscillation addition that agitator output 1s pulse is corresponding, obtain and value compensates circuit as the described real-time clock after adjusting The number of oscillation that output 1s pulse is corresponding.
17. 1 kinds of real-time clocks compensate circuit, it is characterised in that including: agitator, and such as any one of claim 9-16 institute The real-time clock stated compensates the calibrating installation of circuit, wherein:
Described agitator, for exporting the oscillator signal of built-in oscillation frequency.
CN201610655911.7A 2016-08-11 2016-08-11 Real-time clock compensation circuit and calibration method, device Active CN106292839B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610655911.7A CN106292839B (en) 2016-08-11 2016-08-11 Real-time clock compensation circuit and calibration method, device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610655911.7A CN106292839B (en) 2016-08-11 2016-08-11 Real-time clock compensation circuit and calibration method, device

Publications (2)

Publication Number Publication Date
CN106292839A true CN106292839A (en) 2017-01-04
CN106292839B CN106292839B (en) 2019-05-31

Family

ID=57669402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610655911.7A Active CN106292839B (en) 2016-08-11 2016-08-11 Real-time clock compensation circuit and calibration method, device

Country Status (1)

Country Link
CN (1) CN106292839B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107272821A (en) * 2017-06-07 2017-10-20 上海东软载波微电子有限公司 Calibration method of real-time clock and device, storage medium, electronic equipment
CN107612635A (en) * 2017-08-15 2018-01-19 维沃移动通信有限公司 A kind of calibration method, mobile terminal and computer-readable recording medium
CN108259036A (en) * 2018-01-09 2018-07-06 上海顺久电子科技有限公司 VCO and its transmitting frequency calibration method, electronic equipment and computer storage media
CN109597297A (en) * 2018-12-11 2019-04-09 烟台持久钟表有限公司 A kind of crystal oscillator compensation method and device
CN110289812A (en) * 2019-06-28 2019-09-27 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of crystal oscillator frequency compensation
CN110311673A (en) * 2019-06-24 2019-10-08 Oppo广东移动通信有限公司 A kind of transmitting frequency calibration method, terminal and storage medium
CN111665431A (en) * 2020-04-26 2020-09-15 江西联智集成电路有限公司 Method, device, equipment and medium for calibrating clock source in chip

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045317B (en) * 2019-12-26 2022-02-25 展讯通信(上海)有限公司 Calibration method, device and system of equipment clock, self-calibration method and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141771A (en) * 2011-03-08 2011-08-03 无锡辐导微电子有限公司 Frequency correction method and device
CN102624331A (en) * 2012-04-01 2012-08-01 钜泉光电科技(上海)股份有限公司 Temperature-compensation circuit and temperature-compensation method of real-time clock
CN103116385A (en) * 2013-03-01 2013-05-22 华为技术有限公司 Correcting circuit and real-time clock circuit
CN103297116A (en) * 2012-03-01 2013-09-11 联发科技股份有限公司 Method for performing real time clock calibration, and associated apparatus
US8901983B1 (en) * 2013-09-30 2014-12-02 Micro Crystal Ag Temperature compensated timing signal generator
CN104518758A (en) * 2013-09-30 2015-04-15 微晶公司 Temperature compensated timing signal generator

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141771A (en) * 2011-03-08 2011-08-03 无锡辐导微电子有限公司 Frequency correction method and device
CN103297116A (en) * 2012-03-01 2013-09-11 联发科技股份有限公司 Method for performing real time clock calibration, and associated apparatus
CN102624331A (en) * 2012-04-01 2012-08-01 钜泉光电科技(上海)股份有限公司 Temperature-compensation circuit and temperature-compensation method of real-time clock
CN103116385A (en) * 2013-03-01 2013-05-22 华为技术有限公司 Correcting circuit and real-time clock circuit
US8901983B1 (en) * 2013-09-30 2014-12-02 Micro Crystal Ag Temperature compensated timing signal generator
CN104518758A (en) * 2013-09-30 2015-04-15 微晶公司 Temperature compensated timing signal generator

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107272821A (en) * 2017-06-07 2017-10-20 上海东软载波微电子有限公司 Calibration method of real-time clock and device, storage medium, electronic equipment
CN107612635A (en) * 2017-08-15 2018-01-19 维沃移动通信有限公司 A kind of calibration method, mobile terminal and computer-readable recording medium
CN108259036A (en) * 2018-01-09 2018-07-06 上海顺久电子科技有限公司 VCO and its transmitting frequency calibration method, electronic equipment and computer storage media
CN108259036B (en) * 2018-01-09 2021-09-28 上海顺久电子科技有限公司 VCO, frequency calibration method thereof, electronic device, and computer storage medium
CN109597297A (en) * 2018-12-11 2019-04-09 烟台持久钟表有限公司 A kind of crystal oscillator compensation method and device
CN109597297B (en) * 2018-12-11 2020-09-08 烟台持久钟表有限公司 Crystal oscillator compensation method and device
CN110311673A (en) * 2019-06-24 2019-10-08 Oppo广东移动通信有限公司 A kind of transmitting frequency calibration method, terminal and storage medium
CN110311673B (en) * 2019-06-24 2024-02-02 Oppo广东移动通信有限公司 Frequency calibration method, terminal and storage medium
CN110289812A (en) * 2019-06-28 2019-09-27 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of crystal oscillator frequency compensation
CN111665431A (en) * 2020-04-26 2020-09-15 江西联智集成电路有限公司 Method, device, equipment and medium for calibrating clock source in chip

Also Published As

Publication number Publication date
CN106292839B (en) 2019-05-31

Similar Documents

Publication Publication Date Title
CN106292839A (en) Real-time clock compensates circuit and calibration steps, device
CN100456858C (en) Time error compensation device and method for terminal
US8237482B2 (en) Circuit and method for generating a clock signal
KR100687230B1 (en) Real time clock apparatus and the real time compensating method thereof
CN103684255B (en) The compensation calibration of the temperature compensating crystal oscillator of built-in crystal judges control method
CN106569544B (en) Real-time timepiece chip and its clock correcting method, device
CN103176400B (en) Intelligent ammeter clock calibration method
CN1052083C (en) Correcting time indication of electronic watch
CN107272821A (en) Calibration method of real-time clock and device, storage medium, electronic equipment
CN101452307A (en) System and method of calibrating real time clock utilizing average calibration
CN103454904B (en) Improve quartz watch to keep time the method for precision and quartz watch
CN102253638A (en) Frequency stability control and compensation method for automatically keeping time in complex environment
CN102520608A (en) Method and device for automatically correcting automobile vehicle-mounted clock
CN105978555A (en) Real-time clock timing precision correction circuit and method with temperature compensation function
CN110262210A (en) Crystal oscillator based on counter is kept time method
CN109212560A (en) Method and apparatus for compensating the frequency inaccuracy of the frequency generator of such as oscillator
CN104753528A (en) Segmental automatic frequency control (AFC) calibration method and system
CN107733369A (en) Temperature compensating crystal oscillator
CN104635193B (en) A kind of SOC real-time clock high-accuracy compensation method of ammeter
CN109617528A (en) It is a kind of for correcting the method and its system of active oscillator frequency
CN102739155B (en) Frequency generator, correction circuit of frequency generator and multi-order compensation unit
CN101388646A (en) Successive approximation temperature and frequency correcting method and device
JP2006303764A (en) Temperature compensation method of temperature compensation oscillation circuit, temperature compensation oscillation circuit, piezoelectric device, and electronic apparatus
CN111897202A (en) RTC (real time clock) calibration circuit and method of smoke detector MCU (microprogrammed control Unit)
JP7503683B2 (en) Integrated Circuits

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant