[go: up one dir, main page]

CN113934598B - Real-time temperature compensation trimming method for on-chip oscillator based on temperature sensor - Google Patents

Real-time temperature compensation trimming method for on-chip oscillator based on temperature sensor Download PDF

Info

Publication number
CN113934598B
CN113934598B CN202111217155.7A CN202111217155A CN113934598B CN 113934598 B CN113934598 B CN 113934598B CN 202111217155 A CN202111217155 A CN 202111217155A CN 113934598 B CN113934598 B CN 113934598B
Authority
CN
China
Prior art keywords
chip
value
trimming
oscillator
temperature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111217155.7A
Other languages
Chinese (zh)
Other versions
CN113934598A (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.)
Hunan Jinxin Electronic Technology Co ltd
Original Assignee
Hunan Jinxin Electronic Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Jinxin Electronic Technology Co ltd filed Critical Hunan Jinxin Electronic Technology Co ltd
Priority to CN202111217155.7A priority Critical patent/CN113934598B/en
Publication of CN113934598A publication Critical patent/CN113934598A/en
Application granted granted Critical
Publication of CN113934598B publication Critical patent/CN113934598B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01KMEASURING TEMPERATURE; MEASURING QUANTITY OF HEAT; THERMALLY-SENSITIVE ELEMENTS NOT OTHERWISE PROVIDED FOR
    • G01K15/00Testing or calibrating of thermometers
    • G01K15/005Calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3058Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Oscillators With Electromechanical Resonators (AREA)

Abstract

The invention provides a real-time temperature compensation trimming method of an on-chip oscillator based on a temperature sensor, which comprises the following steps: step 1, setting an expected output value of an on-chip oscillator of a chip before leaving a factory and storing the expected output value into a memory space of the chip; and 2, capturing the actual output value of the on-chip oscillator of the chip through a capturing module of the chip, obtaining the actual output value of the on-chip oscillator, storing the actual output value of the on-chip oscillator into a memory space of the chip, reading the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator stored in the memory space through a CPU, and trimming the on-chip oscillator before leaving the factory according to the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator read by the CPU. The invention can ensure that the on-chip oscillator can obtain stable output at various temperatures, improves the availability and stability of the on-chip oscillator, ensures that the on-chip oscillator can be better applied to more scenes, and reduces the cost.

Description

