CN110932718A - Method, device and equipment for calibrating clock frequency of crystal oscillator and storage medium - Google Patents

Method, device and equipment for calibrating clock frequency of crystal oscillator and storage medium Download PDF

Info

Publication number
CN110932718A
CN110932718A CN201911204816.5A CN201911204816A CN110932718A CN 110932718 A CN110932718 A CN 110932718A CN 201911204816 A CN201911204816 A CN 201911204816A CN 110932718 A CN110932718 A CN 110932718A
Authority
CN
China
Prior art keywords
temperature
crystal
oscillator
crystal oscillator
temperatures
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
CN201911204816.5A
Other languages
Chinese (zh)
Other versions
CN110932718B (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.)
Unisoc Spreadtrum Communication Huizhou Co Ltd
Original Assignee
Unisoc Spreadtrum Communication Huizhou 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 Unisoc Spreadtrum Communication Huizhou Co Ltd filed Critical Unisoc Spreadtrum Communication Huizhou Co Ltd
Priority to CN201911204816.5A priority Critical patent/CN110932718B/en
Publication of CN110932718A publication Critical patent/CN110932718A/en
Application granted granted Critical
Publication of CN110932718B publication Critical patent/CN110932718B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L1/00Stabilisation of generator output against variations of physical values, e.g. power supply
    • H03L1/02Stabilisation of generator output against variations of physical values, e.g. power supply against variations of temperature only
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L7/00Automatic control of frequency or phase; Synchronisation
    • H03L7/06Automatic control of frequency or phase; Synchronisation using a reference signal applied to a frequency- or phase-locked loop
    • H03L7/08Details of the phase-locked loop
    • H03L7/099Details of the phase-locked loop concerning mainly the controlled oscillator of the loop

Landscapes

  • Oscillators With Electromechanical Resonators (AREA)

Abstract

The embodiment of the application provides a method, a device, equipment and a storage medium for calibrating the clock frequency of a crystal oscillator, wherein the method comprises the following steps: when a global positioning system is started, acquiring the current environment temperature, the temperature of a crystal and the temperature inside an oscillator, and acquiring the frequency deviation of the crystal oscillator according to the temperature of the crystal, the temperature inside the oscillator and a temperature drift curve corresponding to the temperature range in which the environment temperature is located, wherein the temperature drift curve represents the relationship among the frequency deviation of the crystal oscillator, the temperature of the crystal and the temperature inside the oscillator in the temperature range, and the clock frequency of the crystal oscillator is calibrated according to the frequency deviation of the crystal oscillator. The frequency deviation of the crystal oscillator is determined by adopting the temperature drift curve corresponding to the temperature range of the environment temperature, the temperature drift compensation under different environment temperatures is realized, and the precision of the clock frequency of the crystal oscillator is improved by carrying out the temperature drift compensation on the oscillator and the crystal of the crystal oscillator circuit.

Description

