Calibration method and device, storage medium and program product

By adjusting the crystal identity ID value by terminal equipment, the problem of excessive crystal frequency at the extreme temperature is solved, and the stable registration of the crystal at the extreme temperature is realized and the registration process is simplified.

CN120274904APending Publication Date: 2025-07-08FIBOCOM WIRELESS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510299982.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

At the extreme temperature, the frequency deviation of the crystal is too large, making it difficult for the crystal to pass registration, and it is difficult for the prior art to effectively adjust the parameters of the crystal characteristic curve to control the frequency deviation within a certain range.

Method used

The terminal device determines whether the crystal temperature is within the first range, detects the current frequency deviation, and adjusts the crystal identity ID value until the frequency deviation is within the preset range, and completes the registration.

Benefits of technology

It realizes stable registration of crystals at extreme temperatures, reduces the requirements for printed circuit board layout and traces, and simplifies the registration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120274904A_ABST
    Figure CN120274904A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a calibration method and device, a storage medium and a program product. The method is applied to terminal equipment and comprises the steps that the terminal equipment judges whether the current crystal temperature is within a first range or not; if the crystal temperature is within the first range, the terminal device detects a first frequency offset in the current environment; if the first frequency offset is within a preset range, the terminal device calls a first crystal identity ID value in a first memory to complete registration; wherein the first memory is a dynamic memory. And if the first frequency offset is not within the preset range, the terminal device adjusts the first crystal ID value, and writes the adjusted first crystal ID value into the first memory, so that the first frequency offset is within the preset range. According to the method, the crystal can be registered when the temperature of the crystal belongs to the first range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of the Internet of Things, and particularly to a calibration method, device, storage medium, and program product. Background Art

[0002] When the temperature of a crystal is at an extreme temperature (for example, the temperature of the crystal is higher than 45°C, or the temperature of the crystal is lower than 15°C), the central processing unit (CPU) of a terminal device, based on the crystal identification (ID) value determined by a calibration device, detects the temperature of the crystal and the frequency offset of the crystal at this temperature, and inversely deduces each parameter of the crystal characteristic curve through the corresponding relationship between the temperature of the crystal and the frequency offset of the crystal. The CPU calculates the frequency offset of the crystal when the temperature of the crystal is at the extreme temperature according to the crystal characteristic curve, and adjusts each parameter of the crystal characteristic curve to make the frequency offset of the crystal within a certain range.

[0003] However, the ability of the CPU to inversely deduce each parameter of the crystal characteristic curve and adjust each parameter to make the frequency offset of the crystal within a certain range is limited, which may cause the frequency offset of the crystal to be too large at the extreme temperature, and further cause the crystal to be difficult to register. Summary of the Invention

[0004] Embodiments of the present application provide a calibration method, device, storage medium, and program product, which can achieve the registration of a crystal when the temperature of the crystal belongs to a first range.

[0005] In a first aspect, an embodiment of the present application provides a calibration method. The method includes: the terminal device determines whether the current crystal temperature is within a first range. If the crystal temperature is within the first range, the terminal device detects the first frequency offset in the current environment. If the first frequency offset is within a preset range, the terminal device calls the first crystal identification ID value in the first memory to complete the registration; wherein, the first memory is a dynamic memory. If the first frequency offset is not within the preset range, the terminal device adjusts the first crystal ID value and writes the adjusted first crystal ID value into the first memory to make the first frequency offset within the preset range.

[0006] It can be seen that in the embodiments of the present application, when the current crystal temperature of the terminal device is within the first range and the first frequency offset detected in the current environment is within the preset range, the first crystal ID value is called to complete the registration. When the current crystal temperature of the terminal device is within the first range and the first frequency offset detected in the current environment is not within the preset range, the first frequency offset is adjusted to be within the preset range by adjusting the first crystal ID value, and then the registration is completed. Among them, the first range can be the temperature range corresponding to the extreme high temperature or the temperature range corresponding to the extreme low temperature. Therefore, this method can realize the registration of the crystal when the temperature of the crystal belongs to the extreme high and low temperatures.

[0007] In an alternative embodiment, the terminal device may further perform the following steps: if the crystal temperature is not within the first range, then call the second crystal ID value in the second memory to complete the registration.

[0008] In an alternative embodiment, if the first frequency offset is not within the preset range, the terminal device adjusts the first crystal ID value, including: if the first frequency offset is not within the preset range, then adjust the first crystal ID value according to a preset step.

[0009] In an alternative embodiment, if the first frequency offset is not within the preset range, the terminal device adjusts the first crystal ID value according to a preset step, including: if the first frequency offset is greater than the maximum value of the preset range, then increase the first crystal ID value according to a preset step to obtain the adjusted first crystal ID value; if the first frequency offset is less than the minimum value of the preset range, then decrease the first crystal ID value according to a preset step to obtain the adjusted first crystal ID value.

[0010] In an alternative embodiment, the terminal device may further perform the following operations: detect the frequency offset in the current environment to obtain the adjusted first frequency offset; if the adjusted first frequency offset is within the preset range, then schedule the adjusted first crystal ID value in the first memory to complete the registration; if the adjusted first frequency offset is not within the preset range, then adjust the adjusted first crystal ID value and write the adjusted crystal ID value into the first memory so that the adjusted first frequency offset is within the preset range.

[0011] In an alternative embodiment, the initial value of the first crystal ID value in the first memory is the same as the second crystal ID value in the second memory. The terminal device may further perform the following operations: adjust the output frequency of the crystal by switching the capacitor array in the power management integrated circuit chip to obtain the second crystal ID value; write the second crystal ID value into the second memory.