Real-time temperature compensation trimming method for on-chip oscillator based on temperature sensor
Technical Field
The invention relates to the technical field of on-chip oscillator trimming, in particular to a real-time temperature compensation trimming method of an on-chip oscillator based on a temperature sensor.
Background
At the moment of rapid development of science and technology, the application range of the DSP is wider in various scenes, however, in the prior art, the DSP has some problems, and one of the problems of the internal on-chip oscillator is that the internal on-chip oscillator changes along with temperature changes, and even exceeds the designed range at certain temperatures, and great uncertainty is brought to the use process. But the internal on-chip oscillator can not only improve the stability of the whole chip compared with the external crystal oscillator, but also reduce the area of the PCB in the practical application process so as to reduce the cost. However, the internal on-chip oscillator is not as accurate as the external crystal oscillator due to various aspects such as process variations. And a temperature sensor capable of reflecting real-time temperature is arranged in part of the DSPs, and for the DSPs, real-time trimming can be performed on an on-chip oscillator in the DSPs through the temperature sensor in the chip at different temperatures.
Disclosure of Invention
The invention provides a real-time temperature compensation trimming method of an on-chip oscillator based on a temperature sensor, which aims to solve the problems that the conventional trimming method needs to manually measure the output value of the on-chip oscillator before trimming at different temperatures, and the trimming method is complicated and complex and is not suitable for application scenes with large temperature variation.
In order to achieve the above object, an embodiment of the present invention provides a real-time temperature compensation trimming method for an on-chip oscillator based on a temperature sensor, including:
step 1, setting an expected output value of an on-chip oscillator of a chip before leaving a factory and storing the expected output value into a memory space of the chip;
Step 2, capturing the actual output value of the on-chip oscillator of the chip through a capturing module of the chip to obtain the actual output value of the on-chip oscillator and storing the actual output value into a memory space of the chip, reading the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator stored in the memory space through a CPU, and trimming the on-chip oscillator before leaving the factory according to the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator read by the CPU;
Step 3, setting a threshold value for real-time temperature compensation trimming after leaving the factory and when the chip actually operates, storing the threshold value into a memory space of the chip, acquiring a linear relation between the temperature of the chip in actual operation and the actual output value of the on-chip oscillator of the chip, storing the linear relation into the memory space of the chip, measuring the temperature value of the surrounding environment in real time through a temperature sensor of the chip, and storing the temperature value into the memory space of the chip;
Step 4, reading the temperature value measured before the temperature sensor, the temperature value measured currently by the temperature sensor and the threshold value stored in the memory space through the CPU;
Step 5, the operation module compares the difference value between the temperature value measured before the temperature sensor read by the CPU and the temperature value measured currently by the temperature sensor with the threshold value;
Step 6, when the difference value between the temperature value measured by the temperature sensor before and the temperature value measured by the temperature sensor at present is larger than the threshold value, the operation module carries out real-time temperature compensation trimming on the on-chip oscillator;
and 7, when the difference value between the temperature value measured by the temperature sensor and the temperature value measured by the temperature sensor is smaller than the threshold value, the chip normally operates.
Wherein, the step 2 specifically includes:
Step 21, capturing the actual output value of the on-chip oscillator of the chip for a plurality of times through a capturing module of the chip, and averaging the captured output values for a plurality of times to obtain the final captured actual output value of the on-chip oscillator and storing the final captured actual output value into a memory space of the chip;
Step 22, the CPU reads the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator stored in the memory space, and the operation module calculates the difference between the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator according to the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator read by the CPU;
step 23, judging whether the difference is larger than a set rough adjustment threshold value;
Step 24, when the difference value is greater than the set coarse tuning threshold value, reading the coarse tuning value of the trimming register of the chip stored in the memory space by the CPU, changing the coarse tuning value of the trimming register of the chip according to the difference value by the operation module, storing the coarse tuning value of the trimming register of the changed chip into the memory space of the chip, and jumping to step 21;
Step 25, when the difference value is smaller than the set coarse adjustment threshold value, judging whether the difference value is larger than the set fine adjustment threshold value, and when the difference value is larger than the set fine adjustment threshold value, reading the fine adjustment value of the trimming register of the chip stored in the memory space through the CPU, changing the fine adjustment value of the trimming register of the chip according to the difference value by the operation module, storing the fine adjustment value of the trimming register of the changed chip in the memory space of the chip, and jumping to step 21;
and step 26, finishing the trimming of the on-chip oscillator before delivery when the difference value is smaller than the set fine-tuning threshold value.
The step 24 specifically includes:
the operation module changes the rough adjustment value of the trimming register of the chip according to the difference value, and the steps are as follows:
step 241, judging whether the difference is positive or negative, and when the difference is positive, increasing the rough adjustment value of the adjustment register of the chip by a rough adjustment count value; and when the difference value is negative, reducing the rough adjustment value of the trimming register of the chip by one rough adjustment count value.
The step 25 specifically includes:
the operation module changes the fine adjustment value of the trimming register of the chip according to the difference value, and the steps are as follows:
step 251, judging whether the difference value is positive or negative, and when the difference value is positive, increasing the fine adjustment value of the trimming register of the chip by a fine adjustment count value; and when the difference value is negative, reducing the fine tuning value of the trimming register of the chip by one fine tuning count value.
Wherein, the step 3 specifically includes:
And step 31, measuring the temperature value of the surrounding environment in real time through a temperature sensor of the chip, filtering the currently measured temperature value to obtain a stable temperature value, and storing the stable temperature value into a memory space of the chip.
Wherein, the step 6 specifically includes:
The operation module carries out real-time temperature compensation trimming on the on-chip oscillator, and the steps are as follows:
Step 61, the CPU reads the linear relation between the temperature of the chip in actual operation and the actual output value of the on-chip oscillator of the chip, the current stable temperature value and the fine tuning value of the trimming register after factory trimming, and the operation module calculates the fine tuning value of the new trimming register according to the linear relation between the temperature of the chip in actual operation and the actual output value of the on-chip oscillator of the chip, the current stable temperature value and the fine tuning value of the trimming register after factory trimming, which are read by the CPU;
Step 62, the operation module writes the calculated fine tuning value of the new trimming register into the trimming register to complete the real-time temperature compensation trimming of the on-chip oscillator.
The scheme of the invention has the following beneficial effects:
according to the real-time temperature compensation trimming method for the on-chip oscillator based on the temperature sensor, which is disclosed by the embodiment of the invention, the on-chip oscillator can be stably output at various temperatures, the availability and stability of the on-chip oscillator are improved, the on-chip oscillator can be better applied to more scenes, the cost is reduced, and the trimming method is simple.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a graph showing the temperature dependence of an on-chip oscillator according to the present invention;
FIG. 3 is a schematic diagram of the output frequency of the on-chip oscillator at room temperature according to the present invention;
fig. 4 is a schematic diagram of an output frequency of the on-chip oscillator of the present invention after being trimmed before shipment;
FIG. 5 is a schematic diagram of the output frequency of the on-chip oscillator of the present invention at 50deg.C;
Fig. 6 is a schematic diagram of an output frequency of the on-chip oscillator after real-time temperature compensation trimming according to the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages to be solved more apparent, the following detailed description will be given with reference to the accompanying drawings and specific embodiments.
Aiming at the problems that the existing trimming method needs to manually measure the output value of the on-chip oscillator before trimming at different temperatures, the trimming method is complicated and complex and is not suitable for application scenes with large temperature variation, and the real-time temperature compensation trimming method of the on-chip oscillator based on the temperature sensor is provided.
As shown in fig. 1 to 6, an embodiment of the present invention provides a real-time temperature compensation trimming method for an on-chip oscillator based on a temperature sensor, including: step 1, setting an expected output value of an on-chip oscillator of a chip before leaving a factory and storing the expected output value into a memory space of the chip; step 2, capturing the actual output value of the on-chip oscillator of the chip through a capturing module of the chip to obtain the actual output value of the on-chip oscillator and storing the actual output value into a memory space of the chip, reading the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator stored in the memory space through a CPU, and trimming the on-chip oscillator before leaving the factory according to the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator read by the CPU; step 3, setting a threshold value for real-time temperature compensation trimming after leaving the factory and when the chip actually operates, storing the threshold value into a memory space of the chip, acquiring a linear relation between the temperature of the chip in actual operation and the actual output value of the on-chip oscillator of the chip, storing the linear relation into the memory space of the chip, measuring the temperature value of the surrounding environment in real time through a temperature sensor of the chip, and storing the temperature value into the memory space of the chip; step 4, reading the temperature value measured before the temperature sensor, the temperature value measured currently by the temperature sensor and the threshold value stored in the memory space through the CPU; step 5, the operation module compares the difference value between the temperature value measured before the temperature sensor read by the CPU and the temperature value measured currently by the temperature sensor with the threshold value; step 6, when the difference value between the temperature value measured by the temperature sensor before and the temperature value measured by the temperature sensor at present is larger than the threshold value, the operation module carries out real-time temperature compensation trimming on the on-chip oscillator; and 7, when the difference value between the temperature value measured by the temperature sensor and the temperature value measured by the temperature sensor is smaller than the threshold value, the chip normally operates.
Wherein, the step 2 specifically includes: step 21, capturing the actual output value of the on-chip oscillator of the chip for a plurality of times through a capturing module of the chip, and averaging the captured output values for a plurality of times to obtain the final captured actual output value of the on-chip oscillator and storing the final captured actual output value into a memory space of the chip; step 22, the CPU reads the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator stored in the memory space, and the operation module calculates the difference between the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator according to the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator read by the CPU; step 23, judging whether the difference is larger than a set rough adjustment threshold value; step 24, when the difference value is greater than the set coarse tuning threshold value, reading the coarse tuning value of the trimming register of the chip stored in the memory space by the CPU, changing the coarse tuning value of the trimming register of the chip according to the difference value by the operation module, storing the coarse tuning value of the trimming register of the changed chip into the memory space of the chip, and jumping to step 21; step 25, when the difference value is smaller than the set coarse adjustment threshold value, judging whether the difference value is larger than the set fine adjustment threshold value, and when the difference value is larger than the set fine adjustment threshold value, reading the fine adjustment value of the trimming register of the chip stored in the memory space through the CPU, changing the fine adjustment value of the trimming register of the chip according to the difference value by the operation module, storing the fine adjustment value of the trimming register of the changed chip in the memory space of the chip, and jumping to step 21; and step 26, finishing the trimming of the on-chip oscillator before delivery when the difference value is smaller than the set fine-tuning threshold value.
According to the temperature sensor-based on-chip oscillator real-time temperature compensation trimming method disclosed by the embodiment of the invention, a capturing module captures for a plurality of times, and averages the captured results to obtain the final captured actual output value of the on-chip oscillator, an operation module calculates a difference value according to the actual output value of the on-chip oscillator and the set expected output value of the on-chip oscillator before leaving the factory, the difference value has positive and negative components, the rough adjustment or fine adjustment is determined according to whether the difference value is larger than the set rough adjustment threshold value, the rough adjustment count value of the current rough adjustment value of a trimming register is increased or decreased according to the positive and negative determination of the difference value during rough adjustment until the difference value of the actual output value of the on-chip oscillator and the set expected output value of the on-chip oscillator before leaving the factory is smaller than the rough adjustment threshold value, after the difference value is smaller than the threshold value of the set fine adjustment value of the on-chip oscillator, and when the difference value is larger than the set fine adjustment threshold value of the set on-chip oscillator before leaving the factory, the current trimming value of the register is increased or decreased according to the positive and negative determination of the difference value of the on-chip oscillator before leaving the chip is smaller than the set than the threshold value of the expected.
According to the real-time temperature compensation trimming method for the on-chip oscillator based on the temperature sensor, which is disclosed by the embodiment of the invention, a trimming register of the on-chip oscillator is INTOSCnTRIM, wherein 0 to 7 bits of the trimming register are coarse tuning values, and 9 to 14 bits of the trimming register are fine tuning values.
The step 24 specifically includes: the operation module changes the rough adjustment value of the trimming register of the chip according to the difference value, and the steps are as follows: step 241, judging whether the difference is positive or negative, and when the difference is positive, increasing the rough adjustment value of the adjustment register of the chip by a rough adjustment count value; and when the difference value is negative, reducing the rough adjustment value of the trimming register of the chip by one rough adjustment count value.
The step 25 specifically includes: the operation module changes the fine adjustment value of the trimming register of the chip according to the difference value, and the steps are as follows: step 251, judging whether the difference value is positive or negative, and when the difference value is positive, increasing the fine adjustment value of the trimming register of the chip by a fine adjustment count value; and when the difference value is negative, reducing the fine tuning value of the trimming register of the chip by one fine tuning count value.
Wherein, the step 3 specifically includes: and step 31, measuring the temperature value of the surrounding environment in real time through a temperature sensor of the chip, filtering the currently measured temperature value to obtain a stable temperature value, and storing the stable temperature value into a memory space of the chip.
Wherein, the step 6 specifically includes: the operation module carries out real-time temperature compensation trimming on the on-chip oscillator, and the steps are as follows: step 61, the CPU reads the linear relation between the temperature of the chip in actual operation and the actual output value of the on-chip oscillator of the chip, the current stable temperature value and the fine tuning value of the trimming register after factory trimming, and the operation module calculates the fine tuning value of the new trimming register according to the linear relation between the temperature of the chip in actual operation and the actual output value of the on-chip oscillator of the chip, the current stable temperature value and the fine tuning value of the trimming register after factory trimming, which are read by the CPU; step 62, the operation module writes the calculated fine tuning value of the new trimming register into the trimming register to complete the real-time temperature compensation trimming of the on-chip oscillator.
According to the real-time temperature compensation trimming method for the on-chip oscillator based on the temperature sensor, the current temperature value of the chip is obtained through the temperature sensor of the chip, the obtained current temperature value is filtered to obtain a stable temperature value and stored in the memory space, the temperature sensor provides the stable temperature value, the error trimming of the on-chip oscillator cannot be caused, the fine tuning value suitable for the current temperature is calculated according to the linear relation among the current stable temperature value, the fine tuning value of the trimming register after factory trimming and the output value of the on-chip oscillator of the chip in actual operation, and the on-chip oscillator is not required to be trimmed by an external device when the on-chip oscillator is used.
According to the real-time temperature compensation trimming method for the on-chip oscillator based on the temperature sensor, which is disclosed by the embodiment of the invention, the real-time temperature compensation trimming is performed on the basis of the current trimming value to obtain a trimming value which is more suitable for the current temperature, and whether the real-time temperature compensation trimming is performed or not can be determined according to the temperature change, for example, the chip operation is always in a normal-temperature environment, and the temperature trimming is not needed; the time frequency of the change of the ambient temperature of the chip operation is slower, and the temperature trimming frequency can be correspondingly changed slowly; the environment temperature of the chip is rarely changed, and the trigger condition of real-time temperature compensation adjustment can be changed into a certain value of temperature change for operation; the real-time temperature compensation trimming can be flexibly adjusted according to the use scene, when the influence of the temperature on the output value of the on-chip oscillator does not exceed the coarse adjustment threshold value, only fine adjustment is needed, and after the fine adjustment value is obtained through calculation, the fine adjustment value is written into the trimming register to complete real-time temperature compensation trimming.
The method for real-time temperature compensation trimming of the on-chip oscillator based on the temperature sensor according to the embodiment of the invention comprises the steps of trimming the on-chip oscillator before the chip leaves the factory and performing real-time temperature compensation trimming on the on-chip oscillator according to the change of the temperature when the chip actually operates, wherein the implementation scheme of trimming the on-chip oscillator before the chip leaves the factory is as follows: the capturing module is responsible for capturing a square wave with a known frequency to obtain an actual value of the current chip frequency; the operation module compares the actual value with the set expected value in the capturing module, and when the actual value and the expected value have larger phase difference, the step length of trimming needs to be longer, and coarse adjustment is carried out by changing the coarse adjustment value of the trimming register; when the actual value and the expected value have smaller phase difference, the trimming step length needs to be shorter, the fine adjustment is carried out by changing the fine adjustment value of the trimming register, the process is repeated for a plurality of times, and finally an ideal coarse adjustment value and fine adjustment value are obtained, written into the trimming register and stored in a memory space; the main reason that the on-chip oscillator needs to be repaired based on temperature when the chip actually operates is that the on-chip oscillator generates deviation according to temperature change, the deviation value is found to be in a linear relation with the temperature after test, the linear relation between the temperature of the chip and the output value of the on-chip oscillator during actual operation is stored in a memory space, and the on-chip oscillator is repaired by real-time temperature compensation according to the change of the temperature: acquiring real-time temperature through a temperature sensor and storing the real-time temperature into a memory space; the CPU reads the real-time temperature stored in the memory space, the linear relation between the temperature of the chip in actual operation and the output value of the on-chip oscillator of the chip and the fine adjustment value of the trimming register after factory trimming, and the operation module calculates the fine adjustment value of the new trimming register according to the real-time temperature read by the CPU, the linear relation between the temperature of the chip in actual operation and the output value of the on-chip oscillator of the chip and the fine adjustment value of the trimming register after factory trimming, and writes the fine adjustment value into the trimming register to complete real-time temperature compensation trimming of the on-chip oscillator.
In the method for real-time temperature compensation and trimming of an on-chip oscillator based on a temperature sensor according to the above embodiment of the present invention, taking an ADP32F035 chip as an example, two on-chip oscillators and a temperature sensor are provided in the ADP32F035 chip, taking a first on-chip oscillator as an example, setting the ideal output of the first on-chip oscillator to be 10MHz, and the actual output of the first on-chip oscillator measured at normal temperature to be 9.923MHz is as shown in fig. 3; after the first on-chip oscillator is subjected to factory trimming, the measured actual output of the first on-chip oscillator is 10MHz as shown in figure 4; at a temperature of 50 ℃, the actual output of the first on-chip oscillator is 9.957MHz as shown in fig. 5, and the actual output of the first on-chip oscillator is 9.923MHz as shown in the fig. 5, which shows that the output of the on-chip oscillator changes along with the change of temperature, and in an actual application scene, the ideal output value of the on-chip oscillator should be 10MHz, therefore, the first on-chip oscillator at the temperature of 50 ℃ is subjected to real-time temperature compensation trimming, the output of the first on-chip oscillator measured after the real-time temperature compensation trimming is 10.01MHz as shown in fig. 6, and the on-chip oscillator real-time temperature compensation trimming method based on the temperature sensor can ensure that the on-chip oscillator can obtain stable output at various temperatures, so that the stability of the whole system can be improved in the actual application, and meanwhile, the usability of the on-chip oscillator can be better applied to more scenes, the area of the on-chip oscillator can be saved to a certain extent in the actual application, the area of the on-chip oscillator can be reduced, and the cost of the on-chip oscillator can be improved relative to the external crystal cost when the on-chip oscillator is used.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (5)