Method, device and equipment for calibrating clock frequency of crystal oscillator and storage medium
Technical Field
The present application relates to the field of mobile communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for calibrating a clock frequency of a crystal oscillator.
Background
With the increase of the integration of mobile terminals, from the viewpoint of cost and technology, the Connectivity System (connection System) of mobile terminals, including Bluetooth (BT) and wireless internet WI-FI, the Global Positioning System (GPS), and the communication System common clock of mobile terminals have become a trend. At present, an external clock source of a mobile terminal mainly comprises a temperature compensated Crystal Oscillator (TCXO) and a Crystal, wherein a temperature compensation circuit is integrated in the TCXO, a voltage of a varactor diode is controlled or a thermal compensation network is adopted to form a reverse compensation voltage so as to adjust or offset a temperature drift of an output frequency of the Crystal due to temperature influence, and after temperature compensation, a typical temperature drift range of the TCXO is +/-0.5 ppm- +/-2 ppm; crystal is less expensive but its frequency drifts with temperature, typically +/-10ppm, and different crystals at the same temperature will vary by +/-10 ppm.
In the related art, in order to save cost, a digital compensated crystal Oscillator (DCXO) and a temperature compensation circuit are generally used as an external clock source of the mobile terminal.
However, the compensation method can only solve the static temperature drift variation of the crystal itself, so that only the temperature drift compensation under the normal temperature can be realized, the dynamic temperature drift is not solved, the internal temperature of the vibrator is not compensated, and the variation of the internal temperature of the oscillator can influence the variation of the internal capacitance value of the oscillator, thereby influencing the precision of the clock frequency of the crystal oscillator.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for calibrating clock frequency of a crystal oscillator, which aim to solve the problems that temperature drift compensation is not carried out on extreme temperature and temperature drift generated by the temperature in an oscillator in the prior art is not carried out.
In a first aspect, an embodiment of the present application provides a method for calibrating a clock frequency of a crystal oscillator, including:
when a global positioning system is started, acquiring the current ambient temperature, the temperature of the crystal and the temperature inside the oscillator;
acquiring the frequency deviation of the crystal oscillator according to the temperature of the crystal, the temperature inside the oscillator and a temperature drift curve corresponding to the temperature range where the environment temperature is located, wherein the temperature drift curve represents the relationship among the frequency deviation of the crystal oscillator, the temperature of the crystal and the temperature inside the oscillator in the temperature range;
and calibrating the clock frequency of the crystal oscillator according to the frequency deviation of the crystal oscillator.
In one possible implementation, the method further comprises:
adjusting a load capacitor in the crystal oscillator circuit under a reference temperature to calibrate the clock frequency of the crystal oscillator;
at a plurality of equipment temperatures, respectively sending signals to electronic equipment at a fixed frequency, wherein the electronic equipment is used for determining the frequency deviation of the crystal oscillator at each equipment temperature according to the received signals and sending the frequency deviation to terminal equipment, and the equipment temperature is the temperature of the terminal equipment;
acquiring the temperature of the crystal and the temperature inside the oscillator at each equipment temperature;
and aiming at the temperatures of the devices, acquiring a temperature drift curve of the crystal oscillator according to the temperatures of the crystal, the temperatures in the oscillator and the frequency offsets of the crystal oscillator.
In a possible implementation, a first temperature sensor is arranged in the crystal, and a second temperature sensor is arranged in the oscillator; the acquiring the temperature of the crystal and the temperature inside the oscillator at each device temperature includes:
under the temperature of each device, acquiring a voltage value of the first temperature sensor and a voltage value of the second temperature sensor by adopting a voltage division circuit;
acquiring the resistance value of the first temperature sensor according to the voltage value of the first temperature sensor, and acquiring the resistance value of the second temperature sensor according to the voltage value of the second temperature sensor;
and acquiring the temperature of the crystal according to the resistance value of the first temperature sensor and the first mapping relation, and acquiring the temperature inside the oscillator according to the resistance value of the second temperature sensor and the second mapping relation.
In one possible implementation, when the plurality of device temperatures include a first device temperature, a second device temperature, and a third device temperature that satisfy a first preset condition, the temperature drift curve is a first-order temperature drift curve;
the first device temperature is the temperature of the terminal device before the radio frequency parameter calibration, and the second device temperature and the third device temperature are the temperatures of the terminal device during the radio frequency parameter calibration.
In one possible implementation, if the plurality of device temperatures of the terminal device include a fourth device temperature, a fifth device temperature, a sixth device temperature, and a seventh device temperature that satisfy a second preset condition, the temperature drift curve is a third-order temperature drift curve;
the fourth device temperature is the temperature of the terminal device before the radio frequency parameter calibration, the fifth device temperature and the sixth device temperature are the temperatures of the terminal device during the radio frequency parameter calibration, and the seventh device temperature is the temperature of the terminal device after the radio frequency parameter calibration.
In a possible implementation, when the plurality of temperatures of the terminal device include an eighth device temperature, a ninth device temperature, a tenth device temperature, an eleventh device temperature, a twelfth device temperature, and a thirteenth device temperature that satisfy a third preset condition, the temperature drift curve is a fifth-order temperature drift curve;
the eighth device temperature and the ninth device temperature are temperatures of the terminal device before radio frequency parameter calibration, the tenth device temperature and the eleventh device temperature are temperatures of the terminal device during radio frequency parameter calibration, and the twelfth device temperature and the thirteenth device temperature are temperatures of the terminal device after radio frequency parameter calibration.
In one possible implementation, when the temperature range is a first temperature range, the temperature drift curve corresponding to the temperature range is a first-order temperature drift curve, and when the temperature range is a second temperature range, the temperature drift curve corresponding to the temperature range is a third-order temperature drift curve; and when the temperature range is a third temperature range, the temperature drift curve corresponding to the temperature range is a fifth-order temperature drift curve.
In a second aspect, an embodiment of the present application provides an apparatus for calibrating a clock frequency of a crystal oscillator, where the apparatus includes:
the acquisition module is used for acquiring the current environment temperature, the temperature of the crystal and the temperature inside the oscillator when a global positioning system is started;
the obtaining module is further configured to obtain a frequency offset of the crystal oscillator according to the current temperature of the crystal, the temperature inside the oscillator, and a temperature drift curve corresponding to a temperature range in which the environment temperature is located, where the temperature drift curve indicates a relationship among the frequency offset of the crystal oscillator, the temperature of the crystal, and the temperature inside the oscillator within the temperature range;
and the calibration module is used for calibrating the clock frequency of the crystal oscillator according to the frequency offset of the crystal oscillator.
In one possible implementation, the apparatus further comprises:
the calibration module is further configured to adjust a load capacitance in the crystal oscillator circuit at a reference temperature, and calibrate the clock frequency of the crystal oscillator;
the transmitting module is used for respectively transmitting signals to electronic equipment at a plurality of equipment temperatures at fixed frequency, the electronic equipment is used for determining the frequency deviation of the crystal oscillator at each equipment temperature according to the received signals and transmitting the frequency deviation to terminal equipment, and the equipment temperature is the temperature of the terminal equipment;
the acquisition module is further used for acquiring the temperature of the crystal and the temperature inside the oscillator at the temperature of each device;
the obtaining module is further configured to obtain, for the multiple device temperatures, a temperature drift curve of the crystal oscillator according to multiple temperatures of the crystal, multiple temperatures inside the oscillator, and multiple frequency offsets of the crystal oscillator.
In one possible implementation, the obtaining module is specifically configured to:
under the temperature of each device, acquiring a voltage value of the first temperature sensor and a voltage value of the second temperature sensor by adopting a voltage division circuit;
acquiring the resistance value of the first temperature sensor according to the voltage value of the first temperature sensor, and acquiring the resistance value of the second temperature sensor according to the voltage value of the second temperature sensor;
and acquiring the temperature of the crystal according to the resistance value of the first temperature sensor and the first mapping relation, and acquiring the temperature inside the oscillator according to the resistance value of the second temperature sensor and the second mapping relation.
In one possible implementation, when the plurality of device temperatures include a first device temperature, a second device temperature, and a third device temperature that satisfy a first preset condition, the temperature drift curve is a first-order temperature drift curve;
the first device temperature is the temperature of the terminal device before the radio frequency parameter calibration, and the second device temperature and the third device temperature are the temperatures of the terminal device during the radio frequency parameter calibration.
In one possible implementation, if the plurality of device temperatures of the terminal device include a fourth device temperature, a fifth device temperature, a sixth device temperature, and a seventh device temperature that satisfy a second preset condition, the temperature drift curve is a third-order temperature drift curve;
the fourth device temperature is the temperature of the terminal device before the radio frequency parameter calibration, the fifth device temperature and the sixth device temperature are the temperatures of the terminal device during the radio frequency parameter calibration, and the seventh device temperature is the temperature of the terminal device after the radio frequency parameter calibration.
In a possible implementation, when the plurality of temperatures of the terminal device include an eighth device temperature, a ninth device temperature, a tenth device temperature, an eleventh device temperature, a twelfth device temperature, and a thirteenth device temperature that satisfy a third preset condition, the temperature drift curve is a fifth-order temperature drift curve;
the eighth device temperature and the ninth device temperature are temperatures of the terminal device before radio frequency parameter calibration, the tenth device temperature and the eleventh device temperature are temperatures of the terminal device during radio frequency parameter calibration, and the twelfth device temperature and the thirteenth device temperature are temperatures of the terminal device after radio frequency parameter calibration.
In one possible implementation, when the temperature range is a first temperature range, the temperature drift curve corresponding to the temperature range is a first-order temperature drift curve, and when the temperature range is a second temperature range, the temperature drift curve corresponding to the temperature range is a third-order temperature drift curve; and when the temperature range is a third temperature range, the temperature drift curve corresponding to the temperature range is a fifth-order temperature drift curve.
In a third aspect, an embodiment of the present application provides a terminal device, including: the device comprises a memory, a processor, a transmitter and a receiver, wherein executable instructions of the processor are stored in the memory; wherein the processor is configured to perform the method of the first aspect via execution of the executable instructions.
In a sixth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method of the first aspect.
The method, the device, the equipment and the storage medium for calibrating the clock frequency of the crystal oscillator provided by the embodiment of the application comprise the following steps: when a global positioning system is started, acquiring the current environment temperature, the temperature of a crystal and the temperature inside an oscillator, and acquiring the frequency deviation of the crystal oscillator according to the temperature of the crystal, the temperature inside the oscillator and a temperature drift curve corresponding to the temperature range in which the environment temperature is located, wherein the temperature drift curve represents the relationship among the frequency deviation of the crystal oscillator, the temperature of the crystal and the temperature inside the oscillator in the temperature range, and the clock frequency of the crystal oscillator is calibrated according to the frequency deviation of the crystal oscillator. The frequency deviation of the crystal oscillator is determined by adopting the temperature drift curve corresponding to the temperature range of the environment temperature, the temperature drift compensation under different environment temperatures is realized, and the precision of the clock frequency of the crystal oscillator is improved by carrying out the temperature drift compensation on the oscillator and the crystal of the crystal oscillator circuit.
Drawings
Fig. 1 is a first flowchart illustrating a method for calibrating a clock frequency of a crystal oscillator according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating temperature drift characteristics of a typical crystal oscillator according to an embodiment of the present disclosure;
fig. 3 is a second flowchart illustrating a method for calibrating a clock frequency of a crystal oscillator according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a crystal oscillator circuit according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a temperature measurement circuit according to an embodiment of the present disclosure;
fig. 6 is a third schematic flowchart of a method for calibrating a clock frequency of a crystal oscillator according to an embodiment of the present application;
fig. 7 is a fourth flowchart illustrating a method for calibrating a clock frequency of a crystal oscillator according to an embodiment of the present application;
fig. 8 is a fifth flowchart illustrating a method for calibrating a clock frequency of a crystal oscillator according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a calibration apparatus for clock frequency of a crystal oscillator according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The accurate positioning function of GPS has very big relation with the clock frequency of crystal oscillator, adopts DCXO and temperature compensation circuit as the scheme of terminal equipment's clock source at present, and its problem that exists lies in: the compensation mode can only solve the static temperature drift change of the crystal, so that the temperature drift compensation under the normal temperature can only be realized, the dynamic temperature drift is not solved, the internal temperature of the oscillator is not compensated, the change of the internal temperature of the oscillator can influence the change of the internal capacitance value of the oscillator, and further the precision of the clock frequency of the crystal oscillator is influenced, and the functions of the GPS accurate positioning and the starting search network of the terminal equipment are influenced.
To solve the problem, an embodiment of the present application provides a method for calibrating a clock frequency of a crystal oscillator, including: when a global positioning system is started, acquiring the current environment temperature, the temperature of a crystal and the temperature inside an oscillator, and acquiring the frequency deviation of the crystal oscillator according to the temperature of the crystal, the temperature inside the oscillator and a temperature drift curve corresponding to the temperature range in which the environment temperature is located, wherein the temperature drift curve represents the relationship among the frequency deviation of the crystal oscillator, the temperature of the crystal and the temperature inside the oscillator in the temperature range, and the clock frequency of the crystal oscillator is calibrated according to the frequency deviation of the crystal oscillator. The frequency deviation of the crystal oscillator is determined by adopting the temperature drift curve corresponding to the temperature range of the environment temperature, the temperature drift compensation under different environment temperatures is realized, and the precision of the clock frequency of the crystal oscillator is improved by carrying out the temperature drift compensation on the oscillator and the crystal of the crystal oscillator circuit.
The technical solution of the present application will be described in detail by specific examples. It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a first schematic flowchart of a method for calibrating a clock frequency of a crystal oscillator according to an embodiment of the present disclosure, where an execution main body of the embodiment may be a terminal device, such as a smart phone, a tablet, an intelligent wearable device, and the like, which is not limited in this embodiment. The terminal device comprises a crystal oscillation circuit consisting of a crystal and an oscillator, and as shown in fig. 1, the method comprises the following steps:
s101, when the global positioning system is started, the current environment temperature, the temperature of the crystal and the temperature inside the oscillator are obtained.
When the terminal device is just delivered from the factory, in order to enable the GPS to implement an accurate positioning function and enable the communication module to quickly search for a network function, the clock frequency of the crystal oscillator needs to be calibrated. Therefore, the technical scheme is suitable for a calibration scene of a production line, and when the terminal equipment is started up for the first time to start the GPS, the terminal can acquire the current environment temperature, the temperature of the crystal and the temperature inside the oscillator.
The crystal oscillation circuit consists of a crystal and an oscillator. The Crystal Oscillator may be a Temperature Sensor Crystal Oscillator (TSXO), where the TSXO is a DCXO in which a Temperature Sensor is integrated, and may also be referred to as a TSXO Crystal Oscillator.
S102, obtaining the frequency deviation of the crystal oscillator according to the temperature of the crystal, the temperature inside the oscillator and a temperature drift curve corresponding to the temperature range of the environment temperature.
Wherein, the temperature drift curve represents the relationship among the frequency deviation of the crystal oscillator, the temperature of the crystal and the temperature inside the oscillator in the temperature range. The frequency deviation of the crystal oscillator represents the deviation value of the frequency of the crystal oscillator from the reference frequency.
As an example, fig. 2 is a schematic diagram of temperature drift characteristics of a typical crystal oscillator provided in an embodiment of the present application, as shown in fig. 2, an abscissa represents an ambient temperature, an ordinate represents frequency deviation of the crystal oscillator, and each curve represents temperature drift characteristics of one crystal oscillator. At 25 ℃, the frequency deviation of each crystal oscillator is approximately 0, that is, the temperature corresponding to the reference frequency of the crystal oscillator is 25 ℃.
Optionally, the reference frequency of the crystal oscillator is 26 MHz.
As can be seen from FIG. 2, in the first temperature range (0-60 ℃), the temperature drift is linearly distributed and can be represented by a first-order temperature drift curve, in the second temperature range (-20-0 ℃, 60-80 ℃), the temperature drift is non-linearly distributed at the corner and can be represented by a third-order temperature drift curve, and in the third temperature range (-25 ℃, >80 ℃), the temperature drift can be represented by a fifth-order temperature drift curve. Wherein the third temperature range is an extreme temperature range, and the first temperature range and the second temperature range may be normal temperature ranges.
The first-order temperature drift curve, the third-order temperature drift curve, and the fifth-order temperature drift curve of the crystal oscillator can be obtained by least square curve fitting, and are specifically described in detail in the following embodiments and are not described herein again.
The crystal oscillator circuit is composed of a crystal and an oscillator to form an LC oscillation circuit, and the capacitance value of the capacitor array can be changed due to the change of the internal temperature of the oscillator, so that the clock frequency of the crystal oscillator is changed, and the crystal can also change the clock frequency of the crystal oscillator along with the change of the temperature. Since the crystal is outside and the oscillator is inside, and the temperature inside the crystal and the oscillator is different, the frequency offset generated by the crystal and the oscillator due to the temperature needs to be compensated.
Based on the temperature, the current environment temperature is obtained, the temperature range of the environment temperature is determined, the temperature drift curve corresponding to the temperature range is determined, and then the frequency offset of the crystal oscillator can be obtained according to the current temperature of the crystal, the temperature inside the oscillator and the temperature drift curve.
When the temperature range of the current environment temperature is a first temperature range, the temperature drift curve is a first-order temperature drift curve, when the temperature range of the current environment temperature is a second temperature range, the temperature drift curve is a third-order temperature drift curve, and when the temperature range of the current environment temperature is a third temperature range, the temperature drift curve is a fifth-order temperature drift curve.
S103, calibrating the clock frequency of the crystal oscillator according to the frequency deviation of the crystal oscillator.
Wherein, the frequency deviation of the crystal oscillator represents the deviation value of the frequency of the crystal oscillator and the reference frequency. After obtaining the frequency offset of the crystal oscillator, the clock frequency of the crystal oscillator may be calibrated according to the frequency offset, that is, the clock frequency of the crystal oscillator at the current temperature is obtained according to the sum of the frequency offset and the reference frequency, for example, the frequency offset is 2MHz, the reference frequency is 26MHz, and then the clock frequency of the crystal oscillator at the current environment temperature is 26MHz +2MHz — 28 MHz.
The terminal equipment is also provided with a global navigation satellite system GPS module, and the method also comprises the following steps:
and carrying out GPS positioning according to the clock frequency of the crystal oscillator.
The GPS is positioned according to the clock frequency of the crystal oscillator under the current environment temperature, so that the change of the clock frequency caused by the temperature change is reduced, the rapid and accurate positioning of the GPS is realized, and the capability of the terminal equipment for searching the network when the terminal equipment is started is improved.
The embodiment provides a method for calibrating a clock frequency of a crystal oscillator, which comprises the following steps: when a global positioning system is started, acquiring the current environment temperature, the temperature of a crystal and the temperature inside an oscillator, and acquiring the frequency deviation of the crystal oscillator according to the temperature of the crystal, the temperature inside the oscillator and a temperature drift curve corresponding to the temperature range in which the environment temperature is located, wherein the temperature drift curve represents the relationship among the frequency deviation of the crystal oscillator, the temperature of the crystal and the temperature inside the oscillator in the temperature range, and the clock frequency of the crystal oscillator is calibrated according to the frequency deviation of the crystal oscillator. The frequency deviation of the crystal oscillator is determined by adopting the temperature drift curve corresponding to the temperature range where the environment temperature is located, the temperature drift compensation under different environment temperatures is realized, the temperature drift compensation is carried out on the oscillator and the crystal of the crystal oscillator circuit, the precision of the clock frequency of the crystal oscillator is improved, the effect equivalent to the TCXO is achieved, and the cost is saved.
On the basis of the foregoing embodiment, fig. 3 is a second flowchart illustrating a method for calibrating a clock frequency of a crystal oscillator according to an embodiment of the present application, and as shown in fig. 3, the method further includes the following steps:
s201, adjusting a load capacitor in the crystal oscillator circuit under the reference temperature, and calibrating the clock frequency of the crystal oscillator.
And adjusting a load capacitor in the crystal oscillator circuit under the reference temperature, calibrating the clock frequency of the crystal oscillator, and calibrating the clock frequency of the crystal oscillator to a specific value. For example: the reference temperature is 25 ℃ and the clock frequency is 26 MHz.
Fig. 4 is a schematic diagram of a crystal oscillator circuit according to an embodiment of the present disclosure, and as shown in fig. 4, the crystal oscillator circuit is composed of a crystal and an oscillator, and a principle of clock calibration is to change a load capacitance in a crystal oscillator resonant circuit to enable a system clock to output an accurate clock frequency.
In calibration, the output of the clock is adjusted by setting each array bit switch of the capacitor arrays (b1, b2 … bn), that is, the frequency output of the clock is adjusted by setting the on/off of each capacitor switch in fig. 4, each time the capacitor switch is set, the terminal sends a signal to the analysis meter at a fixed frequency, the analysis meter receives and analyzes the signal sent by the terminal at the fixed frequency to obtain the clock frequency of the crystal oscillator of the terminal, the analysis meter sends the clock frequency to the calibration computer, and the calibration computer calculates NV values (capacitor array values) related to the clock frequency according to the clock frequency, for example: 100010, where 1 indicates that the switch of the capacitor is closed, and 0 indicates that the switch of the capacitor is opened, and then the NV value with the minimum frequency error (e.g., the frequency smaller than the 26MHz error) is sent to the terminal and stored in a Non-Volatile Random Access Memory (NVRAM) of the terminal.
The analysis instrument can be an electronic device which is used for establishing communication with the terminal and performing signal analysis on a production line, and the calibration computer can be a computer for performing clock calibration.
Optionally, the fixed frequency is 902.4MHz, which is not limited in this embodiment as long as the fixed frequency is used.
S202, respectively sending signals to the electronic equipment at a fixed frequency at a plurality of equipment temperatures, wherein the electronic equipment is used for determining the frequency deviation of the crystal oscillator at each equipment temperature according to the received signals and sending the frequency deviation to the terminal equipment.
In order to expand the range of the temperature drift curve, the temperature drift curve is obtained by adopting parameters of a plurality of equipment temperatures. The device temperature is the temperature of the terminal device, and when the terminal device leaves a factory, the radio frequency parameters need to be calibrated. In this embodiment, in the process of calibrating the radio frequency parameters, the frequency offset of the crystal oscillator is calibrated synchronously.
Wherein the electronic device may be an analytical instrument. On the basis of clock calibration completion, respectively sending a signal to the electronic device at a fixed frequency at each device temperature, and determining, by the electronic device, the frequency offset of the crystal oscillator at the device temperature according to the received signal, for example: the frequency sent by the terminal is 02.4MHz, and the electronic equipment determines that the received frequency is 902MHz after receiving the signal, so that the frequency offset corresponding to the temperature of the equipment is determined to be 2 MHz.
It should be noted that the terminal device and the electronic device agree in advance on a fixed frequency of the transmission signal, for example, 902.4 MHz.
And then the electronic equipment sends the frequency offset value at each equipment temperature to the terminal equipment, and correspondingly, the terminal equipment receives the frequency offset value at each equipment temperature.
S203, acquiring the temperature of the crystal and the temperature inside the oscillator at the temperature of each device.
The temperature control device comprises a crystal, a voltage division circuit, a first temperature sensor, a second temperature sensor, a third temperature sensor, a fourth temperature.
The first temperature sensor may be a thermistor or a thermal diode, and the second temperature sensor may also be a thermistor or a thermal diode, which is not limited in this embodiment.
In a possible implementation, step S203 specifically includes:
and acquiring the voltage value of the first temperature sensor and the voltage value of the second temperature sensor by adopting a voltage dividing circuit at each equipment temperature.
And acquiring the resistance value of the first temperature sensor according to the voltage value of the first temperature sensor, and acquiring the resistance value of the second temperature sensor according to the voltage value of the second temperature sensor.
And acquiring the temperature of the crystal according to the resistance value of the first temperature sensor and the first mapping relation, and acquiring the temperature inside the oscillator according to the resistance value of the second temperature sensor and the second mapping relation.
At the temperature of each device, a voltage divider circuit is adopted to obtain a voltage value of a first temperature sensor and a voltage value of a second temperature sensor, then a resistance value of the first temperature sensor and a resistance value of the second temperature sensor are obtained, the temperature of the first temperature sensor is obtained according to the resistance value of the first temperature sensor and a first mapping relation between the resistance and the temperature, and the temperature of the second temperature sensor is obtained according to the resistance value of the second temperature sensor and a second mapping relation between the resistance and the temperature. The temperature of the crystal is the temperature of the first temperature sensor, and the temperature inside the oscillator is the temperature of the second temperature sensor.
The first mapping relationship may be a mapping table of the temperature and the resistance of the first temperature sensor, and the second mapping relationship may be a mapping table of the temperature and the resistance of the second temperature sensor.
Illustratively, fig. 5 is a schematic diagram of a temperature measurement circuit provided in an embodiment of the present application, and as shown in fig. 5, the acquisition of the crystal TSX temperature is mainly realized by a TSEN-ADC, which is a 16-bit modulator. Thermistor R inside crystal TSXtAnd a resistance RsIn series, RsHas a known resistance value of vrefIs a reference voltage, from which it can be seen that the thermistor R is obtained by a voltage dividing circuittThe voltage value v of (d) is:
Figure BDA0002296700530000111
wherein v and Rs、vrefKnowing, R can then be calculatedtAnd obtaining the temperature of the thermistor according to the mapping relation between the thermistor and the temperature, wherein the temperature of the crystal is the temperature of the thermistor.
For the oscillator, a fixed resistor (in the figure) and a thermal diode THM which are connected in series are packaged in the oscillator, and the temperature of the thermal diode can be obtained by adopting a voltage division circuit in the same way as the thermal resistor, wherein the temperature of the thermal diode is the temperature in the oscillator.
The SD-ADC is an analog-to-digital converter for converting the acquired analog voltage signal into a digital voltage signal, the MUX selector is configured to select a voltage value of the acquisition crystal or a voltage value of the oscillator, and send the acquired digital voltage signal T _ DIG to a Global Navigation Satellite System (GNSS) of the terminal device, and the GNSS is configured to acquire a temperature of the crystal and a temperature inside the oscillator according to the received digital voltage signal.
By adopting the mode, a plurality of temperatures of the crystal and a plurality of temperatures of the oscillator at a plurality of device temperatures can be obtained.
And S204, aiming at the temperatures of the devices, obtaining a temperature drift curve of the crystal oscillator according to the temperatures of the crystal, the temperatures of the oscillator and the frequency offsets of the crystal oscillator.
Through steps S201 to S202, multiple sets of parameters (TEM _ TSX0, TEM _ OSC0, FE0), (TEM _ TSX1, TEM _ OSC1, FE1) … (TEM _ TSXn, TEM _ OSCn, FEn) can be obtained.
Wherein TEM _ TSX0, TEM _ TSX1 … TEM _ TSXn represent multiple temperatures of the crystal at multiple device temperatures;
TEM _ OSC0, TEM _ OSC1 … TEM _ OSCn represent multiple temperatures of the oscillator at multiple device temperatures;
FE0 and FE1 … FE n indicate frequency offsets of crystal oscillators at a plurality of device temperatures.
In this embodiment, a least square fitting is performed according to the above multiple sets of parameters, so as to obtain a temperature drift curve of the crystal oscillator. In order to reduce the calculation complexity and achieve the purpose of temperature drift compensation, the temperature drift curve of the crystal oscillator comprises a third-order temperature drift curve and a fifth-order temperature drift curve, the third-order temperature drift curve is suitable for temperature drift compensation in a conventional temperature range, and the fifth-order temperature drift curve is suitable for temperature drift compensation in an extreme temperature range.
And when n is 3, curve fitting to obtain a first-order temperature drift curve, when n is 4, curve fitting to obtain a third-order temperature drift curve, and when n is 6, curve fitting to obtain a fifth-order temperature drift curve.
It should be noted that, in the actual use process of the user, the terminal device may update the temperature drift curve according to the multiple temperatures of the crystal and the multiple temperatures of the oscillator in the actual process, so as to obtain the temperature drift curve by re-fitting, and the specific manner is similar to that of the technical scheme, and is not described herein again.
The method for calibrating the clock frequency of the crystal oscillator provided by the embodiment comprises the following steps: adjusting a load capacitor in a crystal oscillator circuit under a reference temperature, calibrating a clock frequency of a crystal oscillator, sending signals to an electronic device at a fixed frequency under a plurality of device temperatures, wherein the electronic device is used for determining a frequency deviation of the crystal oscillator at each device temperature according to the received signals and sending the frequency deviation to a terminal device, acquiring the temperature of a crystal and the temperature inside an oscillator at each device temperature, and acquiring a temperature drift curve of the crystal oscillator according to a plurality of temperatures of the crystal, a plurality of temperatures inside the oscillator and a plurality of frequency deviations of the crystal oscillator for the plurality of device temperatures. The temperature drift curve is obtained by considering different equipment temperatures, so that the coverage range of the temperature drift curve is large, and the precision of temperature drift compensation is improved.
On the basis of the above embodiments, the temperature drift curve of the crystal oscillator includes a first-order temperature drift curve, a third-order temperature drift curve and a fifth-order temperature drift curve. When the plurality of equipment temperatures include a first equipment temperature, a second equipment temperature and a third equipment temperature which satisfy a first preset condition, the temperature drift curve is a first-order temperature drift curve. Fig. 6 is a third schematic flowchart of a method for calibrating a clock frequency of a crystal oscillator according to an embodiment of the present application, where as shown in fig. 6, the method includes:
s301, adjusting a load capacitor in the crystal oscillator circuit under the reference temperature, and calibrating the clock frequency of the crystal oscillator.
Step S301 is similar to step S201, and is not described herein again.
S302, respectively sending signals to the electronic equipment at a fixed frequency at a first equipment temperature, a second equipment temperature and a third equipment temperature, wherein the electronic equipment is used for determining the frequency deviation of the crystal oscillator at each equipment temperature according to the received signals and sending the frequency deviation to the terminal equipment.
In order to cover a larger temperature range by the first-order temperature drift curve, the first device temperature, the second device temperature and the third device temperature satisfy a first preset condition, the first preset condition may be that a difference between the second device temperature and the first device temperature is greater than a first preset value, and a difference between the third device temperature and the second device temperature is greater than a second preset value. The first preset value may be 1 ℃, the second preset value may be 0.5 ℃, and the present embodiment does not limit this.
And the temperature of the terminal equipment is continuously increased when the radio frequency parameters are calibrated. The first device temperature is the temperature of the terminal device before the radio frequency parameter calibration, namely before the temperature rise, and the second device temperature and the third device temperature are the temperatures of the terminal device during the radio frequency parameter calibration, namely in the temperature rise process. Therefore, the frequency offset of the crystal oscillator can be obtained in parallel with the radio frequency parameter calibration, and the calibration time of a production line is saved.
In this embodiment, before the radio frequency parameter calibration, the terminal device is not heated, and when the temperature of the terminal device is any temperature (first device temperature), the frequency offset of the crystal oscillation is obtained, and when the radio frequency parameter calibration is performed (device temperature is raised), the frequency offset of the crystal oscillation is obtained at the second device temperature and the third device temperature, respectively. Three frequency offsets of the crystal oscillator at the first device temperature, the second device temperature and the third device temperature are obtained in a similar manner to step S202, and are not described herein again.
Of course, the parameters may be determined in parallel in other parameter calibration processes, including but not limited to parallel with rf parameter calibration in practical applications.
And S303, acquiring the temperature of the crystal and the temperature inside the oscillator under the first equipment temperature, the second equipment temperature and the third equipment temperature respectively.
Three temperatures of the crystal at the first device temperature, the second device temperature, and the third device temperature, and the temperatures inside the three oscillators at the first device temperature, the second device temperature, and the third device temperature are obtained by step S303. The detailed manner is similar to step S203, and is not described herein again.
S304, acquiring a first-order temperature drift curve of the crystal oscillator according to the three temperatures of the crystal, the three temperatures in the oscillator and the three frequency offsets of the crystal oscillator.
Wherein, the first order polynomial of the crystal oscillator is as follows:
Figure BDA0002296700530000131
ttdenotes the temperature, t, of the crystal0Is a reference temperature, c1t、c0tCoefficient, t, corresponding to the temperature drift curve of the crystalosWhich is indicative of the temperature inside the oscillator,
Figure BDA0002296700530000132
representing the coefficient, F (t), of the oscillator temperature-frequency curvet,t0) Indicating the frequency offset of the crystal oscillator.
Three sets of parameters (TEM _ TSX1, TEM _ OSC1, FE1), (TEM _ TSX2, TEM _ OSC2, FE2), (TEM _ TSX3, TEM _ OSC3, FE3) can be obtained through steps S302 to S303.
And substituting the three groups of parameters into the first-order polynomial, and fitting to obtain each coefficient of a first-order temperature drift curve of the crystal oscillator, thereby obtaining the first-order temperature drift curve.
The method for calibrating the clock frequency of the crystal oscillator provided by the embodiment comprises the following steps: adjusting a load capacitor in a crystal oscillator circuit under a reference temperature, calibrating the clock frequency of the crystal oscillator, sending signals to the electronic equipment at a fixed frequency under a first equipment temperature, a second equipment temperature and a third equipment temperature respectively, determining the frequency deviation of the crystal oscillator at each equipment temperature by the electronic equipment according to the received signals, sending the frequency deviation to the terminal equipment, obtaining the temperature of the crystal and the temperature inside the oscillator at the first equipment temperature, the second equipment temperature and the third equipment temperature respectively, and obtaining a first-order temperature drift curve of the crystal oscillator according to the three temperatures of the crystal, the three temperatures inside the oscillator and the three frequency deviations of the crystal oscillator. Therefore, temperature drift calibration can be parallel to radio frequency parameter calibration, and the time for production line calibration is saved; and only three groups of parameters are needed to obtain a first-order temperature drift curve, so that the calibration workload is simplified, and the calibration of the clock frequencies in different environments is realized.
If the plurality of device temperatures of the terminal device include a fourth device temperature, a fifth device temperature, a sixth device temperature, and a seventh device temperature that satisfy a second preset condition, the temperature drift curve is a third-order temperature drift curve, and fig. 7 is a fourth flowchart of the method for calibrating the clock frequency of the crystal oscillator provided in the embodiment of the present application, as shown in fig. 7, the method includes:
s401, adjusting a load capacitor in the crystal oscillator circuit under the reference temperature, and calibrating the clock frequency of the crystal oscillator.
Step S304 is similar to step S201, and is not described herein again.
S402, respectively sending signals to the electronic equipment at a fixed frequency at a fourth equipment temperature, a fifth equipment temperature, a sixth equipment temperature and a seventh equipment temperature, wherein the electronic equipment is used for determining the frequency deviation of the crystal oscillator at each equipment temperature according to the received signals and sending the frequency deviation to the terminal equipment.
In order to cover a larger temperature range by the third-order temperature drift curve, the fourth device temperature, the fifth device temperature, the sixth device temperature and the seventh device temperature satisfy a second preset condition, where the second preset condition may be that a difference between the fifth device temperature and the fourth device temperature is greater than a third preset value, a difference between the sixth device temperature and the fifth device temperature is greater than a fourth preset value, and a difference between the seventh device temperature and the sixth device temperature is greater than a fifth preset value. The first preset value may be 1 ℃, the second preset value may be 0.5 ℃, and the third preset value, the fourth preset value, and the fifth preset value are not limited in this embodiment.
And the temperature of the terminal equipment is continuously increased when the radio frequency parameters are calibrated. The fourth device temperature is the temperature of the terminal device before the radio frequency parameter calibration, the fifth device temperature and the sixth device temperature are the temperatures of the terminal device during the radio frequency parameter calibration, and the seventh device temperature is the temperature of the terminal device after the radio frequency parameter calibration.
Specifically, the temperature of the terminal device is not raised before the radio frequency parameter calibration, the frequency of the crystal oscillator is obtained when the temperature of the terminal device is any temperature (fourth device temperature), the frequency of the crystal oscillator is obtained when the temperature of the terminal device reaches the fifth device temperature in the radio frequency calibration process, similarly, the frequency of the crystal oscillator is obtained when the temperature of the terminal device reaches the sixth device temperature, then, after the radio frequency calibration, the temperature of the terminal device is lowered, and the frequency of the crystal oscillator is obtained when the temperature reaches the seventh device temperature.
And S403, acquiring the temperature of the crystal and the temperature inside the oscillator at the fourth equipment temperature, the fifth equipment temperature, the sixth equipment temperature and the seventh equipment temperature respectively.
In this embodiment, before the radio frequency parameter calibration, the temperature of the crystal and the temperature inside the oscillator are obtained when the temperature of the terminal device is any temperature (fourth device temperature), when the temperature of the terminal device reaches the fifth device temperature in the radio frequency calibration process, the temperature of the crystal and the temperature inside the oscillator are obtained, similarly, when the temperature of the terminal device reaches the sixth device temperature, the temperature of the crystal and the temperature inside the oscillator are obtained, then, after the radio frequency calibration, the temperature of the terminal device is reduced, and when the temperature reaches the seventh device temperature, the temperature of the crystal and the temperature inside the oscillator are obtained.
S404, obtaining a third-order temperature drift curve of the crystal oscillator according to the four temperatures of the crystal, the four temperatures of the oscillator and the four frequency offsets of the crystal oscillator.
Wherein, the cubic polynomial of the crystal is:
Ft=c3t*(tt-t0)3+c2t*(tt-t0)2+c1t*(tt-t0)+c0t
the cubic polynomial of the oscillator is:
Figure BDA0002296700530000151
wherein, FtRepresenting the frequency deviation of the crystal due to temperature, ttDenotes the temperature, t, of the crystal0Is a reference temperature, c3t、c2t、c1t、c0tAnd the coefficient of the temperature drift curve corresponding to the crystal is shown.
FosRepresenting the frequency deviation of the oscillator due to temperature, tosWhich is indicative of the temperature inside the oscillator,
Figure BDA0002296700530000152
Figure BDA0002296700530000153
representing the coefficients corresponding to the oscillator temperature-frequency curve.
Considering the time cost simplification calibration process of production line calibration, the cubic polynomial of the crystal oscillator is:
Figure BDA0002296700530000154
wherein, F (t)t,t0) Indicating the frequency offset of the crystal oscillator.
Four sets of parameters (TEM _ TSX1, TEM _ OSC1, FE1), (TEM _ TSX2, TEM _ OSC2, FE2), (TEM _ TSX3, TEM _ OSC3, FE3), (TEM _ TSX4, TEM _ OSC4, FE4) can be obtained through steps S402 to S403.
And substituting the four groups of parameters into the cubic polynomial of the crystal oscillator, and fitting to obtain each coefficient of a third-order temperature drift curve of the crystal oscillator, thereby obtaining the third-order temperature drift curve.
The method for calibrating the clock frequency of the crystal oscillator provided by the embodiment comprises the following steps: adjusting a load capacitor in a crystal oscillator circuit under a reference temperature, calibrating a clock frequency of the crystal oscillator, sending signals to an electronic device at a fixed frequency under a fourth device temperature, a fifth device temperature, a sixth device temperature and a seventh device temperature respectively, determining frequency deviation of the crystal oscillator at each device temperature according to the received signals by the electronic device, sending the frequency deviation to a terminal device, obtaining a temperature of the crystal and a temperature inside the oscillator under the first device temperature, the second device temperature, the third device temperature and the fourth device temperature respectively, and obtaining a third-order temperature drift curve of the crystal oscillator according to the four temperatures of the crystal, the four temperatures of the oscillator and the four frequency deviations of the crystal oscillator. Therefore, temperature drift calibration can be completed in parallel with radio frequency parameter calibration, the time for production line calibration is saved, and the calibration of clock frequency under different environments is realized.
And if the plurality of temperatures of the terminal equipment comprise an eighth equipment temperature, a ninth equipment temperature, a tenth equipment temperature, an eleventh equipment temperature, a twelfth equipment temperature and a thirteenth equipment temperature which meet a third preset condition, the temperature drift curve is a fifth-order temperature drift curve. Fig. 8 is a fifth flowchart illustrating a method for calibrating a clock frequency of a crystal oscillator according to an embodiment of the present application, as shown in fig. 8, the method includes:
s501, adjusting a load capacitor in the crystal oscillator circuit under the reference temperature, and calibrating the clock frequency of the crystal oscillator.
Step S501 is similar to step S201, and is not described herein again.
And S502, respectively sending signals to the electronic equipment at a fixed frequency at an eighth equipment temperature, a ninth equipment temperature, a tenth equipment temperature, an eleventh equipment temperature, a twelfth equipment temperature and a thirteenth equipment temperature, wherein the electronic equipment is used for determining the frequency deviation of the crystal oscillator at each equipment temperature according to the received signals and sending the frequency deviation to the terminal equipment.
In order to cover a larger temperature range by the fifth-order temperature drift curve, the eighth device temperature, the ninth device temperature, the tenth device temperature, the eleventh device temperature, the twelfth device temperature, and the thirteenth device temperature satisfy a first preset condition, the third preset condition may be that a difference between the ninth device temperature and the eighth device temperature is greater than a sixth preset value, the tenth device temperature and the ninth device temperature are greater than a seventh preset value, the eleventh device temperature and the tenth device temperature are greater than an eighth preset value, the twelfth device temperature and the eleventh device temperature are greater than a ninth preset value, and the thirteenth device temperature and the twelfth device temperature are greater than a tenth preset value. In this embodiment, values of the sixth preset value, the seventh preset value, the eighth preset value, the ninth preset value, and the tenth preset value are not limited, and may be selected according to a requirement.
The eighth device temperature and the ninth device temperature are temperatures of the terminal device before the radio frequency parameter calibration, the tenth device temperature and the eleventh device temperature are temperatures of the terminal device during the radio frequency parameter calibration, and the twelfth device temperature and the thirteenth device temperature are temperatures of the terminal device after the radio frequency parameter calibration.
And S503, acquiring the temperature of the crystal and the temperature inside the oscillator under the eighth device temperature, the ninth device temperature, the tenth device temperature, the eleventh device temperature, the twelfth device temperature and the thirteenth device temperature respectively.
In this embodiment, the temperature of the crystal and the temperature inside the oscillator are obtained when the temperature of the terminal device is any two temperatures (an eighth device temperature and a ninth device temperature), when the temperature of the terminal device reaches a tenth device temperature in the radio frequency calibration process, the temperature of the crystal and the temperature inside the oscillator are obtained, similarly, when the temperature of the terminal device reaches an eleventh device temperature, the temperature of the crystal and the temperature inside the oscillator are obtained, and then, after the radio frequency calibration, the temperature of the terminal device is reduced, and when the temperature reaches a twelfth device temperature and a thirteenth device temperature, the temperature of the crystal and the temperature inside the oscillator are obtained.
S504, acquiring a fifth-order temperature drift curve of the crystal oscillator according to the six temperatures of the crystal, the six temperatures of the oscillator and the six frequency offsets of the crystal oscillator.
Wherein, the fifth order polynomial of the crystal can be:
Figure BDA0002296700530000171
wherein, F (t)t,t0) Representing the frequency deviation, t, of the crystal oscillatortDenotes the temperature, t, of the crystal0For the purpose of the reference temperature, the temperature,
Figure BDA0002296700530000172
Figure BDA0002296700530000173
c3t、c2t、c1t、c0tcoefficient, t, corresponding to the temperature drift curve of the crystalosWhich is indicative of the temperature inside the oscillator,
Figure BDA0002296700530000174
representing the coefficients corresponding to the oscillator temperature-frequency curve.
Through steps S502 to S503, six sets of parameters (TEM _ TSX1, TEM _ OSC1, FE1), (TEM _ TSX2, TEM _ OSC2, FE2), (TEM _ TSX3, TEM _ OSC3, FE3) … (TEM _ TSX6, TEM _ OSC6, FE6) can be obtained, and these six sets of parameters are substituted into a fifth-order polynomial to fit to obtain each coefficient of a fifth-order temperature drift curve of the crystal oscillator, so as to obtain the fifth-order temperature drift curve.
The method for calibrating the clock frequency of the crystal oscillator provided by the embodiment comprises the following steps: adjusting a load capacitor in a crystal oscillator circuit under a reference temperature, calibrating a clock frequency of the crystal oscillator, sending signals to an electronic device at a fixed frequency under an eighth device temperature, a ninth device temperature, a tenth device temperature, an eleventh device temperature, a twelfth device temperature and a thirteenth device temperature respectively, determining frequency deviation of the crystal oscillator at each device temperature according to the received signals and sending the frequency deviation to a terminal device by the electronic device, and acquiring a fifth-order temperature drift curve of the crystal oscillator according to six temperatures of a crystal, six temperatures of an oscillator and six frequency deviations of the crystal oscillator. Therefore, temperature drift calibration can be parallel to radio frequency parameter calibration, the time for production line calibration is saved, and temperature drift compensation in an extreme temperature range is realized.
Fig. 9 is a schematic structural diagram of a calibration apparatus for a clock frequency of a crystal oscillator according to an embodiment of the present application, and as shown in fig. 9, the calibration apparatus for a clock frequency of a crystal oscillator includes:
the acquisition module 11 is configured to acquire a current ambient temperature, a temperature of the crystal, and a temperature inside the oscillator when a global positioning system is started;
the obtaining module 11 is further configured to obtain a frequency offset of the crystal oscillator according to the current temperature of the crystal, the temperature inside the oscillator, and a temperature drift curve corresponding to a temperature range in which the environment temperature is located, where the temperature drift curve indicates a relationship among the frequency offset of the crystal oscillator, the temperature of the crystal, and the temperature inside the oscillator within the temperature range;
and the calibration module 12 is configured to calibrate the clock frequency of the crystal oscillator according to the frequency offset of the crystal oscillator.
In a possible implementation, the calibration module 12 is further configured to adjust a load capacitance in the crystal oscillator circuit at a reference temperature, so as to calibrate the clock frequency of the crystal oscillator;
a sending module 13, configured to send signals to an electronic device at a fixed frequency at multiple device temperatures, where the electronic device is configured to determine, according to the received signals, a frequency offset of the crystal oscillator at each device temperature, and send the frequency offset to a terminal device, where the device temperature is the temperature of the terminal device;
the obtaining module 11 is further configured to obtain, at each device temperature, a temperature of the crystal and a temperature inside the oscillator;
the obtaining module 11 is further configured to obtain, for the multiple device temperatures, a temperature drift curve of the crystal oscillator according to multiple temperatures of the crystal, multiple temperatures inside the oscillator, and multiple frequency offsets of the crystal oscillator.
In a possible implementation, the obtaining module 11 is specifically configured to:
under the temperature of each device, acquiring a voltage value of the first temperature sensor and a voltage value of the second temperature sensor by adopting a voltage division circuit;
acquiring the resistance value of the first temperature sensor according to the voltage value of the first temperature sensor, and acquiring the resistance value of the second temperature sensor according to the voltage value of the second temperature sensor;
and acquiring the temperature of the crystal according to the resistance value of the first temperature sensor and the first mapping relation, and acquiring the temperature inside the oscillator according to the resistance value of the second temperature sensor and the second mapping relation.
In one possible implementation, when the plurality of device temperatures include a first device temperature, a second device temperature, and a third device temperature that satisfy a first preset condition, the temperature drift curve is a first-order temperature drift curve;
the first device temperature is the temperature of the terminal device before the radio frequency parameter calibration, and the second device temperature and the third device temperature are the temperatures of the terminal device during the radio frequency parameter calibration.
In one possible implementation, if the plurality of device temperatures of the terminal device include a fourth device temperature, a fifth device temperature, a sixth device temperature, and a seventh device temperature that satisfy a second preset condition, the temperature drift curve is a third-order temperature drift curve;
the fourth device temperature is the temperature of the terminal device before the radio frequency parameter calibration, the fifth device temperature and the sixth device temperature are the temperatures of the terminal device during the radio frequency parameter calibration, and the seventh device temperature is the temperature of the terminal device after the radio frequency parameter calibration.
In a possible implementation, when the plurality of temperatures of the terminal device include an eighth device temperature, a ninth device temperature, a tenth device temperature, an eleventh device temperature, a twelfth device temperature, and a thirteenth device temperature that satisfy a third preset condition, the temperature drift curve is a fifth-order temperature drift curve;
the eighth device temperature and the ninth device temperature are temperatures of the terminal device before radio frequency parameter calibration, the tenth device temperature and the eleventh device temperature are temperatures of the terminal device during radio frequency parameter calibration, and the twelfth device temperature and the thirteenth device temperature are temperatures of the terminal device after radio frequency parameter calibration.
In one possible implementation, when the temperature range is a first temperature range, the temperature drift curve corresponding to the temperature range is a first-order temperature drift curve, and when the temperature range is a second temperature range, the temperature drift curve corresponding to the temperature range is a third-order temperature drift curve; and when the temperature range is a third temperature range, the temperature drift curve corresponding to the temperature range is a fifth-order temperature drift curve.
The apparatus provided in the embodiment of the present application may be configured to execute the method executed by the terminal device, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 10 is a schematic structural diagram of a terminal device provided in an embodiment of the present application, and as shown in fig. 10, the terminal device 20 of the present embodiment may include: memory 21, processor 22, transmitter 23, receiver 24.
A memory 21 for storing a computer program (e.g., an application program, a functional module, etc. implementing the above-described method), computer instructions, etc.;
the computer programs, computer instructions, etc. described above may be stored in one or more memories 21 in partitions. And the computer programs, computer instructions, data, etc. described above may be invoked by the processor 22.
A processor 22 for executing the computer program stored in the memory 22 to implement the steps of the above-mentioned method.
Reference may be made in particular to the description relating to the preceding method embodiment.
The processor 21 and the memory 22 may be separate structures or may be integrated structures integrated together. When the processor 21 and the memory 22 are separate structures, the memory 22 and the processor 21 may be coupled by a bus 25.
Embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements a method performed by a terminal device.
Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an ASIC. Additionally, the ASIC may reside in user equipment. Of course, the processor and the storage medium may reside as discrete components in a communication device.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The present application further provides a program product comprising a computer program stored in a readable storage medium, from which the computer program can be read by at least one processor of a server, the computer program being executable by the at least one processor to cause the server to carry out the method of any of the embodiments of the present application described above.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.