[0012] In a second aspect, the embodiments of the present application provide a calibration device, and the device includes:

[0013] A judgment module, configured to judge whether the current crystal temperature is within a first range;

[0014] A detection module, configured to detect a first frequency offset in the current environment if the crystal temperature is within the first range;

[0015] An invocation module, configured to invoke a first crystal identity identification ID value in a first memory to complete registration if the first frequency offset is within a preset range; wherein, the first memory is a dynamic memory;

[0016] An adjustment module, configured to adjust the first crystal ID value if the first frequency offset is not within the preset range, and write the adjusted first crystal ID value into the first memory so that the first frequency offset is within the preset range.

[0017] In addition, in this aspect, other optional implementation manners of the calibration device can refer to the relevant content of the first aspect above, which will not be elaborated here.

[0018] In a third aspect, an embodiment of the present application provides a communication device, where the communication device includes a communication module, a power supply module, a storage module, and a chip, wherein:

[0019] The power supply module is configured to provide electric energy for the communication device;

[0020] The storage module is configured to store data and instructions;

[0021] The communication module is configured to perform internal communication of the communication device or communicate between the communication device and an external device;

[0022] The chip is configured to execute the method described in the first aspect above.

[0023] In a fourth aspect, the present application further provides a computer device, where the computer device includes: a memory, a processor, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, the steps of the method as described above are implemented.

[0024] In a fifth aspect, the present application further provides a computer storage medium, where the computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method as described above are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0026] Figure 1 It is a schematic flowchart of a calibration method provided by an embodiment of the present application;

[0027] Figure 2 It is a schematic flowchart of another calibration method provided by an embodiment of the present application;

[0028] Figure 3 It is a schematic structural diagram of a calibration device provided by an embodiment of the present application;

[0029] Figure 4 It is a schematic structural diagram of a communication device provided by an embodiment of the present application;

[0030] Figure 5 It is a schematic structural diagram of a computer device provided by an embodiment of the present application.

[0031] The realization of the purpose of the present application, functional features and advantages will be further described in conjunction with the embodiments with reference to the accompanying drawings. Through the above-mentioned accompanying drawings, the specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Specific Embodiments

[0032] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0033] It should be understood that the terms "comprising" and "including" indicate the presence of the described features, steps, operations, elements, components, items, types, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, types, and / or groups. The terms "or", "and / or", "including at least one of the following" used in the present application can be interpreted inclusively, or mean any one or any combination. For example, "including at least one of the following: A, B, C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C", and again, "A, B or C" or "A, B and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C". An exception to this definition will occur only when the combination of elements, functions, steps, or operations is inherently mutually exclusive in some way.

[0034] It should be understood that although the steps in the flowcharts in the embodiments of the present application are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated herein, there is no strict order restriction for the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figure may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least some of the sub-steps or stages of other steps or other steps.

[0035] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0036] In the following description, the suffixes such as "module", "component" or "unit" used to represent elements are only for the convenience of describing the present application and have no specific meaning in themselves. Therefore, "module", "component" or "unit" can be used interchangeably.

[0037] The terminal device in the embodiments of the present application, also referred to as a terminal, may refer to various forms of user equipment (UE), access terminal, user unit, user station, mobile station, mobile station (MS), remote station, remote terminal, mobile device, user terminal, wireless communication device, user agent or user device. The terminal device may also be a cellular phone, cordless phone, session initiation protocol (SIP) phone, wireless local loop (WLL) station, personal digital assistant (PDA), handheld device with wireless communication function, computing device or other processing device connected to a wireless modem, vehicle-mounted device, wearable device, terminal device in a fifth-generation mobile communication (5G) network or terminal device in a future evolved public land mobile network (PLMN), etc. The embodiments of the present application are not limited thereto.

[0038] In the embodiments of the present application, the crystal may be a temperature sensing crystal (TSX). The TSX crystal is a crystal oscillator device with temperature sensing function, which is used to generate a stable clock signal. The TSX crystal can be deployed on the printed circuit board inside the terminal device.

[0039] In a possible way, the external crystal oscillator input (XTAL_IN) pin and the external crystal oscillator output (XTAL_OUT) pin of the crystal are connected to a power management integrated circuit (PMIC) chip. The parameters of the crystal can be adjusted by adjusting the capacitor array in the PMIC chip. The parameters of the crystal can be, for example, the output frequency of the crystal.

[0040] When the temperature of the crystal is at room temperature (such as 15°C to 45°C), the calibration device can perform a coarse calibration on the output frequency of the crystal. The calibration device is an electronic device that can be used to adjust the capacitor array in the PMIC chip. In addition, the coarse calibration means that the calibration device adjusts the output frequency of the crystal by adjusting the capacitor array in the PMIC chip, thereby adjusting the frequency offset between the output frequency of the crystal and the center frequency of the crystal. When the temperature of the crystal is at room temperature and the frequency offset of the crystal is between -5 parts per million (PPM) and 5 PPM, the calibration device determines the crystal identification (ID) value corresponding to the capacitance value of the capacitor array in the PMIC chip as the crystal ID value at room temperature. The crystal ID value can be a frequency adjustment sensitivity (trim) value or a capacitance identification (CAP_ID) value. PPM can be understood as one millionth and is used to represent how many units of frequency offset there are in every one million units. The calibration device can also write the crystal ID value obtained when the temperature of the crystal is at room temperature into the memory of the terminal device.