1. An on-chip oscillator real-time temperature compensation trimming method based on a temperature sensor is characterized by comprising the following steps of:
step 1, setting an expected output value of an on-chip oscillator of a chip before leaving a factory and storing the expected output value into a memory space of the chip;
Step 2, capturing the actual output value of the on-chip oscillator of the chip through a capturing module of the chip to obtain the actual output value of the on-chip oscillator and storing the actual output value into a memory space of the chip, reading the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator stored in the memory space through a CPU, and trimming the on-chip oscillator before leaving the factory according to the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator read by the CPU;
The step 2 specifically includes:
Step 21, capturing the actual output value of the on-chip oscillator of the chip for a plurality of times through a capturing module of the chip, and averaging the captured output values for a plurality of times to obtain the final captured actual output value of the on-chip oscillator and storing the final captured actual output value into a memory space of the chip;
Step 22, the CPU reads the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator stored in the memory space, and the operation module calculates the difference between the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator according to the expected output value of the on-chip oscillator and the actual output value of the on-chip oscillator read by the CPU;
step 23, judging whether the difference is larger than a set rough adjustment threshold value;
Step 24, when the difference value is greater than the set coarse tuning threshold value, reading the coarse tuning value of the trimming register of the chip stored in the memory space by the CPU, changing the coarse tuning value of the trimming register of the chip according to the difference value by the operation module, storing the coarse tuning value of the trimming register of the changed chip into the memory space of the chip, and jumping to step 21;
Step 25, when the difference value is smaller than the set coarse adjustment threshold value, judging whether the difference value is larger than the set fine adjustment threshold value, and when the difference value is larger than the set fine adjustment threshold value, reading the fine adjustment value of the trimming register of the chip stored in the memory space through the CPU, changing the fine adjustment value of the trimming register of the chip according to the difference value by the operation module, storing the fine adjustment value of the trimming register of the changed chip in the memory space of the chip, and jumping to step 21;
step 26, finishing the trimming of the on-chip oscillator before leaving the factory when the difference value is smaller than the set fine-tuning threshold value;
Step 3, setting a threshold value for real-time temperature compensation trimming after leaving the factory and when the chip actually operates, storing the threshold value into a memory space of the chip, acquiring a linear relation between the temperature of the chip in actual operation and the actual output value of the on-chip oscillator of the chip, storing the linear relation into the memory space of the chip, measuring the temperature value of the surrounding environment in real time through a temperature sensor of the chip, and storing the temperature value into the memory space of the chip;
Step 4, reading the temperature value measured before the temperature sensor, the temperature value measured currently by the temperature sensor and the threshold value stored in the memory space through the CPU;
Step 5, the operation module compares the difference value between the temperature value measured before the temperature sensor read by the CPU and the temperature value measured currently by the temperature sensor with the threshold value;
Step 6, when the difference value between the temperature value measured by the temperature sensor before and the temperature value measured by the temperature sensor at present is larger than the threshold value, the operation module carries out real-time temperature compensation trimming on the on-chip oscillator;
and 7, when the difference value between the temperature value measured by the temperature sensor and the temperature value measured by the temperature sensor is smaller than the threshold value, the chip normally operates.
2. The real-time temperature compensation trimming method of an on-chip oscillator based on a temperature sensor according to claim 1, wherein the step 24 specifically comprises:
the operation module changes the rough adjustment value of the trimming register of the chip according to the difference value, and the steps are as follows:
step 241, judging whether the difference is positive or negative, and when the difference is positive, increasing the rough adjustment value of the adjustment register of the chip by a rough adjustment count value; and when the difference value is negative, reducing the rough adjustment value of the trimming register of the chip by one rough adjustment count value.
3. The real-time temperature compensation trimming method of an on-chip oscillator based on a temperature sensor according to claim 2, wherein the step 25 specifically comprises:
the operation module changes the fine adjustment value of the trimming register of the chip according to the difference value, and the steps are as follows:
step 251, judging whether the difference value is positive or negative, and when the difference value is positive, increasing the fine adjustment value of the trimming register of the chip by a fine adjustment count value; and when the difference value is negative, reducing the fine tuning value of the trimming register of the chip by one fine tuning count value.
4. The real-time temperature compensation trimming method for an on-chip oscillator based on a temperature sensor according to claim 3, wherein the step 3 specifically comprises:
And step 31, measuring the temperature value of the surrounding environment in real time through a temperature sensor of the chip, filtering the currently measured temperature value to obtain a stable temperature value, and storing the stable temperature value into a memory space of the chip.
5. The real-time temperature compensation trimming method of an on-chip oscillator based on a temperature sensor according to claim 4, wherein the step 6 specifically comprises:
The operation module carries out real-time temperature compensation trimming on the on-chip oscillator, and the steps are as follows:
Step 61, the CPU reads the linear relation between the temperature of the chip in actual operation and the actual output value of the on-chip oscillator of the chip, the current stable temperature value and the fine tuning value of the trimming register after factory trimming, and the operation module calculates the fine tuning value of the new trimming register according to the linear relation between the temperature of the chip in actual operation and the actual output value of the on-chip oscillator of the chip, the current stable temperature value and the fine tuning value of the trimming register after factory trimming, which are read by the CPU;
Step 62, the operation module writes the calculated fine tuning value of the new trimming register into the trimming register to complete the real-time temperature compensation trimming of the on-chip oscillator.
CN202111217155.7A 2021-10-19 2021-10-19 Real-time temperature compensation trimming method for on-chip oscillator based on temperature sensor Active CN113934598B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111217155.7A CN113934598B (en) 2021-10-19 2021-10-19 Real-time temperature compensation trimming method for on-chip oscillator based on temperature sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111217155.7A CN113934598B (en) 2021-10-19 2021-10-19 Real-time temperature compensation trimming method for on-chip oscillator based on temperature sensor