Claims (16)

1. A method for calibrating the clock frequency of a crystal oscillator is applied to a terminal device, wherein the terminal device comprises a crystal oscillator circuit composed of a crystal and an oscillator, and the method comprises the following steps:
when a global positioning system is started, acquiring the current ambient temperature, the temperature of the crystal and the temperature inside the oscillator;
acquiring the frequency deviation of the crystal oscillator according to the temperature of the crystal, the temperature inside the oscillator and a temperature drift curve corresponding to the temperature range where the environment temperature is located, wherein the temperature drift curve represents the relationship among the frequency deviation of the crystal oscillator, the temperature of the crystal and the temperature inside the oscillator in the temperature range;
and calibrating the clock frequency of the crystal oscillator according to the frequency deviation of the crystal oscillator.
2. The method of claim 1, further comprising:
adjusting a load capacitor in the crystal oscillator circuit under a reference temperature to calibrate the clock frequency of the crystal oscillator;
at a plurality of equipment temperatures, respectively sending signals to electronic equipment at a fixed frequency, wherein the electronic equipment is used for determining the frequency deviation of the crystal oscillator at each equipment temperature according to the received signals and sending the frequency deviation to terminal equipment, and the equipment temperature is the temperature of the terminal equipment;
acquiring the temperature of the crystal and the temperature inside the oscillator at each equipment temperature;
and aiming at the temperatures of the devices, acquiring a temperature drift curve of the crystal oscillator according to the temperatures of the crystal, the temperatures in the oscillator and the frequency offsets of the crystal oscillator.
3. The method of claim 2, wherein a first temperature sensor is provided in the crystal and a second temperature sensor is provided in the oscillator; the acquiring the temperature of the crystal and the temperature inside the oscillator at each device temperature includes:
under the temperature of each device, acquiring a voltage value of the first temperature sensor and a voltage value of the second temperature sensor by adopting a voltage division circuit;
acquiring the resistance value of the first temperature sensor according to the voltage value of the first temperature sensor, and acquiring the resistance value of the second temperature sensor according to the voltage value of the second temperature sensor;
and acquiring the temperature of the crystal according to the resistance value of the first temperature sensor and the first mapping relation, and acquiring the temperature inside the oscillator according to the resistance value of the second temperature sensor and the second mapping relation.
4. The method according to claim 2 or 3, wherein when the plurality of device temperatures includes a first device temperature, a second device temperature, and a third device temperature that satisfy a first preset condition, the temperature drift curve is a first-order temperature drift curve;
the first device temperature is the temperature of the terminal device before the radio frequency parameter calibration, and the second device temperature and the third device temperature are the temperatures of the terminal device during the radio frequency parameter calibration.
5. The method according to claim 2 or 3, wherein if the plurality of device temperatures of the terminal device include a fourth device temperature, a fifth device temperature, a sixth device temperature and a seventh device temperature which satisfy a second preset condition, the temperature drift curve is a third-order temperature drift curve;
the fourth device temperature is the temperature of the terminal device before the radio frequency parameter calibration, the fifth device temperature and the sixth device temperature are the temperatures of the terminal device during the radio frequency parameter calibration, and the seventh device temperature is the temperature of the terminal device after the radio frequency parameter calibration.
6. The method according to claim 2 or 3, wherein the temperature drift curve is a fifth order temperature drift curve if the plurality of temperatures of the terminal device include an eighth device temperature, a ninth device temperature, a tenth device temperature, an eleventh device temperature, a twelfth device temperature and a thirteenth device temperature which satisfy a third preset condition;
the eighth device temperature and the ninth device temperature are temperatures of the terminal device before radio frequency parameter calibration, the tenth device temperature and the eleventh device temperature are temperatures of the terminal device during radio frequency parameter calibration, and the twelfth device temperature and the thirteenth device temperature are temperatures of the terminal device after radio frequency parameter calibration.
7. The method of claim 1,
when the temperature range is a first temperature range, the temperature drift curve corresponding to the temperature range is a first-order temperature drift curve, and when the temperature range is a second temperature range, the temperature drift curve corresponding to the temperature range is a third-order temperature drift curve; and when the temperature range is a third temperature range, the temperature drift curve corresponding to the temperature range is a fifth-order temperature drift curve.
8. An apparatus for calibrating a clock frequency of a crystal oscillator, the apparatus comprising:
the acquisition module is used for acquiring the current environment temperature, the temperature of the crystal and the temperature inside the oscillator when the global positioning system is started;
the obtaining module is further configured to obtain a frequency offset of the crystal oscillator according to the current temperature of the crystal, the temperature inside the oscillator, and a temperature drift curve corresponding to a temperature range in which the environment temperature is located, where the temperature drift curve indicates a relationship among the frequency offset of the crystal oscillator, the temperature of the crystal, and the temperature inside the oscillator within the temperature range;
and the calibration module is used for calibrating the clock frequency of the crystal oscillator according to the frequency offset of the crystal oscillator.
9. The apparatus of claim 8, wherein the calibration module is further configured to:
adjusting a load capacitor in the crystal oscillator circuit under a reference temperature to calibrate the clock frequency of the crystal oscillator;
the transmitting module is used for respectively transmitting signals to electronic equipment at a plurality of equipment temperatures at fixed frequency, the electronic equipment is used for determining the frequency deviation of the crystal oscillator at each equipment temperature according to the received signals and transmitting the frequency deviation to terminal equipment, and the equipment temperature is the temperature of the terminal equipment;
the acquisition module is further used for acquiring the temperature of the crystal and the temperature inside the oscillator at the temperature of each device;
the obtaining module is further configured to obtain, for the multiple device temperatures, a temperature drift curve of the crystal oscillator according to multiple temperatures of the crystal, multiple temperatures inside the oscillator, and multiple frequency offsets of the crystal oscillator.
10. The apparatus of claim 9, wherein the obtaining module is specifically configured to:
under the temperature of each device, a voltage dividing circuit is adopted to obtain a voltage value of a first temperature sensor and a voltage value of a second temperature sensor;
acquiring the resistance value of the first temperature sensor according to the voltage value of the first temperature sensor, and acquiring the resistance value of the second temperature sensor according to the voltage value of the second temperature sensor;
and acquiring the temperature of the crystal according to the resistance value of the first temperature sensor and the first mapping relation, and acquiring the temperature inside the oscillator according to the resistance value of the second temperature sensor and the second mapping relation.
11. The apparatus of claim 9 or 10, wherein when the plurality of device temperatures includes a first device temperature, a second device temperature, and a third device temperature that satisfy a first preset condition, the temperature drift curve is a first order temperature drift curve;
the first device temperature is the temperature of the terminal device before the radio frequency parameter calibration, and the second device temperature and the third device temperature are the temperatures of the terminal device during the radio frequency parameter calibration.
12. The apparatus according to claim 9 or 10, wherein if the plurality of device temperatures of the terminal device include a fourth device temperature, a fifth device temperature, a sixth device temperature and a seventh device temperature that satisfy a second preset condition, the temperature drift curve is a third-order temperature drift curve;
the fourth device temperature is the temperature of the terminal device before the radio frequency parameter calibration, the fifth device temperature and the sixth device temperature are the temperatures of the terminal device during the radio frequency parameter calibration, and the seventh device temperature is the temperature of the terminal device after the radio frequency parameter calibration.
13. The apparatus according to claim 9 or 10, wherein the temperature drift curve is a fifth order temperature drift curve if the plurality of temperatures of the terminal device includes an eighth device temperature, a ninth device temperature, a tenth device temperature, an eleventh device temperature, a twelfth device temperature and a thirteenth device temperature that satisfy a third preset condition;
the eighth device temperature and the ninth device temperature are temperatures of the terminal device before radio frequency parameter calibration, the tenth device temperature and the eleventh device temperature are temperatures of the terminal device during radio frequency parameter calibration, and the twelfth device temperature and the thirteenth device temperature are temperatures of the terminal device after radio frequency parameter calibration.
14. The apparatus of claim 8,
when the temperature range is a first temperature range, the temperature drift curve corresponding to the temperature range is a first-order temperature drift curve, and when the temperature range is a second temperature range, the temperature drift curve corresponding to the temperature range is a third-order temperature drift curve; and when the temperature range is a third temperature range, the temperature drift curve corresponding to the temperature range is a fifth-order temperature drift curve.
15. A terminal device, comprising: the device comprises a memory, a processor, a transmitter and a receiver, wherein executable instructions of the processor are stored in the memory; wherein the processor is configured to perform the method of any of claims 1-7 via execution of the executable instructions.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
CN201911204816.5A 2019-11-29 2019-11-29 Method, device and equipment for calibrating clock frequency of crystal oscillator and storage medium Active CN110932718B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911204816.5A CN110932718B (en) 2019-11-29 2019-11-29 Method, device and equipment for calibrating clock frequency of crystal oscillator and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911204816.5A CN110932718B (en) 2019-11-29 2019-11-29 Method, device and equipment for calibrating clock frequency of crystal oscillator and storage medium