[0041] When the temperature of the crystal is at a high temperature (such as the temperature of the crystal is greater than 45°C) or when the temperature of the crystal is at a low temperature (such as the temperature of the crystal is less than 15°C), the central processing unit (CPU) of the terminal device performs a fine calibration on the output frequency of the crystal. The fine calibration can also be called field calibration. The fine calibration means that the CPU calls the crystal ID value in the memory of the terminal device, detects the temperature of the crystal and the frequency offset of the crystal at this temperature, and inversely deduces the parameters of the crystal characteristic curve through the corresponding relationship between the temperature of the crystal and the frequency offset of the crystal. The crystal characteristic curve can be expressed as:

[0042] f(t) = c3(t - t0) 3 + c2(t - t0) 2 + c1(t - t0) + c0 (1)

[0043] Among them, f represents the frequency deviation between the output frequency of the crystal and the center frequency of the crystal, t represents the temperature of the crystal, and t0 represents the reference temperature of the crystal. In addition, c0 is a constant term, representing the frequency deviation between the output frequency of the crystal and the center frequency of the crystal when the temperature of the crystal is t0; c1 is a first-order term coefficient, representing the linear influence of the temperature of the crystal on the frequency deviation of the crystal; c2 is a second-order term coefficient, c3 is a third-order term coefficient, and c2 and c3 represent the non-linear influence of the temperature of the crystal on the frequency deviation of the crystal.

[0044] After the CPU deduces the various parameters of the crystal characteristic curve, it calculates the frequency deviation of the crystal when the temperature of the crystal is high or the frequency deviation of the crystal when the temperature of the crystal is low according to the crystal characteristic curve, and adjusts the various parameters so that the frequency deviation of the crystal is within the preset frequency deviation range.

[0045] However, when the number of the collected crystal temperature and the frequency deviation of the crystal at this temperature is insufficient, such as when the temperature of the crystal drops suddenly, it is difficult to collect a sufficient number of crystal temperatures and the frequency deviations of the crystal at this temperature, which will make the time for the CPU to perform field calibration long. In addition, the CPU has relatively high requirements for the consistency of the various parameters in the crystal characteristic curve. The ability of the CPU to deduce the various parameters of the crystal characteristic curve and adjust the various parameters to make the frequency deviation of the crystal within a certain range is limited. Therefore, it is difficult to realize the adjustment process of the frequency deviation of the crystal at the extreme temperature, resulting in too large a frequency deviation of the crystal at the extreme temperature, and further resulting in difficulty for the crystal to pass registration.

[0046] In addition, the space on the printed circuit board is tight, and the wire length of the crystal (such as the wire length of the XTAL_IN pin and the XTAL_OUT pin) is difficult to meet the layout and wiring requirements of the CPU, which will cause the capacitance value of the capacitor array in the PMIC chip to be inaccurate, resulting in difficulty for the CPU to perform fine calibration according to the crystal ID value corresponding to the capacitance value of the capacitor array in the PMIC chip, and further resulting in difficulty for the crystal to pass registration, and the printed circuit board needs to be modified.

[0047] An embodiment of the present application proposes a calibration method, which is described from the perspective of a terminal device. Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a calibration method provided by an embodiment of the present application. The method includes but is not limited to:

[0048] S101. The terminal device determines whether the current crystal temperature is within a first range.

[0049] Among them, the first range is a preset temperature range, for example, it can be a temperature range preset by the terminal device in advance, or it can be a preset temperature range input by the user into the terminal device. For example, the first range can be a temperature range less than 15 °C, or it can also be a temperature range greater than 45 °C.

[0050] Optionally, the first range can be the temperature range corresponding to the extreme high temperature or the temperature range corresponding to the extreme low temperature.

[0051] In an alternative embodiment, the terminal device can query the temperature of the current crystal from the storage area through an attention (AT) command and determine whether the current crystal temperature is within the first range. Here, the AT command is a command set applied to the terminal device. Each command starts with the letter "AT" followed by letters and numbers, which are used to represent the functions that the terminal device wants to achieve through the AT command. When the terminal device queries the temperature of the crystal through the AT command, the letters and numbers in the AT command are used to represent the temperature of the crystal to be queried. For example, the terminal device queries the temperature of the crystal from the log file, and the log file includes the information of the terminal device's response to the AT command.

[0052] S102. If the crystal temperature is within the first range, the terminal device detects the first frequency offset in the current environment.

[0053] Optionally, the first frequency offset is the frequency offset between the output frequency and the center frequency of the crystal when the temperature of the crystal is within the first range and the ID value of the crystal is equal to the first crystal ID value. The ID value of the crystal corresponds one-to-one with the capacitance value in the capacitance array of the PMIC chip.

[0054] In an alternative embodiment, the first crystal ID value is the ID value of the crystal obtained by the calibration device under the condition that the temperature of the crystal is not within the first range and the frequency offset of the crystal is within the second range.

[0055] Here, the second range is a preset frequency offset range when the temperature of the crystal is not within the first range. For example, it can be the frequency offset range set by the terminal device in advance when the temperature of the crystal is not within the first range. For example, the second range is a preset frequency offset range when the temperature of the crystal is 15°C to 45°C, such as -5 PPM to 5 PPM.