Publications (2)

Publication Number Publication Date
CN113934598A CN113934598A (en) 2022-01-14
CN113934598B true CN113934598B (en) 2024-10-22

Family

ID=79280638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111217155.7A Active CN113934598B (en) 2021-10-19 2021-10-19 Real-time temperature compensation trimming method for on-chip oscillator based on temperature sensor

Country Status (1)

Country Link
CN (1) CN113934598B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118425748B (en) * 2024-04-26 2024-12-27 深圳市华力宇电子科技有限公司 Chip adjustment method, electronic device and storage medium with C2 interface bus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569544A (en) * 2015-10-10 2017-04-19 上海东软载波微电子有限公司 Real time clock chip, and clock calibration method and apparatus
CN112729590A (en) * 2020-12-25 2021-04-30 中国科学院微电子研究所 Temperature sensor reading device, temperature reading method, and electronic apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2003226322A1 (en) * 2003-04-10 2004-11-26 Chen, Chung-Chin Chip oscillator module and its verification method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569544A (en) * 2015-10-10 2017-04-19 上海东软载波微电子有限公司 Real time clock chip, and clock calibration method and apparatus
CN112729590A (en) * 2020-12-25 2021-04-30 中国科学院微电子研究所 Temperature sensor reading device, temperature reading method, and electronic apparatus