Publications (2)

Publication Number Publication Date
CN110932718A true CN110932718A (en) 2020-03-27
CN110932718B CN110932718B (en) 2023-01-24

Family

ID=69847894

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911204816.5A Active CN110932718B (en) 2019-11-29 2019-11-29 Method, device and equipment for calibrating clock frequency of crystal oscillator and storage medium

Country Status (1)

Country Link
CN (1) CN110932718B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112272008A (en) * 2020-10-21 2021-01-26 高新兴物联科技有限公司 Method and device for automatically matching calibration curve of crystal body temperature parameter
CN112327596A (en) * 2021-01-04 2021-02-05 南京芯视界微电子科技有限公司 Clock system for single photon detection chip and calibration method thereof
CN112737574A (en) * 2020-11-30 2021-04-30 珠海格力电器股份有限公司 Timing calibration method of chip internal clock source and related device
CN113114108A (en) * 2021-05-05 2021-07-13 诺领科技(南京)有限公司 Method for estimating crystal oscillator frequency
CN114500209A (en) * 2021-12-23 2022-05-13 北京智联安科技有限公司 Frequency offset compensation method, system, electronic device and computer readable storage medium
CN114689964A (en) * 2022-02-28 2022-07-01 惠州金百泽物联科技有限公司 Circuit design, test and adjustment method for starting stability of crystal oscillator
CN115314142A (en) * 2022-06-29 2022-11-08 阿波罗智能技术(北京)有限公司 Time calibration method, device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080164952A1 (en) * 2007-01-05 2008-07-10 Daniel Babitch System and Method for Providing Temperature Correction in a Crystal Oscillator
CN102025320A (en) * 2010-11-25 2011-04-20 Tcl集团股份有限公司 Device and method for improving frequency stability of WIFI (wireless fidelity) access point
CN102185561A (en) * 2011-01-26 2011-09-14 意法·爱立信半导体(北京)有限公司 Frequency deviation adjusting method and frequency deviation adjusting device used during startup of terminal
CN103684256A (en) * 2012-09-12 2014-03-26 无锡华润矽科微电子有限公司 High-accuracy digital temperature-compensated crystal oscillator circuit structure with built-in crystal oscillator
CN110289812A (en) * 2019-06-28 2019-09-27 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of crystal oscillator frequency compensation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080164952A1 (en) * 2007-01-05 2008-07-10 Daniel Babitch System and Method for Providing Temperature Correction in a Crystal Oscillator
CN102025320A (en) * 2010-11-25 2011-04-20 Tcl集团股份有限公司 Device and method for improving frequency stability of WIFI (wireless fidelity) access point
CN102185561A (en) * 2011-01-26 2011-09-14 意法·爱立信半导体(北京)有限公司 Frequency deviation adjusting method and frequency deviation adjusting device used during startup of terminal
CN103684256A (en) * 2012-09-12 2014-03-26 无锡华润矽科微电子有限公司 High-accuracy digital temperature-compensated crystal oscillator circuit structure with built-in crystal oscillator
CN110289812A (en) * 2019-06-28 2019-09-27 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of crystal oscillator frequency compensation

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112272008A (en) * 2020-10-21 2021-01-26 高新兴物联科技有限公司 Method and device for automatically matching calibration curve of crystal body temperature parameter
CN112272008B (en) * 2020-10-21 2023-10-13 高新兴物联科技股份有限公司 Method and device for automatically matching crystal temperature parameter calibration curve
CN112737574A (en) * 2020-11-30 2021-04-30 珠海格力电器股份有限公司 Timing calibration method of chip internal clock source and related device
CN112737574B (en) * 2020-11-30 2024-01-12 珠海格力电器股份有限公司 Timing calibration method and related device for clock source in chip
CN112327596A (en) * 2021-01-04 2021-02-05 南京芯视界微电子科技有限公司 Clock system for single photon detection chip and calibration method thereof
CN112327596B (en) * 2021-01-04 2021-04-13 南京芯视界微电子科技有限公司 Clock system for single photon detection chip and calibration method thereof
CN113114108A (en) * 2021-05-05 2021-07-13 诺领科技(南京)有限公司 Method for estimating crystal oscillator frequency
CN114500209A (en) * 2021-12-23 2022-05-13 北京智联安科技有限公司 Frequency offset compensation method, system, electronic device and computer readable storage medium
CN114500209B (en) * 2021-12-23 2024-02-27 北京智联安科技有限公司 Frequency offset compensation method, system, electronic equipment and computer readable storage medium
CN114689964A (en) * 2022-02-28 2022-07-01 惠州金百泽物联科技有限公司 Circuit design, test and adjustment method for starting stability of crystal oscillator
CN114689964B (en) * 2022-02-28 2023-11-24 深圳市造物工场科技有限公司 Crystal oscillator starting stability testing circuit, testing and adjusting method
CN115314142A (en) * 2022-06-29 2022-11-08 阿波罗智能技术(北京)有限公司 Time calibration method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110932718B (en) 2023-01-24