[0056] Exemplarily, when the temperature of the crystal belongs to the range of 15°C to 45°C, the calibration device adjusts the output frequency of the crystal by adjusting the capacitance array in the PMIC chip, and then adjusts the frequency offset between the output frequency and the center frequency of the crystal. When the frequency offset of the crystal belongs to the range of -5 PPM to 5 PPM, the calibration device obtains the crystal ID value corresponding to the capacitance value in the PMIC chip, and this crystal ID value is the first crystal ID value.

[0057] In an alternative implementation, the terminal device can detect the first frequency offset in the current environment, which can be to query the first frequency offset of the crystal from the storage area through an AT command. The letters and numbers in the AT command indicate the frequency offset of the crystal to be queried. For example, the terminal device can query the first frequency offset of the crystal from the log file through an AT command.

[0058] It can be seen that when the terminal device detects that the temperature of the crystal is within the first range and the ID value of the crystal is equal to the first crystal ID value, the frequency offset of the crystal is conducive to determining whether the frequency offset of the crystal is within the preset range under this condition.

[0059] In an alternative implementation, the terminal device can also perform the following steps: If the crystal temperature is not within the first range, then call the second crystal ID value in the second memory to complete registration.

[0060] Among them, the second memory can be a non-volatile memory (NV).

[0061] Optionally, the terminal device can switch the capacitor array in the power management integrated circuit chip through a calibration device, adjust the output frequency of the crystal, obtain the second crystal ID value; and write the second crystal ID value into the second memory.

[0062] Specifically, after the calibration device obtains the crystal ID value (i.e., the second crystal ID value) corresponding to the capacitance value of the capacitor array in the PMIC chip when the temperature of the crystal is not within the first range and the frequency offset of the crystal belongs to the second range, it writes the second crystal ID value into the second memory of the terminal device.

[0063] It can be seen that the second crystal ID value is the ID value of the crystal when the temperature of the crystal is not within the first range and the frequency offset of the crystal is within the second range. When the temperature of the crystal is not within the first range, the crystal can generate a stable clock signal, and the terminal device does not need to adjust the second crystal ID value and can directly call the second crystal ID value in the second memory to enable the crystal to pass registration.

[0064] S103. If the first frequency offset is within the preset range, the terminal device calls the first crystal identity identification ID value in the first memory to complete registration; among them, the first memory is a dynamic memory.

[0065] Among them, the preset range is a preset frequency offset range when the temperature of the crystal is within the first range. For example, it can be the frequency offset range set by the terminal device in advance when the temperature of the crystal belongs to the first range. For example, the preset range is the preset frequency offset range when the temperature of the crystal is greater than 45°C, such as -8 PPM to 8 PPM. For another example, the preset range is the preset frequency offset range when the temperature of the crystal is less than 15°C, such as -5 PPM to 5 PPM.

[0066] Optionally, the first memory may be an NV. The first memory is used to store the ID value of the crystal when the temperature of the crystal is within the first range, and the initial value of the crystal ID stored in the first memory is equal to the ID value of the crystal when the temperature of the crystal is not within the first range and the frequency offset of the crystal belongs to the second range, that is, the initial value of the first crystal ID value in the first memory is the same as the second crystal ID value in the second memory.

[0067] Optionally, the first memory is a dynamic memory, which can be understood as: the terminal device can update the crystal ID value stored in the first memory.

[0068] It can be seen that when the temperature of the crystal in the terminal device is within the first range and the ID value of the crystal is equal to the first crystal ID value, the first frequency offset belongs to the preset frequency offset range, and the crystal can generate a stable clock signal. Therefore, the terminal device does not need to adjust the first crystal ID value, and the crystal can pass the registration.

[0069] S104. If the first frequency offset is not within the preset range, the terminal device adjusts the first crystal ID value and writes the adjusted first crystal ID value into the first memory so that the first frequency offset is within the preset range.

[0070] In an optional implementation, the terminal device can adjust the first crystal ID value by adjusting the capacitor array in the PMIC chip. In addition, the capacitor array in the PMIC chip corresponding to the first crystal ID value is different from the capacitor array in the PMIC chip corresponding to the adjusted first crystal ID value.

[0071] In an optional implementation, if the first frequency offset is not within the preset range, the terminal device adjusts the first crystal ID value, including: if the first frequency offset is not within the preset range, the first crystal ID value is adjusted according to a preset step. Optionally, the preset step is one unit.

[0072] Exemplarily, the preset range is from -8 PPM to 8 PPM. When the first frequency offset of the terminal device is greater than 8 PPM or the first frequency offset is less than -8 PPM, the first crystal ID value is adjusted according to the preset step.

[0073] It can be seen that when the first frequency offset is not within the preset range, it indicates that when the temperature of the crystal is within the first range and the ID value of the crystal is equal to the first crystal ID value, the frequency offset between the output frequency of the crystal and the center frequency of the crystal does not belong to the preset frequency offset range, which further indicates that the output frequency of the crystal is relatively large or the output frequency of the crystal is relatively small. Therefore, the terminal device adjusts the first crystal ID value, and further adjusts the first frequency offset so that the first frequency offset is within the preset range to ensure that the crystal provides a stable clock signal.

[0074] In an alternative implementation, if the first frequency offset is not within the preset range, the terminal device adjusts the first crystal ID value in accordance with a preset step, including: if the first frequency offset is greater than the maximum value of the preset range, the first crystal ID value is increased in accordance with the preset step to obtain an adjusted first crystal ID value. For example, the terminal device increases the first crystal ID value by one unit to obtain an adjusted first crystal ID value, and the difference between the adjusted first crystal ID value and the first crystal ID value is 1.