Also Published As

Publication number Publication date
CN113934598A (en) 2022-01-14

Similar Documents

Publication Publication Date Title
CN113934598B (en) Real-time temperature compensation trimming method for on-chip oscillator based on temperature sensor
US11604102B2 (en) Semiconductor device, temperature sensor and power supply voltage monitor
CN101604970A (en) Self-fitting digital temperature compensation crystal oscillistor and system thereof and implementation method
US20090177904A1 (en) Method, system, and apparatus for dynamic clock adjustment
CN111802710A (en) Electronic atomization device, atomization heating control method and device and atomizer main body
CN110568397B (en) Electric energy meter correction method and system based on MCU software
CN112444271A (en) Method for dynamically compensating measurement error in high-temperature and low-temperature environment
CN108020808B (en) High-reliability high-precision electric energy meter real-time clock design method
CN113064114A (en) High-precision quick meter calibration method for multi-core electric energy meter
CN101299595A (en) Method and apparatus system for compensating temperature of power amplifier
CN112576326B (en) Sliding pressure optimal operation control method, device and equipment for thermal power generating unit
CN113114108A (en) Method for estimating crystal oscillator frequency
CN114035024B (en) Real-time clock chip testing system and method
CN115184759A (en) Frequency/temperature characteristic test method and system for identifying excitatory hopping of crystal oscillator
CN112003608B (en) Method and device for determining temperature compensation parameters of frequency source
CN107636970A (en) Method and apparatus for compensating the offset drift varied with temperature
CN114500209B (en) Frequency offset compensation method, system, electronic equipment and computer readable storage medium
CN115065323B (en) A crystal oscillator automatic temperature compensation system and compensation method
CN113587972B (en) Sensor parameter correction processing method, device and system
CN111209712B (en) System, method and chip for obtaining working voltage of crystal oscillator
US6891361B2 (en) Automatic gain control (AGC) loop for characterizing continuous-time or discrete-time circuitry gain response across frequency
CN118157631B (en) Digital temperature compensation calibration method, controller and calibration circuit for real-time clock
CN119472915A (en) Temperature detection circuit and temperature compensation system
CN111638750A (en) Writer and RTC correcting method
US6919728B2 (en) Calibration cache and database

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