Similar Documents

Publication Publication Date Title
CN110932718B (en) Method, device and equipment for calibrating clock frequency of crystal oscillator and storage medium
US7800457B2 (en) Self-calibrating temperature-compensated oscillator
US7925463B2 (en) Method and system for compensating temperature readings from a temperature sensing crystal integrated circuit
US10763781B2 (en) System and method of crystal oscillator temperature compensation for operation in extended temperature range
CN102185663B (en) Frequency calibration method and device
EP2383889A2 (en) Calibration of adjustable filters
CN110034728B (en) System, apparatus and method for accurate measurement of off-chip temperature
CN108227471B (en) GPS shares the calibration method and device of clock
GB2482528A (en) Crystal reference oscillator for navigation applications
CN107276582B (en) Temperature compensation crystal oscillator based on analog circuit
CN113114108A (en) Method for estimating crystal oscillator frequency
CN103904998A (en) Method and device for adjusting frequency of mobile terminal
CN114647178B (en) Automatic atomic clock calibration method and system based on Beidou and ground reference transmission
CN112422126B (en) Clock calibration circuit
CN111045318B (en) Calibration method, device and system of equipment clock, self-calibration method and equipment
CN111045317B (en) Calibration method, device and system of equipment clock, self-calibration method and equipment
CN110212911B (en) Frequency calibration method and device and storage medium
CN110830033B (en) Clock frequency compensation method and system for GNSS system, storage medium and terminal
JPH07218612A (en) Gps receiver, data demodulation method and inspection system therefor
CN111007710B (en) Production line calibration method, device and system of equipment clock, self-calibration method and equipment
US11799423B2 (en) Method of building oscillator frequency adjustment lookup table and associated transceiver
US8912956B2 (en) Cooperative calibration of platform shared voltage controlled oscillator
CN117348686B (en) Clock signal temperature drift correction method, circuit, chip and electronic equipment
KR20230078989A (en) Frequency compensation method and circuit, storage medium, electronic device
CN117811573A (en) Frequency offset compensation method, clock signal generation method, electronic device and medium

Legal Events

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