[0075] It can be seen that when the frequency offset between the output frequency of the crystal and the center frequency of the crystal is greater than the maximum value of the preset range, it indicates that the output frequency of the crystal is relatively high. The terminal device needs to increase the crystal ID value to reduce the output frequency of the crystal, thereby reducing the frequency offset of the crystal. Therefore, when the first frequency offset is greater than the maximum value of the preset range, the terminal device increases the first crystal ID value to obtain an adjusted first crystal ID value, so that the first frequency offset of the crystal can be adjusted according to the larger adjusted first crystal ID value, making the first frequency offset of the crystal within the preset frequency offset range.

[0076] In another alternative implementation, if the first frequency offset is not within the preset range, the terminal device adjusts the first crystal ID value in accordance with a preset step, including: if the first frequency offset is less than the minimum value of the preset range, the first crystal ID value is decreased in accordance with the preset step to obtain an adjusted first crystal ID value. For example, the terminal device decreases the first crystal ID value by one unit to obtain an adjusted first crystal ID value, and the difference between the first crystal ID value and the adjusted first crystal ID value is 1.

[0077] It can be seen that when the frequency offset between the output frequency of the crystal and the center frequency of the crystal is less than the minimum value of the preset range, it indicates that the output frequency of the crystal is relatively low. The terminal device needs to decrease the crystal ID value to increase the output frequency of the crystal, thereby reducing the frequency offset of the crystal. Therefore, when the first frequency offset is less than the minimum value of the preset range, the terminal device decreases the first crystal ID value to obtain an adjusted first crystal ID value, so that the first frequency offset of the crystal can be adjusted according to the smaller adjusted first crystal ID value, making the first frequency offset of the crystal within the preset frequency offset range.

[0078] Optionally, after the terminal device adjusts the first crystal ID value, it updates the crystal ID value stored in the first memory from the first crystal ID value to the adjusted first crystal ID value, which is conducive to the terminal device obtaining the adjusted first crystal ID value from the first memory, and further conducive to adjusting the frequency offset of the crystal according to the adjusted first crystal ID value.

[0079] In an alternative embodiment, the terminal device may further perform the following steps: detecting the frequency offset in the current environment to obtain an adjusted first frequency offset; if the adjusted first frequency offset is within a preset range, scheduling the adjusted first crystal ID value in the first memory to complete registration; if the adjusted first frequency offset is not within the preset range, adjusting the adjusted first crystal ID value and writing the adjusted crystal ID value into the first memory so that the adjusted first frequency offset is within the preset range.

[0080] Wherein, the adjusted first frequency offset is the frequency offset after adjusting the frequency of the crystal according to the adjusted first crystal ID value, which can be understood as: the adjusted first frequency offset is the frequency of the crystal when the temperature of the crystal is within the first range and the ID value of the crystal is equal to the adjusted first crystal ID value.

[0081] It can be seen that when the temperature of the crystal is within the first range and the ID value of the crystal is equal to the adjusted first crystal ID value, if the adjusted first frequency offset belongs to the preset frequency offset range, the crystal can generate a stable clock signal. Therefore, the terminal device does not need to adjust the adjusted first crystal ID value any more, and directly calls the adjusted first crystal ID value, which can enable the crystal to pass the registration. If the adjusted first frequency offset is not within the preset range, it indicates that when the temperature of the crystal is within the first range and the ID value of the crystal is equal to the adjusted first crystal ID value, the frequency offset between the output frequency of the crystal and the center frequency of the crystal does not belong to the preset range, which further indicates that the output frequency of the crystal is too large or the output frequency of the crystal is too small. Therefore, the terminal device continues to adjust the adjusted first crystal ID value so that the first frequency offset of the adjusted crystal is within the preset range, thereby ensuring that the crystal can provide a stable clock signal and complete the registration.

[0082] In an alternative embodiment, if the adjusted first frequency offset is not within the preset range, the terminal device adjusts the adjusted first crystal ID value, including: if the adjusted first frequency offset is not within the preset range, adjusting the adjusted first crystal ID value according to a preset step.

[0083] Optionally, if the adjusted first frequency offset is not within the preset range, the terminal device adjusts the adjusted first crystal ID value according to a preset step, including: if the adjusted first frequency offset is greater than the maximum value of the preset range, increasing the adjusted first crystal ID value according to a preset step to obtain an adjusted first crystal ID value. Among them, for the implementation manner in which the terminal device increases the adjusted first crystal ID value, reference can be made to the above-mentioned implementation manner in which the terminal device increases the first crystal ID value, and details will not be repeated.

[0084] It can be seen that when the adjusted first frequency offset is greater than the maximum value of the preset range, it indicates that the output frequency of the crystal is relatively large. The terminal device needs to increase the adjusted first crystal ID value to reduce the output frequency of the crystal, thereby reducing the frequency offset of the crystal. Therefore, the terminal device increases the adjusted first crystal ID value to obtain the adjusted first crystal ID value, so as to be able to adjust the frequency offset of the crystal according to the larger adjusted first crystal ID value, so that the frequency offset of the crystal is within the preset frequency offset range.

[0085] Optionally, if the adjusted first frequency offset is not within the preset range, the terminal device adjusts the adjusted first crystal ID value according to a preset step, including: if the adjusted first frequency offset is less than the minimum value of the preset range, the adjusted first crystal ID value is reduced according to the preset step to obtain the adjusted first crystal ID value. Among them, the implementation manner of the terminal device reducing the adjusted first crystal ID value can refer to the above-mentioned implementation manner of the terminal device reducing the first crystal ID value, and will not be elaborated here.

[0086] It can be seen that when the adjusted first frequency offset is less than the minimum value of the preset range, it indicates that the output frequency of the crystal is relatively small. The terminal device needs to reduce the adjusted first crystal ID value to increase the output frequency of the crystal, thereby reducing the frequency offset of the crystal. Therefore, the terminal device reduces the adjusted first crystal ID value to obtain the adjusted first crystal ID value, so as to be able to adjust the frequency offset of the crystal according to the smaller adjusted first crystal ID value, so that the frequency offset of the crystal is within the preset frequency offset range.

[0087] Optionally, after the terminal device adjusts the adjusted first crystal ID value, it updates the crystal ID value stored in the first memory to the adjusted first crystal ID value, which is beneficial for the terminal device to obtain the adjusted first crystal ID value from the first memory, and further beneficial for the terminal device to adjust the frequency offset of the crystal according to the adjusted first crystal ID value.

[0088] It can be seen that when the temperature of the crystal in the terminal device is within the first range and the first frequency offset is within the preset range, the first crystal ID value is called to complete the registration. When the temperature of the crystal in the terminal device is within the first range and the first frequency offset is not within the preset range, the first frequency offset is made within the preset range by adjusting the first crystal ID value, and then the registration is completed. Therefore, this method can realize the registration of the crystal when the temperature of the crystal belongs to the first range.

[0089] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of another calibration method provided by the embodiment of the present application. This method includes but is not limited to:

[0090] S201. The calibration device adjusts the capacitor array of the PMIC chip to obtain the TSX ID value.

[0091] Among them, after the software version is downloaded on the terminal device, the calibration device adjusts the capacitor array of the PMIC chip.

[0092] Among them, when the calibration device adjusts the capacitor array of the PMIC chip so that the frequency deviation of the crystal belongs to the range of -5PPM to 5PPM, the crystal ID value corresponding to the capacitance value of the capacitor array in the PMIC chip is obtained. The crystal ID value at this time is the TSX ID value.

[0093] S202. The calibration device writes the obtained TSX ID value into NV#1 of the terminal device.

[0094] Among them, NV#1 is a non-volatile memory.

[0095] S203. The terminal device detects the temperature of the TSX crystal.

[0096] Among them, for the relevant content of S203, refer to the relevant description of S101 above, and it will not be elaborated here.

[0097] S204. The terminal device determines whether the temperature of the TSX crystal is greater than 45°C or less than 15°C.

[0098] In the case where the temperature of the TSX crystal is greater than 45°C or less than 15°C, S207 is executed; in the case where the temperature of the TSX crystal is less than or equal to 45°C or greater than or equal to 15°C, S205 is executed.

[0099] S205. The terminal device calls the TSX ID value in NV#1.

[0100] Among them, for the relevant content of S205, refer to the relevant description of S102 above, and it will not be elaborated here.

[0101] S206. The terminal device can complete the registration of the crystal.

[0102] Among them, for the relevant content of S206, refer to the relevant description of S102 above, and it will not be elaborated here.

[0103] S207. The terminal device calls the TSX ID value in NV#2.

[0104] Among them, NV#2 is a non-volatile memory. The initial value of the TSX ID value in NV#2 is the same as the TSX ID value in NV#1.

[0105] S208. The terminal device determines whether the frequency deviation of the crystal is greater than -X and less than X.

[0106] Among them, X can be any positive integer less than or equal to 10.

[0107] When the frequency deviation of the crystal is greater than -X and less than X, S209 is executed; when the frequency deviation of the crystal is less than or equal to -X or greater than or equal to X, S2011 is executed.

[0108] S209. The terminal device calls the TSX ID value in NV#2.

[0109] Among them, the relevant content of S209 can be referred to the relevant description of the calibration method S103 shown above. Figure 1 shown in the calibration method S103.

[0110] S2010. The terminal device can enable the crystal to complete registration.

[0111] Among them, the relevant content of S2010 can be referred to the relevant description of the calibration method S103 shown above. Figure 1 shown in the calibration method S103.

[0112] S2011. The terminal device determines whether the frequency deviation of the crystal is greater than or equal to X.

[0113] When the frequency deviation of the crystal is greater than or equal to X, S2013 is executed; when the frequency deviation of the crystal is less than or equal to -X, S2012 is executed.

[0114] S2012. The terminal device subtracts 1 from the TSX ID value.

[0115] After the terminal device executes S2012, S2014 is executed.

[0116] S2013. The terminal device adds 1 to the TSX ID value.

[0117] After the terminal device executes S2013, S2014 is executed.

[0118] S2014. The terminal device writes the modified TSX ID value into NV#2.

[0119] After the terminal device executes S2014, S204 is executed.

[0120] It can be seen that the terminal device adjusts the soft parameter (i.e., the TSX ID value in NV) according to the temperature of the crystal and the frequency deviation of the crystal at this temperature, and then adjusts the frequency deviation of the crystal. It does not require field calibration, which can reduce the registration complexity of the crystal when the temperature of the crystal belongs to the preset temperature range.

[0121] In addition, the trace length of the crystal affects the capacitance value of the capacitor array in the PMIC chip. In the embodiment of the present application, the frequency deviation of the crystal is adjusted by adjusting the crystal ID value corresponding to the capacitance value of the capacitor array. This method does not have strict requirements on the trace length of the crystal, and can reduce the modification of the printed circuit board caused by non-standard crystal traces.

[0122] Please refer to Figure 3 , Figure 3 , which is a schematic structural diagram of a calibration device provided by an embodiment of the present application. The calibration device at least includes a judgment module 301, a detection module 302, a call module 303, and an adjustment module 304, where:

[0123] The judgment module 301 is used to judge whether the current crystal temperature is within a first range;

[0124] The detection module 302 is used to detect a first frequency offset in the current environment if the crystal temperature is within the first range;

[0125] The call module 303 is used to call a first crystal identity identifier ID value in a first memory to complete registration if the first frequency offset is within a preset range; wherein, the first memory is a dynamic memory;

[0126] The adjustment module 304 is used to adjust the first crystal ID value if the first frequency offset is not within the preset range, and write the adjusted first crystal ID value into the first memory so that the first frequency offset is within the preset range.

[0127] In an optional implementation manner, if the crystal temperature is not within the first range, the call module 303 calls a second crystal ID value in a second memory to complete registration.

[0128] In an optional implementation manner, if the first frequency offset is not within the preset range, the adjustment module 304 adjusts the first crystal ID value, specifically: if the first frequency offset is not within the preset range, the first crystal ID value is adjusted according to a preset step.

[0129] In an optional implementation manner, if the first frequency offset is not within the preset range, the adjustment module 304 adjusts the first crystal ID value according to a preset step, specifically: if the first frequency offset is greater than the maximum value of the preset range, the first crystal ID value is increased according to a preset step to obtain an adjusted first crystal ID value; if the first frequency offset is less than the minimum value of the preset range, the first crystal ID value is decreased according to a preset step to obtain an adjusted first crystal ID value.

[0130] In an optional implementation manner, the detection module 302 detects a frequency offset in the current environment to obtain an adjusted first frequency offset; if the adjusted first frequency offset is within the preset range, the call module 303 schedules the adjusted first crystal ID value in the first memory to complete registration; if the adjusted first frequency offset is not within the preset range, the adjustment module 304 adjusts the adjusted first crystal ID value and writes the adjusted crystal ID value into the first memory so that the adjusted first frequency offset is within the preset range.

[0131] In an alternative embodiment, the initial value of the first crystal ID value in the first memory is the same as the second crystal ID value in the second memory. The adjustment module 304 adjusts the output frequency of the crystal by switching the capacitor array in the power management integrated circuit chip to obtain the second crystal ID value. The calibration device further includes a writing module for writing the second crystal ID value into the second memory.

[0132] The embodiments of the present application and the above-described method embodiments are based on the same concept and have the same technical effects. For the specific principle, please refer to the description of the above-described embodiments and will not be elaborated here.

[0133] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of a communication device provided by an embodiment of the present application. The communication device can perform the relevant steps of the terminal device in the foregoing method embodiment. The communication device includes: a communication module 401, a power module 402, a storage module 403, and a chip 404.

[0134] Among them, the power module 402 is used to supply electrical energy to the communication device; the storage module 403 is used to store data and instructions; the communication module 401 is used for internal communication of the communication device or for communication between the communication device and an external device; the chip 404 is used to execute the method performed by the terminal device in the above method embodiment.

[0135] The implementation manner of the communication device can refer to the relevant content of the above method embodiment and will not be elaborated here.

[0136] The embodiments of the present application and the above method embodiments are based on the same concept and have the same technical effects. For the specific principle, please refer to the description of the above method embodiments and will not be elaborated here.

[0137] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device at least includes a processor 501, a memory 503, and a user interface 502. The processor 501, the memory 503, and the user interface 502 are interconnected. Among them, the memory 503 is used to store a computer program, and the computer program includes program instructions. The processor 501 is used to execute the program instructions.

[0138] The memory 503 may include a volatile memory, such as a random-access memory (RAM); the memory 503 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the memory 503 may further include a combination of the above types of memories.

[0139] The processor 501 may be a central processing unit (CPU). The processor 501 may further include a hardware chip. The above hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), etc. The above PLD may be a field-programmable gate array (FPGA), a generic array logic (GAL), etc.

[0140] In an alternative embodiment, the memory 503 is further configured to store program instructions. The processor 501 may call the program instructions: the processor 501 is configured to call the program instructions to perform the following steps:

[0141] Determine whether the current crystal temperature is within a first range;

[0142] If the crystal temperature is within the first range, then detect a first frequency offset in the current environment;

[0143] If the first frequency offset is within a preset range, then call a first crystal identity identification ID value in a first memory to complete registration; wherein, the first memory is a dynamic memory;

[0144] If the first frequency offset is not within the preset range, then adjust the first crystal ID value and write the adjusted first crystal ID value into the first memory so that the first frequency offset is within the preset range.

[0145] Optionally, the processor 501 further performs the following steps: if the crystal temperature is not within the first range, then call a second crystal ID value in a second memory to complete registration.

[0146] Optionally, if the first frequency offset is not within the preset range, the processor 501 adjusts the first crystal ID value, specifically: if the first frequency offset is not within the preset range, the first crystal ID value is adjusted in accordance with a preset step size.

[0147] Optionally, if the first frequency offset is not within the preset range, the processor 501 adjusts the first crystal ID value in accordance with a preset step size, specifically: if the first frequency offset is greater than the maximum value of the preset range, the first crystal ID value is increased in accordance with a preset step size to obtain an adjusted first crystal ID value; if the first frequency offset is less than the minimum value of the preset range, the first crystal ID value is decreased in accordance with a preset step size to obtain an adjusted first crystal ID value.

[0148] Optionally, the processor 501 further performs the following steps: detecting the frequency offset in the current environment to obtain an adjusted first frequency offset; if the adjusted first frequency offset is within the preset range, scheduling the adjusted first crystal ID value in the first memory to complete registration; if the adjusted first frequency offset is not within the preset range, adjusting the adjusted first crystal ID value and writing the adjusted crystal ID value into the first memory so that the adjusted first frequency offset is within the preset range.

[0149] Optionally, the initial value of the first crystal ID value in the first memory is the same as the second crystal ID value in the second memory. The processor 501 may further perform the following steps: adjusting the output frequency of the crystal by switching the capacitor array in the power management integrated circuit chip to obtain a second crystal ID value; writing the second crystal ID value into the second memory.

[0150] The embodiments of the present application and the above-described method embodiments are based on the same concept, and the technical effects brought by them are also the same. For the specific principle, please refer to the description of the above-described embodiments and will not be elaborated here.

[0151] The present application further provides a computer-readable storage medium, on which a detection program is stored. When the detection program is executed by a processor, the steps of a calibration method in any of the above embodiments are implemented.

[0152] In the embodiments of the mobile terminal and the computer-readable storage medium provided by the present application, all the technical features of each embodiment of the above calibration method are included. The expansion and explanation content of the specification is basically the same as that of each embodiment of the above method and will not be elaborated here.

[0153] The embodiments of the present application further provide a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer is caused to execute the methods in various possible implementation manners as described above.

[0154] An embodiment of the present application further provides a chip, including a memory and a processor. The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a device installed with the chip executes the methods in the above various possible embodiments.

[0155] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments.

[0156] The steps in the method of the embodiment of the present application can be adjusted, combined, and deleted according to actual needs.

[0157] The units in the device of the embodiment of the present application can be combined, divided, and deleted according to actual needs.

[0158] In the present application, for the description of the same or similar term concepts, technical solutions, and / or application scenarios, generally only the first occurrence is described in detail. When it appears repeatedly later, for the sake of brevity, it is generally not described again. When understanding the technical solutions and other contents of the present application, for the same or similar term concepts, technical solutions, and / or application scenarios that are not described in detail later, reference can be made to the relevant detailed descriptions before.

[0159] In the present application, the descriptions of the various embodiments each have their own emphases. For the parts not described or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0160] The technical features of the technical solutions of the present application can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combinations of these technical features do not conflict, they should be considered as the scope recorded in the present application.

[0161] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the essence of the technical solution of the present application or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium as above (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of the present application.

[0162] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more integrated available media. The available media can be magnetic media (such as floppy disks, storage disks, magnetic tapes), optical media (such as DVDs), or semiconductor media (such as Solid State Disk (SSD)), etc.

[0163] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structural or equivalent process transformations made by using the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are equally included in the patent protection scope of the present application.

Claims

1. A calibration method, characterized in that, The method includes: Determine whether the current crystal temperature is within a first range; If the crystal temperature is within the first range, detect a first frequency offset in the current environment; If the first frequency offset is within a preset range, call the first crystal identity identification ID value in the first memory to complete registration; wherein, the first memory is a dynamic memory; If the first frequency offset is not within the preset range, adjust the first crystal ID value and write the adjusted first crystal ID value into the first memory so that the first frequency offset is within the preset range.

2. The method according to claim 1, characterized in that The method further includes: If the crystal temperature is not within the first range, call the second crystal ID value in the second memory to complete registration.

3. The method according to claim 1, characterized in that, The step of, if the first frequency offset is not within the preset range, adjusting the first crystal ID value includes: If the first frequency offset is not within the preset range, adjust the first crystal ID value in accordance with a preset step.

4. The method according to claim 3, characterized in that, The step of, if the first frequency offset is not within the preset range, adjusting the first crystal ID value in accordance with a preset step includes: If the first frequency offset is greater than the maximum value of the preset range, increase the first crystal ID value in accordance with a preset step to obtain the adjusted first crystal ID value; If the first frequency offset is less than the minimum value of the preset range, decrease the first crystal ID value in accordance with a preset step to obtain the adjusted first crystal ID value.

5. The method according to claim 4, wherein The method further includes: Detect the frequency offset in the current environment to obtain the adjusted first frequency offset; If the adjusted first frequency offset is within the preset range, schedule the adjusted first crystal ID value in the first memory to complete registration; If the adjusted first frequency offset is not within the preset range, adjust the adjusted first crystal ID value and write the adjusted crystal ID value into the first memory so that the adjusted first frequency offset is within the preset range.

6. The method according to claim 2, characterized in that The initial value of the first crystal ID value in the first memory is the same as the second crystal ID value in the second memory. The method further includes: Adjust the output frequency of the crystal by switching the capacitor array in the power management integrated circuit chip to obtain the second crystal ID value; Write the second crystal ID value into the second memory.

7. A communication device, characterized in that, The communication device includes a communication module, a power module, a storage module, and a chip, wherein: The power module is used to supply electrical energy to the communication device; The storage module is used to store data and instructions; The communication module is used for internal communication of the communication device or for communication between the communication device and an external device; The chip is used to execute the method according to any one of claims 1 to 6.

8. A computer device, characterized in that, The computer device includes: a memory, a processor, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions that, when run on the calibration device, cause the calibration device to perform the method according to any one of claims 1 to 6.

10. A computer program product comprising instructions, characterized in that, When the instructions are run on the communication device, the method according to any one of claims 1 to 6 is implemented.