CN111819787A - Crystal calibration method, chip and Bluetooth headset - Google Patents

Crystal calibration method, chip and Bluetooth headset Download PDF

Info

Publication number
CN111819787A
CN111819787A CN202080001624.9A CN202080001624A CN111819787A CN 111819787 A CN111819787 A CN 111819787A CN 202080001624 A CN202080001624 A CN 202080001624A CN 111819787 A CN111819787 A CN 111819787A
Authority
CN
China
Prior art keywords
pulse signal
parameter
count difference
difference
chip
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202080001624.9A
Other languages
Chinese (zh)
Other versions
CN111819787B (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.)
Shenzhen Goodix Technology Co Ltd
Original Assignee
Shenzhen Goodix 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 Shenzhen Goodix Technology Co Ltd filed Critical Shenzhen Goodix Technology Co Ltd
Publication of CN111819787A publication Critical patent/CN111819787A/en
Application granted granted Critical
Publication of CN111819787B publication Critical patent/CN111819787B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03BGENERATION OF OSCILLATIONS, DIRECTLY OR BY FREQUENCY-CHANGING, BY CIRCUITS EMPLOYING ACTIVE ELEMENTS WHICH OPERATE IN A NON-SWITCHING MANNER; GENERATION OF NOISE BY SUCH CIRCUITS
    • H03B5/00Generation of oscillations using amplifier with regenerative feedback from output to input
    • H03B5/02Details
    • H03B5/04Modifications of generator to compensate for variations in physical values, e.g. power supply, load, temperature
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones

Abstract

A method, a chip and a Bluetooth headset for crystal calibration are provided. The method comprises the following steps: obtaining a count difference of at least one pulse signal, the at least one pulse signal including a pulse signal generated by the crystal based on at least one parameter of a plurality of parameters, the count difference of each pulse signal of the at least one pulse signal being a difference between system tick count values based on the corresponding pulse signal obtained using two external interrupts triggered by a reference pulse signal; determining a target parameter based on the count difference of the at least one pulse signal; and determining the pulse signal generated based on the target parameter as the pulse signal after crystal calibration. The target parameter is determined through the counting difference value of the at least one pulse signal, so that the automatic calibration of the pulse signals can be realized, the labor cost is reduced, and the calibration efficiency is improved while the complexity of a calibration mechanism is reduced.

Description

Crystal calibration method, chip and Bluetooth headset
Technical Field
The embodiment of the application relates to the field of electronics, and more particularly relates to a crystal calibration method, a chip and a Bluetooth headset.
Background
When the single chip microcomputer operates, a pulse signal is needed to be used as a trigger signal for executing an instruction by the single chip microcomputer. Usually, the pulse signal is generated by matching a crystal externally connected with an application circuit of the singlechip and an external capacitor connected with the crystal. The crystal has a nominal load capacitance value, and the frequency of the pulse signal generated by the crystal is the most accurate when the load capacitance value is close to or equal to the true capacitance value of the external capacitor.
However, the material parameters of the same batch are not completely consistent, and the fluctuation of the material parameters can cause the product parameters such as the capacitance values of the load capacitors of the same batch of crystals produced by the same manufacturer and the capacitance values of the external capacitors of the same batch produced by the same manufacturer to change within a certain range, so that the frequency of the pulse signals generated by the crystals is not accurate enough.
Disclosure of Invention
The crystal calibration method, the chip and the Bluetooth headset are provided, and automatic calibration of the crystal can be realized.
In a first aspect, a method for crystal calibration is provided, which is suitable for a chip having a crystal, and the method includes:
obtaining a count difference of at least one pulse signal, the at least one pulse signal including a pulse signal generated by the crystal based on at least one parameter of a plurality of parameters, the count difference of each pulse signal of the at least one pulse signal being a difference between system tick count values based on the corresponding pulse signal obtained using two external interrupts triggered by a reference pulse signal;
determining a target parameter based on the count difference of the at least one pulse signal;
and determining the pulse signal generated based on the target parameter as the pulse signal after crystal calibration.
The target parameter is determined through the counting difference value of the at least one pulse signal, so that the automatic calibration of the pulse signals can be realized, the labor cost is reduced, and the calibration efficiency is improved while the complexity of a calibration mechanism is reduced.
In some possible implementations, the obtaining a count difference of the at least one pulse signal includes:
and acquiring a counting difference value of the at least one pulse signal by utilizing a dichotomy.
The counting difference value of at least one pulse signal is obtained through the binary differentiation, so that the counting difference values of all the pulse signals are avoided being obtained, the total quantity of the counting difference values needing to be obtained is reduced, the calibration accuracy is ensured, the calibration efficiency is improved, and the time cost is reduced.
In some possible implementations, the obtaining the count difference of the at least one pulse signal by using bisection includes:
determining a minimum parameter and a maximum parameter of a plurality of parameters;
generating a first pulse signal and a second pulse signal based on the minimum parameter and the maximum parameter, respectively;
respectively acquiring a first counting difference value of the first pulse signal and a second counting difference value of the second pulse signal;
wherein determining a target parameter based on the count difference of the at least one pulse signal comprises:
determining the target parameter based on the first count difference and the second count difference.
In some possible implementations, the determining the target parameter based on the first count difference and the second count difference includes:
determining the average value of the minimum parameter and the maximum parameter as the target parameter when the average value of the first count difference and the second count difference is equal to a preset count difference.
In some possible implementations, the determining the target parameter based on the first count difference and the second count difference includes:
determining the average value of the minimum parameter and the maximum parameter plus 1 as a first parameter when the average value of the first count difference and the second count difference is greater than the preset count difference;
generating a third pulse signal based on the first parameter;
acquiring a third count difference value of the third pulse signal;
determining the target parameter based on the third count difference and the second count difference.
In some possible implementations, the determining the target parameter based on the first count difference and the second count difference includes:
when the average value of the first counting difference value and the second counting difference value is smaller than the preset counting difference value, subtracting one from the average value of the minimum parameter and the maximum parameter to determine the average value as a second parameter;
generating a fourth pulse signal based on the second parameter;
acquiring a fourth count difference value of the fourth pulse signal;
determining the target parameter based on the fourth count difference and the first count difference.
In some possible implementations, the obtaining a count difference of the at least one pulse signal includes:
acquiring a plurality of pulse signals respectively generated by the crystal based on the parameters;
acquiring a plurality of counting difference values corresponding to the plurality of pulse signals;
wherein the determining a target parameter based on the count difference of the at least one pulse signal comprises:
obtaining a target counting difference value which is closest to a preset counting difference value in the plurality of counting difference values by utilizing a bisection method;
and determining the parameter corresponding to the target counting difference as the target parameter.
The target counting difference value is obtained through the bisection method, the traversing comparison between the preset counting difference value and the counting difference value of each pulse signal is avoided, the calculated amount of a chip is reduced, the calibration efficiency is improved, and the time cost is reduced.
In some possible implementations, the method further includes:
the plurality of count differences are sorted in ascending or descending order.
In some possible implementations, the parameter values of the plurality of parameters decrease as the frequency of the pulse signal increases.
By defining the characteristics of the parameters, the obtained difference counts can be automatically sequenced from large to small or from small to large, the step of re-sequencing the plurality of count differences after obtaining the plurality of count differences is avoided, and the time cost of calibrating the pulse signal is effectively reduced on the basis of obtaining the target parameters or the target count differences through the dichotomy.
In some possible implementations, the parameter values of the plurality of parameters are inversely proportional to the frequency of the pulse signal.
In some possible implementations, the obtaining a count difference of the at least one pulse signal includes:
and sequentially acquiring the counting difference value of at least one pulse signal according to the ascending or descending order of the parameter values.
In some possible implementations, the method further includes:
and receiving a calibration signaling sent by the test equipment by using a Universal Serial Bus (USB) to serial port and a universal asynchronous receiving and transmitting transmitter (UART) HUB, wherein the calibration signaling is used for triggering the chip to carry out crystal calibration.
In some possible implementations, the calibration signaling includes the plurality of parameters.
In some possible implementations, the method further includes:
storing the plurality of parameters to a register to send the plurality of parameters to the crystal by controlling the register.
The register triggers the crystal to generate the pulse signal to be calibrated, namely, the register is responsible for and controls the crystal to generate the operation of the signal to be calibrated, so that the workload of the chip is reduced, and the working efficiency of the chip for performing pulse signal calibration is effectively improved.
In some possible implementations, the method further includes:
storing a calibration result to the register, the calibration result indicating the target parameter.
In some possible implementations, the method further includes:
and sending a calibration result and/or a counting difference value of the at least one pulse signal to the test equipment by utilizing a Universal Serial Bus (USB) to serial port and a universal asynchronous receiver-transmitter (UART) HUB (HUB), wherein the calibration result is used for indicating the target parameter, and the counting difference value of the at least one pulse signal is used for comparing the test equipment with a preset counting difference value on a display interface.
By sending the counting difference value of the at least one pulse signal to the test equipment, a user can observe the corresponding relation between each counting difference value in the counting difference values of the at least one pulse signal and the preset counting difference value on a display interface of the test equipment, so that the user can conveniently and manually adjust the target counting difference value, and a calibration mechanism of automatic calibration and manual calibration is realized. Similarly, by sending the calibration result to the testing equipment, the designer can conveniently carry out batch calibration and adjust parameter design.
In some possible implementations, the obtaining a count difference of the at least one pulse signal includes:
acquiring a plurality of counting differences of each pulse signal in the at least one pulse signal;
determining at least one count difference value later in time of the plurality of count difference values of each of the at least one pulse signal as the count difference value of the corresponding pulse signal.
Therefore, the counting difference value corresponding to each pulse signal can be accurately acquired, and accordingly, the calibration precision of the pulse signals can be improved. In other words, by testing each pulse signal in the at least one pulse signal and then acquiring the count difference corresponding to each pulse signal, the inaccuracy of the measured count difference of the pulse signal under the condition of system instability or crystal instability can be avoided, and the accuracy of the count difference and the calibration precision of the pulse signal can be improved.
In some possible implementations, the method further includes:
receiving the reference pulse signal generated with the calibrated application system.
The calibrated chip is triggered by an application system to generate the reference pulse signal, so that the structure of the chip can be simplified and the hardware cost can be reduced on the basis of acquiring the reference pulse signal.
In some possible implementations, the reference pulse signal is a pulse width modulated PWM signal.
In some possible implementations, the chip is a Bluetooth Low Energy (BLE) chip.
In a second aspect, a chip is provided, the chip comprising:
a crystal for generating at least one pulse signal based on at least one of a plurality of parameters;
a processing unit coupled to the crystal, the processing unit to:
acquiring a count difference value of each pulse signal in the at least one pulse signal, wherein the count difference value of each pulse signal in the at least one pulse signal is a difference value between system tick count values acquired by two external interrupts triggered by a reference pulse signal and based on the corresponding pulse signal;
determining a target parameter based on the count difference of the at least one pulse signal;
and determining the pulse signal generated based on the target parameter as the pulse signal after crystal calibration.
In some possible implementation manners, the processing unit is specifically configured to:
and acquiring a counting difference value of the at least one pulse signal by utilizing a dichotomy.
In some possible implementations, the processing unit is more specifically configured to:
determining a minimum parameter and a maximum parameter of a plurality of parameters;
generating a first pulse signal and a second pulse signal based on the minimum parameter and the maximum parameter, respectively;
respectively acquiring a first counting difference value of the first pulse signal and a second counting difference value of the second pulse signal;
determining the target parameter based on the first count difference and the second count difference.
In some possible implementations, the processing unit is more specifically configured to:
determining the average value of the minimum parameter and the maximum parameter as the target parameter when the average value of the first count difference and the second count difference is equal to a preset count difference.
In some possible implementations, the processing unit is more specifically configured to:
determining the average value of the minimum parameter and the maximum parameter plus 1 as a first parameter when the average value of the first count difference and the second count difference is greater than the preset count difference;
generating a third pulse signal based on the first parameter;
acquiring a third count difference value of the third pulse signal;
determining the target parameter based on the third count difference and the second count difference.
In some possible implementations, the processing unit is more specifically configured to:
when the average value of the first counting difference value and the second counting difference value is smaller than the preset counting difference value, subtracting one from the average value of the minimum parameter and the maximum parameter to determine the average value as a second parameter;
generating a fourth pulse signal based on the second parameter;
acquiring a fourth count difference value of the fourth pulse signal;
determining the target parameter based on the fourth count difference and the first count difference.
In some possible implementation manners, the processing unit is specifically configured to:
acquiring a plurality of pulse signals respectively generated by the crystal based on the parameters;
acquiring a plurality of counting difference values corresponding to the plurality of pulse signals;
obtaining a target counting difference value which is closest to a preset counting difference value in the plurality of counting difference values by utilizing a bisection method;
and determining the parameter corresponding to the target counting difference as the target parameter.
In some possible implementations, the processing unit is further configured to:
the plurality of count differences are sorted in ascending or descending order.
In some possible implementations, the parameter values of the plurality of parameters decrease as the frequency of the pulse signal increases.
In some possible implementations, the parameter values of the plurality of parameters are inversely proportional to the frequency of the pulse signal.
In some possible implementation manners, the processing unit is specifically configured to:
and sequentially acquiring the counting difference value of at least one pulse signal according to the ascending or descending order of the parameter values.
In some possible implementations, the chip further includes:
USB changes serial ports and universal asynchronous receiving and dispatching transmitter UART concentrator HUB, USB changes the serial ports and passes through UART HUB is connected to processing unit, processing unit passes through USB changes the serial ports with UARTHUB receives the calibration signaling that test equipment sent, calibration signaling is used for triggering the chip carries out the crystal calibration.
In some possible implementations, the calibration signaling includes the plurality of parameters.
In some possible implementations, the chip further includes:
a register through which the processing unit is connected to the crystal, the processing unit to store the plurality of parameters to the register so as to send the plurality of parameters to the crystal by controlling the register.
In some possible implementations, the processing unit is further configured to store a calibration result to the register, the calibration result indicating the target parameter.
In some possible implementations, the chip further includes:
USB changes serial ports and universal asynchronous transceiver UART concentrator HUB to universal serial bus USB, USB changes the serial ports and passes through UART HUB is connected to processing unit, processing unit passes through USB changes the serial ports with UARTHUB sends calibration result and/or at least one pulse signal's count difference to test equipment, the calibration result is used for instructing target parameter, at least one pulse signal's count difference is used for test equipment shows the interface and predetermines the count difference and compare.
In some possible implementation manners, the processing unit is specifically configured to:
acquiring a plurality of counting differences of each pulse signal in the at least one pulse signal;
determining at least one count difference value later in time of the plurality of count difference values of each of the at least one pulse signal as the count difference value of the corresponding pulse signal.
In some possible implementation manners, the processing unit is specifically configured to:
receiving the reference pulse signal generated with the calibrated application system.
In some possible implementations, the reference pulse signal is a pulse width modulated PWM signal.
In some possible implementations, the chip is a Bluetooth Low Energy (BLE) chip.
In a third aspect, a bluetooth headset is provided, comprising:
the chip described in the second aspect or any possible implementation manner of the second aspect.
Drawings
FIG. 1 is a schematic diagram of a system architecture of an embodiment of the present application.
FIG. 2 is a schematic flow chart diagram of a method of crystal calibration of an embodiment of the present application.
FIG. 3 is another schematic flow chart diagram of a method of crystal calibration according to an embodiment of the present application.
Fig. 4 is a schematic block diagram of a chip of an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
The method involved in the embodiments of the present application can be applied to various crystals (also called resonators) and also to various chips or electronic devices having crystals. For example, a crystal element of an IC constituting an oscillation circuit is added inside the package. The method can also be applied to crystal oscillators (also known as oscillators). The crystal may also be referred to as a passive crystal oscillator, which may also be referred to as an active crystal oscillator. For example, a crystal oscillator may be understood as a combination of the capacitance of the crystal and the crystal to which it is connected.
For another example, the Chip may be a Single-Chip Microcomputer (scm) or an integrated circuit Chip. For example, the chip may be a small and perfect microcomputer system formed by integrating a Central Processing Unit (CPU), a Random Access Memory (RAM), a Read Only Memory (ROM), various I/O ports and interrupt systems, and functions such as a timer/counter (which may further include a display driving circuit, a pulse width modulation circuit, an analog multiplexer, an a/D converter, and the like) on a silicon chip by using a very large scale integrated circuit technology.
Wherein the crystal can generate the pulse signal through the cooperation of a capacitor connected with the crystal. In this embodiment, the capacitor connected to the crystal can be integrated inside the chip and the capacitance value can be made configurable. For example, the capacitance value is configured to have a plurality of parameters representing the capacitance value, so that the crystal in the chip can generate a plurality of pulse signals based on the plurality of parameters, respectively. For example, a crystal in the chip may generate pulse signals at a plurality of frequencies based on the configured plurality of parameters, respectively. At this time, the user can adjust the frequency of the pulse signal by modifying the magnitude of the capacitance value (i.e., modifying the parameter of the configuration). Due to the problem of consistency of components in each circuit, each product needs to be separately provided with an optimal capacitance value before being put into use, so that the frequency of the pulse signal meets the application requirement. The crystal calibration involved in the embodiments of the present application may refer to the process of acquiring this optimal capacitance value (or optimal parameter) before the chip is put into use. Of course, the crystal calibration described above may include post-repair calibration or testing to determine whether the product performs or operates its function in accordance with the original product specifications.
Fig. 1 is a schematic block diagram of a system architecture of an embodiment of the present application.
As shown in FIG. 1, the system architecture 100 may include a test device 110, an intermediate device or system 120, and a chip 130. The test device 110 may be responsible for starting or triggering the whole calibration process, for example, sending parameters for generating a pulse signal to the intermediate device or system 120, so that the intermediate device or system forwards the parameters to the chip 130. The test equipment 110 may also be used to display calibration results. The intermediate device or system 120 may also be used to generate a reference pulse signal. The chip 130 may compare based on a reference pulse signal generated by the intermediate device or system 120 and a pulse signal to be calibrated generated by a crystal in the chip 130 to determine a calibration result. The chip 130 may also send the calibration result to the testing device 110 through the intermediate device or system 120, so that the testing device 110 displays the calibration result.
The test equipment 110 may also be referred to as a calibration tool or test platform. For example, the test device may be a Personal Computer or a Personal Computer (PC). Such as conventional desktop computers, DIY computers, notebook computers, and tablet computers, all-in-one computers, ultrabooks, palmtop computers, embedded computers, etc., which have become popular in recent years.
In some embodiments of the present application, the test equipment 110 may include a Universal Asynchronous Receiver/Transmitter (UART) 111. The UART111 converts information or data to be transmitted between serial communication and parallel communication. For example, the UART111 may be integrated into the communication interface link of the testing device 110 as a chip that converts a parallel input signal into a serial output signal. The test device 110 may send a reference pulse signal trigger command to the intermediate device or system 120 through the UART111, where the reference pulse signal trigger command is used to trigger the intermediate device or system 120 to generate at least one reference pulse signal. For example, the reference pulse signal trigger command is used to trigger the intermediate device or system 120 to generate a reference pulse signal.
The intermediate device or system 120 may be a physical device independent of the test device 110 and the chip 130, or may be a device or an application integrated on the test device 110 or the chip.
In some embodiments of the present application, the intermediate device or system 120 may further include an application system 121 for generating a reference pulse signal. For example, the application 121 may generate a 16-way reference pulse signal. For example, the reference pulse signal may be a clock signal (CLK), i.e., CLK … CLK 16. Optionally, the intermediate device or system 120 may include a Universal Serial Bus (USB) to Serial port 122, which is used to convert a USB interface of the testing device 110 into a Universal Serial port, so as to quickly receive information or data sent by the testing device 110. For example, the USB to serial port 122 may convert one serial port into 4 serial ports. Optionally, the test equipment may further include a Universal Asynchronous Receiver/transmitter hub (uartchub) 123, and the uartchub 123 may be configured to split the received signal into multiple serial ports. For example, the UARTHUB 123 may be used to convert the received 4-way serial port translation layer 16-way serial port. I.e. the uartchub 123 may be connected to the UART1 … UART 16 serial port. For example, the intermediate device or system 120 may broadcast information to be transmitted to the chip 130 through the UART1 … UART 16 serial port.
The serial port may also be referred to as a serial interface, a serial communication interface, or a serial communication interface (e.g., a COM interface), and is an extended interface using a serial communication method. Serial Interface (Serial Interface) transmits data bit by bit sequentially, and has simple communication line and bidirectional communication (telephone line can be directly used as transmission line).
The chip 130 may be referred to as a Device Under Test (DUT), which is also referred to as a Device Under Test (EUT) and a Unit Under Test (UUT). The device under test may be an article of manufacture that is tested at first manufacture or later in its lifecycle. The chip 130 may be any type of chip including a crystal or a crystal oscillator. For example, the chip 130 may be a Bluetooth Low Energy (BLE) chip, and the BLE chip may also be referred to as a Bluetooth Low Energy (bt) chip.
In some embodiments of the present application, the chip 130 may include a crystal 131, and the crystal 131 is used to generate a pulse signal so that the chip 130 can operate normally. Optionally, the chip 130 may further include a processing unit 132, which may be used to perform a crystal calibration process, i.e., determine whether the pulse signal to be calibrated can reach a desired frequency, or compare the pulse signal to be calibrated with a reference pulse signal. Optionally, the chip 130 may further include a register 133, where the register 133 is configured to store parameters for generating the pulse signal. During the calibration process, the processing unit 132 may send the parameters to be calibrated to the crystal by controlling the register 133, so that the crystal generates a corresponding pulse signal.
It should be noted that, in the framework of fig. 1, the intermediate device or system 120 may generate 16 reference signals (i.e., CLK1 … CLK16) at the same time, and the intermediate device or system 120 may also transmit information or data through a 16 serial port (i.e., UART1 … UART 16 serial port). In other words, the frame 100 shown in fig. 1 may be used to calibrate 16 chips simultaneously, where the chip 130 may be one of the 16 chips. Certainly, in actual operation, one or more chips may be calibrated according to requirements, and a reference pulse signal (or UART serial port) smaller than 16 or larger than 16 may also be set.
Fig. 2 is a schematic flow chart diagram of a method 200 of crystal calibration per se embodiment. The method 200 is applicable to the crystal 131 or the chip 130 shown in fig. 1 and also to the system frame 100, and for the sake of understanding, the method 200 will be described below by taking the execution subject as the chip. Such as a Bluetooth Low Energy (BLE) chip.
As shown in fig. 2, the method 200 may include:
s210, obtaining a counting difference value of at least one pulse signal, wherein the at least one pulse signal comprises a pulse signal generated by the crystal based on at least one parameter in a plurality of parameters, and the counting difference value of each pulse signal in the at least one pulse signal is a difference value between system tick count values obtained by two external interrupts triggered by a reference pulse signal and based on the corresponding pulse signal.
S220, determining a target parameter based on the counting difference of the at least one pulse signal.
And S230, determining the pulse signal generated based on the target parameter as the pulse signal after crystal calibration.
In short, after the crystal in the chip generates at least one pulse signal based on the acquired at least one parameter, the processing unit of the chip may determine a count difference of the at least one pulse signal by comparing the at least one pulse signal with a reference pulse signal (that is, each pulse signal in the at least one pulse signal is a clock signal, two count values output by the system tick counter are acquired through two external interrupts triggered by the reference pulse signal, and a difference between the two count values is taken as a count difference of the same pulse signal), and then determine a calibration result (that is, the target parameter) based on the count difference of the at least one pulse signal. Wherein the frequency of the pulse signal generated by the crystal based on the target parameter best matches an expected frequency. The calibration result may be used to indicate the target parameter or a pulse signal generated based on the target parameter, or the calibration result may also be used to indicate a corresponding count difference value for the target parameter.
The target parameter is determined through the counting difference value of the at least one pulse signal, so that the automatic calibration of the pulse signals can be realized, the labor cost is reduced, and the calibration efficiency is improved while the complexity of a calibration mechanism is reduced.
The reference pulse signal may be a pulse signal generated by the other chips that are calibrated and triggered by the application system 121 shown in fig. 1.
In some embodiments of the present application, the method 200 may further comprise:
the chip receives the reference pulse signal generated with a calibrated application system.
Of course, the embodiments of the present application are not limited thereto. For example, in other alternative embodiments, a high-precision reference pulse signal may be provided by a hardware circuit integrated with a Field Programmable Gate Array (FPGA) or a Complex Programmable Logic Device (CPLD).
The reference pulse signal may be a pulse signal of any accuracy that meets the condition. For example, the reference Pulse signal may be a Pulse Width Modulation (PWM) signal. The signal may be modulated in an analog control manner to generate the PWM signal. For example, the width of the modulated pulses can be equivalent to a desired waveform (including shape and amplitude) to digitally encode the analog signal level to generate information or data that can be used for transmission. For example, the change in signal, energy, etc. may be adjusted by adjusting the change in duty cycle. The duty cycle may refer to the time during a period that the signal is at a high level as a percentage of the total signal period, e.g., 50% of the duty cycle of a square wave.
In some embodiments of the present application, the PWM signal may be generated directly by an internal module of the chip. The PWM signal may be generated, for example, by the chip 130 or the application 121 shown in fig. 1. For example, the I/O interface of the chip 130 may be provided with an integrated module. In other words, the chip 130 may be provided with a function module with a PWM signal output. The I/O interface may be a link for the chip 130 to exchange information with a controlled object. The chip 130 may exchange data with an external device through an I/O interface. The I/O interface may be a programmable interface, i.e. the working mode of the I/O interface may be controlled by a program.
The method for acquiring the count difference of at least one pulse signal by the chip in the embodiment of the present application is described below.
In some embodiments of the present application, the application system 121 may be a system that has been calibrated using a spectrometer before performing the crystal calibration, the clock frequency accuracy having reached a more precise state than a standard protocol (e.g., BLE standard protocol). In practice, the application 121 may generate a precise PWM signal with a certain frequency (e.g., 40Hz) to the chip 130. The chip 130 samples the PWM signal generated by the application 121 through an I/O interface that can be used as an input for external interrupts. The calibration process may be performed within the chip 130, driven by the PWM signal generated by the application 121.
Taking the example of obtaining the count differences corresponding to the pulse signals in a traversal manner, referring to fig. 1, when the test device 110 sends a serial port instruction to start the calibration process, the chip 130 writes a parameter (i.e., a parameter for generating the pulse signal) into the register 133. For example, the parameter may be a bias value. For another example, the initial value of the offset value may be 0. Then, the chip 130 may calculate and record the difference of the system click clock count between the two external interrupts (assuming that the clock frequency of the system click clock is set to 64M, if the clock frequency of the system click clock is infinitely close to 64M in the case that the crystal is calibrated, and when the clock frequency of the system click clock is 64M, the difference of the system click count between the two external interrupts triggered by the PWM signal of 40Hz should be 1600000, i.e., the difference of the preset count may be 1600000), and then write the parameter +1 into the register 133, calculate and record the difference of the system click clock count between the two external interrupts again, and traverse all the parameters of the crystal calibration to find out the parameter corresponding to which the difference of the system click count is closest to 1600000, which is the target parameter of the crystal calibration (which may be used to embody the calibration result).
It should be noted that the register may trigger the crystal to generate the calibrated pulse signal based on the target parameter, for example, the register may modify (or adjust) a capacitance value of a capacitor connected to the crystal to a capacitance value corresponding to the target parameter based on the target parameter to generate the calibrated pulse signal. In other words, the parameters correspond to the arranged capacitance values. For example, the plurality of parameters correspond to the plurality of capacitance values one to one. And selecting the target parameter from the plurality of parameters as an optimal parameter, so that the pulse signal generated based on the capacitance value corresponding to the target parameter is the pulse signal which is most consistent with expectation (namely, is most accurate).
In the above process, a traversal method is adopted to test each possible parameter, and then an optimal parameter is selected as a calibration result. For example, the time cost is reduced, the sampling number of parameters or counting difference values is reduced, the target parameters can be determined only through the counting difference value of at least one pulse signal, the automatic calibration of the pulse signals can be realized, the labor cost is reduced, and the calibration efficiency can be improved while the complexity of a calibration mechanism is reduced.
In some embodiments of the present application, the S210 may include:
and acquiring a counting difference value of the at least one pulse signal by utilizing a dichotomy.
For example, at least one sampling parameter may be obtained from the plurality of parameters by using a bisection method, and then a count difference value of at least one pulse signal may be obtained based on the at least one pulse signal generated by the at least one sampling parameter, respectively.
In other words, the chip may sample multiple parameters based on dichotomy, then generate a pulse signal based on the sampled parameters, and then perform crystal calibration based on the count difference of the pulse signal. Alternatively, the chip may sample the plurality of parameters based on a dichotomy, and then determine whether to continue sampling based on a count difference of the acquired pulse signals.
In some embodiments of the present application, the chip may first determine a minimum parameter and a maximum parameter of the plurality of parameters; respectively generating a first pulse signal and a second pulse signal based on the minimum parameter and the maximum parameter; then respectively acquiring a first counting difference value of the first pulse signal and a second counting difference value of the second pulse signal; at this time, the chip may determine the target parameter based on the first count difference and the second count difference.
For example, the chip may determine the target parameter by comparing a preset count difference value and an average value of the first count difference value and the second count difference value.
The preset count difference may be a count difference corresponding to a preset pulse signal, that is, the preset count difference may be a difference between calibrated system tick count values based on the pulse signal obtained by using two external interrupts triggered by a reference pulse signal. The preset count difference may be a preset count difference, or a count difference measured in advance, or a count difference measured in the calibration process, which is not limited in the embodiment of the present application.
In other words, the chip may first use the maximum parameter and the minimum parameter as the sampling parameters in the plurality of parameters to acquire the pulse signal based on the sampling parameters, and then determine whether it is necessary to continue to acquire the sampling parameters from the plurality of parameters based on the average value of the first count difference and the second count.
For example, in a case where an average value of the first count difference value and the second count difference value is equal to a preset count difference value, an average value of the minimum parameter and the maximum parameter may be determined as the target parameter. In other words, the chip does not need to acquire the sampling parameters after acquiring the first count difference and the second count difference.
For another example, in a case where an average value of the first count difference value and the second count difference value is greater than the preset count difference value, an average value of the minimum parameter and the maximum parameter may be determined to be a first parameter plus 1; generating a third pulse signal based on the first parameter; acquiring a third count difference value of the third pulse signal; determining the target parameter based on the third count difference and the second count difference. In other words, after the chip obtains the first count difference and the second count difference, the chip needs to use bisection to take the first parameter as a sampling parameter to obtain the third pulse signal. Optionally, the plurality of parameters are continuous parameters. Optionally, the plurality of parameters includes the first parameter. Optionally, in the plurality of parameters, the parameter values of the plurality of parameters decrease with an increase in the count difference of the pulse signal; alternatively, the parameter values of the plurality of parameters increase as the count difference of the pulse signal decreases.
The sampling parameters are determined in the plurality of parameters by utilizing the bisection method, so that the sampling parameters can be reduced under the condition of ensuring the calibration precision, namely, the pulse signals needing to be generated are reduced, the counting difference value needing to be measured is also reduced, the calibration efficiency can be effectively improved, and the calibration time is shortened.
For another example, in a case where an average value of the first count difference value and the second count difference value is smaller than the preset count difference value, the average value of the minimum parameter and the maximum parameter may be determined to be a second parameter by subtracting one; generating a fourth pulse signal based on the second parameter; acquiring a fourth count difference value of the fourth pulse signal; determining the target parameter based on the fourth count difference and the first count difference. In other words, after the chip obtains the first count difference and the second count difference, the chip needs to use bisection to take the second parameter as a sampling parameter to obtain the fourth pulse signal. Optionally, the plurality of parameters are continuous parameters. Optionally, the plurality of parameters includes the second parameter. Optionally, in the plurality of parameters, the parameter values of the plurality of parameters decrease with an increase in the count difference of the pulse signal; alternatively, the parameter values of the plurality of parameters increase as the count difference of the pulse signal decreases.
The sampling parameters are determined in the plurality of parameters by utilizing the bisection method, so that the sampling parameters can be reduced under the condition of ensuring the calibration precision, namely, the pulse signals needing to be generated are reduced, the counting difference value needing to be measured is also reduced, the calibration efficiency can be effectively improved, and the calibration time is shortened.
To sum up, the count difference of at least one pulse signal is obtained by utilizing the binary differentiation, so that the count difference of all the pulse signals is avoided being obtained, the total amount of the count difference needing to be obtained is reduced, the calibration accuracy is ensured, the calibration efficiency is improved, and the time cost is reduced.
FIG. 3 is a schematic flow chart diagram of a method 300 of crystal calibration in an embodiment of the present application.
As shown in fig. 3, the method 300 may include some or all of the following:
s310, the chip acquires the minimum parameter and the maximum parameter.
S320, the chip generates a first pulse signal and a second pulse signal based on the minimum parameter and the maximum parameter, respectively, and determines whether the first pulse signal and the second pulse signal have been triggered by a reference pulse signal?
S330, if the first pulse signal and the second pulse signal are respectively triggered to be externally interrupted by the reference pulse signal, the chip acquires the counting difference value of the first pulse signal and the counting difference value of the second pulse signal. If the first pulse signal or the second pulse signal is not triggered by the reference pulse signal to be externally interrupted, the process returns to S320 and is executed.
S340, is the chip has acquired the 5 count difference of the first pulse signal and the 5 count difference of the second pulse signal?
S350, if the chip has acquired the 5 count difference values of the first pulse signal and the 5 count difference values of the second pulse signal, the chip determines an average value of the last 3 count difference values of the 5 count difference values of the first pulse signal as a first count difference value corresponding to the first pulse signal; and determining the average value of the last 3 counting difference values in the 5 counting difference values of the second pulse signal as the second counting difference value corresponding to the second pulse signal. If the chip does not obtain the 5 count difference values of the first pulse signal or the 5 count difference values of the second pulse signal, the process returns to S320 and is executed.
S360, is the minimum parameter less than the maximum parameter?
And S390, if the minimum parameter is equal to the maximum parameter, the chip determines the minimum parameter or the maximum parameter as a target parameter.
S370, if the minimum parameter is smaller than the maximum parameter, determining whether an average value of the first count difference and the second count difference is equal to a preset count difference?
S371, if the average of the first count difference and the second count difference is equal to a preset count difference, the chip determines the average of the minimum parameter and the maximum parameter as a target parameter.
S380, if the average of the first count difference and the second count difference is not equal to a preset count difference, determining whether the average of the first count difference and the second count difference is greater than the preset count difference?
And S381, if the average value of the first count difference value and the second count difference value is greater than the preset count difference value, the chip determines the average value of the minimum parameter and the maximum parameter plus 1 again as the minimum parameter, and returns to S320 and executes the step.
S382, if the average of the first count difference and the second count difference is smaller than the preset count difference, the chip determines the average of the minimum parameter and the maximum parameter minus 1 as the maximum parameter again, and returns to S320 and executes.
And S390, finishing the calibration.
In other embodiments of the present application, the S210 may include:
acquiring a plurality of pulse signals respectively generated by the crystal based on the parameters;
at this time, the chip may first obtain a plurality of count difference values corresponding to the plurality of pulse signals; then, a target counting difference value which is closest to a preset counting difference value in the plurality of counting difference values is obtained by utilizing a bisection method; and finally, determining the parameters corresponding to the target counting difference as the target parameters.
The target counting difference value is obtained through the bisection method, the traversing comparison between the preset counting difference value and the counting difference value of each pulse signal is avoided, the calculated amount of a chip is reduced, the calibration efficiency is improved, and the time cost is reduced.
In some embodiments of the present application, the method 200 may further comprise:
the plurality of count differences are sorted in ascending or descending order.
In other words, after the chip obtains the plurality of count difference values, the plurality of count difference values are arranged in an ascending order or a descending order, and then a target count difference value closest to the preset count difference value is found by using a dichotomy based on a group of arranged count difference values.
For example, the chip may first determine a set of the plurality of count differences as a first set of differences; the target count difference is then determined using bisection within the first set of differences. The count differences within the first difference set are sorted in ascending or descending order.
At this time, the chip may first determine a count difference value of an intermediate position within the first difference value set; determining the count difference value of the intermediate position as the target count difference value in a case where the count difference value of the intermediate position is equal to the preset count difference value. And under the condition that the counting difference value of the middle position is smaller than the preset counting difference value, if the first difference value set is sorted in an ascending order, determining the target counting difference value in the second half section of the first difference value set, and if the first difference value set is combined with the first difference value set and sorted in a descending order, determining the target counting difference value in the first half section of the first difference value set. And under the condition that the counting difference value of the middle position is larger than the preset counting difference value, if the first difference value set is sorted in an ascending order, determining the target counting difference value in the first half section of the first difference value set, and if the first difference value set is combined with the first difference value set and sorted in a descending order, determining the target counting difference value in the second half section of the first difference value set.
In some embodiments of the present application, the parameter values of the plurality of parameters decrease with increasing frequency of the pulse signal.
For example, the parameter values of the plurality of parameters are inversely proportional to the frequency of the pulse signal.
In other words, the parameter values of the plurality of parameters decrease as the count difference of the pulse signal increases. For example, the parameter values of the plurality of parameters are inversely proportional to the count difference of the pulse signal.
By defining the characteristics of the parameters, the obtained difference counts can be automatically sequenced from large to small or from small to large, the step of re-sequencing the plurality of count differences after obtaining the plurality of count differences is avoided, and the time cost of calibrating the pulse signal is effectively reduced on the basis of obtaining the target parameters or the target count differences through the dichotomy.
In other words, the parameter values of the plurality of parameters are decreased as the frequency of the pulse signal increases, such that the parameter values of the plurality of parameters are decreased as the count difference of the pulse signal increases, or the parameter values of the plurality of parameters are increased as the count difference of the pulse signal decreases, so that the chip determines the target parameter or the target count difference using the dichotomy.
In some embodiments of the present application, the S210 may include:
and sequentially acquiring the counting difference value of at least one pulse signal according to the ascending or descending order of the parameter values.
In some embodiments of the present application, the method 200 may further comprise:
and receiving a calibration signaling sent by the test equipment by using a USB (universal serial bus) to serial port and a UART (universal asynchronous receiver/transmitter) HUB (Universal asynchronous receiver/transmitter), wherein the calibration signaling is used for triggering the chip to carry out crystal calibration.
In some embodiments of the present application, the calibration signaling comprises the plurality of parameters.
In some embodiments of the present application, the method 200 may further comprise:
storing the plurality of parameters to a register to send the plurality of parameters to the crystal by controlling the register.
The register triggers the crystal to generate the pulse signal to be calibrated, namely, the register is responsible for and controls the crystal to generate the operation of the signal to be calibrated, so that the workload of the chip is reduced, and the working efficiency of the chip for performing pulse signal calibration is effectively improved.
In some embodiments of the present application, the method 200 may further comprise:
storing a calibration result to the register, the calibration result indicating the target parameter.
In some embodiments of the present application, the method 200 may further comprise:
and sending a calibration result and/or the counting difference value of the at least one pulse signal to the test equipment by utilizing a USB-to-serial port and a UART HUB, wherein the calibration result is used for indicating the target parameter, and the counting difference value of the at least one pulse signal is used for comparing the test equipment with a preset counting difference value on a display interface.
By sending the counting difference value of the at least one pulse signal to the test equipment, a user can observe the corresponding relation between each counting difference value in the counting difference values of the at least one pulse signal and the preset counting difference value on a display interface of the test equipment, so that the user can conveniently and manually adjust the target counting difference value, and a calibration mechanism of automatic calibration and manual calibration is realized. Similarly, by sending the calibration result to the testing equipment, the designer can conveniently carry out batch calibration and adjust parameter design.
In some embodiments of the present application, the S210 may include:
acquiring a plurality of counting differences of each pulse signal in the at least one pulse signal;
determining at least one count difference value later in time of the plurality of count difference values of each of the at least one pulse signal as the count difference value of the corresponding pulse signal.
Therefore, the counting difference value corresponding to each pulse signal can be accurately acquired, and accordingly, the calibration precision of the pulse signals can be improved. In other words, by testing each pulse signal in the at least one pulse signal and then acquiring the count difference corresponding to each pulse signal, the inaccuracy of the measured count difference of the pulse signal under the condition of system instability or crystal instability can be avoided, and the accuracy of the count difference and the calibration precision of the pulse signal can be improved.
In addition, the present application also provides a chip for performing the method 200 or 300.
Fig. 4 is a schematic block diagram of a chip 400 of an embodiment of the present application. The chip 400 may be the chip 130 shown in fig. 1.
As shown in fig. 4, the chip 400 may include:
a crystal 410 for generating a plurality of pulse signals based on a plurality of parameters, respectively;
a processing unit 420, the processing unit 420 coupled to the crystal 410, the processing unit 420 configured to:
acquiring at least one pulse signal generated by the crystal 410 based on at least one of a plurality of parameters;
acquiring a count difference value of at least one pulse signal, wherein the count difference value of each pulse signal in the at least one pulse signal is a difference value between system tick count values acquired by two external interrupts triggered by a reference pulse signal and based on the corresponding pulse signal;
determining a target parameter based on the count difference of the at least one pulse signal;
the pulse signal generated based on the target parameter is determined to be the pulse signal after calibration of the crystal 410.
In some embodiments of the present application, the processing unit 420 is specifically configured to:
and acquiring a counting difference value of the at least one pulse signal by utilizing a dichotomy.
In some embodiments of the present application, the processing unit 420 is more specifically configured to:
determining a minimum parameter and a maximum parameter of a plurality of parameters;
generating a first pulse signal and a second pulse signal based on the minimum parameter and the maximum parameter, respectively;
respectively acquiring a first counting difference value of the first pulse signal and a second counting difference value of the second pulse signal;
determining the target parameter based on the first count difference and the second count difference.
In some embodiments of the present application, the processing unit 420 is more specifically configured to:
determining the average value of the minimum parameter and the maximum parameter as the target parameter when the average value of the first count difference and the second count difference is equal to a preset count difference.
In some embodiments of the present application, the processing unit 420 is more specifically configured to:
determining the average value of the minimum parameter and the maximum parameter plus 1 as a first parameter when the average value of the first count difference and the second count difference is greater than the preset count difference;
generating a third pulse signal based on the first parameter;
acquiring a third count difference value of the third pulse signal;
determining the target parameter based on the third count difference and the second count difference.
In some embodiments of the present application, the processing unit 420 is more specifically configured to:
when the average value of the first counting difference value and the second counting difference value is smaller than the preset counting difference value, subtracting one from the average value of the minimum parameter and the maximum parameter to determine the average value as a second parameter;
generating a fourth pulse signal based on the second parameter;
acquiring a fourth count difference value of the fourth pulse signal;
determining the target parameter based on the fourth count difference and the first count difference.
In some embodiments of the present application, the processing unit 420 is specifically configured to:
acquiring a plurality of pulse signals respectively generated by the crystal 410 based on the plurality of parameters;
acquiring a plurality of counting difference values corresponding to the plurality of pulse signals;
obtaining a target counting difference value which is closest to a preset counting difference value in the plurality of counting difference values by utilizing a bisection method;
and determining the parameter corresponding to the target counting difference as the target parameter.
In some embodiments of the present application, the processing unit 420 is further configured to:
the plurality of count differences are sorted in ascending or descending order.
In some embodiments of the present application, the parameter values of the plurality of parameters decrease with increasing frequency of the pulse signal.
In some embodiments of the present application, the parameter values of the plurality of parameters are inversely proportional to the frequency of the pulse signal.
In some embodiments of the present application, the processing unit 420 is specifically configured to:
and sequentially acquiring the counting difference value of at least one pulse signal according to the ascending or descending order of the parameter values.
In some embodiments of the present application, the chip further comprises:
USB changes serial ports and universal asynchronous receiving and dispatching transmitter UART concentrator HUB to USB, USB changes the serial ports to pass through the UART HUB is connected to processing unit 420, processing unit 420 passes through USB changes the serial ports with the calibration signaling that test equipment sent is received to the UART HUB, the calibration signaling is used for triggering the chip carries out crystal 410 calibration.
In some embodiments of the present application, the calibration signaling comprises the plurality of parameters.
In some embodiments of the present application, the chip further comprises:
a register through which the processing unit 420 is connected to the crystal 410, the processing unit 420 being configured to store the plurality of parameters to the register so as to send the plurality of parameters to the crystal 410 by controlling the register.
In some embodiments of the present application, the processing unit 420 is further configured to store a calibration result to the register, the calibration result being indicative of the target parameter.
In some embodiments of the present application, the chip further comprises:
USB changes serial ports and universal asynchronous receiving and dispatching transmitter UART concentrator HUB to USB, USB changes the serial ports to pass through the UART HUB is connected to processing unit 420, processing unit 420 passes through USB changes the serial ports with the UART HUB sends calibration result and/or at least one pulse signal's count difference to test equipment, the calibration result is used for instructing target parameter, at least one pulse signal's count difference is used for test equipment shows the interface and predetermines the count difference and compare.
In some embodiments of the present application, the processing unit 420 is specifically configured to:
acquiring a plurality of counting differences of each pulse signal in the at least one pulse signal;
determining at least one count difference value later in time of the plurality of count difference values of each of the at least one pulse signal as the count difference value of the corresponding pulse signal.
In some embodiments of the present application, the processing unit 420 is specifically configured to:
receiving the reference pulse signal generated with the calibrated application system.
In some embodiments of the present application, the reference pulse signal is a pulse width modulated PWM signal.
In some embodiments of the present application, the chip is a bluetooth low energy BLE chip.
In addition, the present application also provides a bluetooth headset, which may include the above chip 400.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (41)

1. A method of crystal alignment, adapted for use with a chip having a crystal, the method comprising:
obtaining a count difference of at least one pulse signal, the at least one pulse signal including a pulse signal generated by the crystal based on at least one parameter of a plurality of parameters, the count difference of each pulse signal of the at least one pulse signal being a difference between system tick count values based on the corresponding pulse signal obtained using two external interrupts triggered by a reference pulse signal;
determining a target parameter based on the count difference of the at least one pulse signal;
and determining the pulse signal generated based on the target parameter as the pulse signal after crystal calibration.
2. The method of claim 1, wherein obtaining a count difference for at least one pulse signal comprises:
and acquiring a counting difference value of the at least one pulse signal by utilizing a dichotomy.
3. The method of claim 2, wherein said obtaining a count difference of said at least one pulse signal using bisection comprises:
determining a minimum parameter and a maximum parameter of a plurality of parameters;
generating a first pulse signal and a second pulse signal based on the minimum parameter and the maximum parameter, respectively;
respectively acquiring a first counting difference value of the first pulse signal and a second counting difference value of the second pulse signal;
wherein determining a target parameter based on the count difference of the at least one pulse signal comprises:
determining the target parameter based on the first count difference and the second count difference.
4. The method of claim 3, wherein determining the target parameter based on the first count difference and the second count difference comprises:
determining the average value of the minimum parameter and the maximum parameter as the target parameter when the average value of the first count difference and the second count difference is equal to a preset count difference.
5. The method of claim 3 or 4, wherein said determining the target parameter based on the first count difference and the second count difference comprises:
determining the average value of the minimum parameter and the maximum parameter plus 1 as a first parameter when the average value of the first count difference and the second count difference is greater than the preset count difference;
generating a third pulse signal based on the first parameter;
acquiring a third count difference value of the third pulse signal;
determining the target parameter based on the third count difference and the second count difference.
6. The method of any of claims 3 to 5, wherein said determining the target parameter based on the first count difference and the second count difference comprises:
when the average value of the first counting difference value and the second counting difference value is smaller than the preset counting difference value, subtracting one from the average value of the minimum parameter and the maximum parameter to determine the average value as a second parameter;
generating a fourth pulse signal based on the second parameter;
acquiring a fourth count difference value of the fourth pulse signal;
determining the target parameter based on the fourth count difference and the first count difference.
7. The method of claim 1, wherein obtaining a count difference for at least one pulse signal comprises:
acquiring a plurality of pulse signals respectively generated by the crystal based on the parameters;
acquiring a plurality of counting difference values corresponding to the plurality of pulse signals;
wherein the determining a target parameter based on the count difference of the at least one pulse signal comprises:
obtaining a target counting difference value which is closest to a preset counting difference value in the plurality of counting difference values by utilizing a bisection method;
and determining the parameter corresponding to the target counting difference as the target parameter.
8. The method of claim 7, further comprising:
the plurality of count differences are sorted in ascending or descending order.
9. The method according to any one of claims 1 to 8, wherein the parameter values of the plurality of parameters decrease with increasing frequency of the pulse signal.
10. The method of claim 9, wherein the parameter values of the plurality of parameters are inversely proportional to the frequency of the pulse signal.
11. The method of claim 9, wherein obtaining a count difference for at least one pulse signal comprises:
and sequentially acquiring the counting difference value of at least one pulse signal according to the ascending or descending order of the parameter values.
12. The method according to any one of claims 1 to 11, further comprising:
and receiving a calibration signaling sent by the test equipment by using a Universal Serial Bus (USB) to serial port and a universal asynchronous receiving and transmitting transmitter (UART) HUB, wherein the calibration signaling is used for triggering the chip to carry out crystal calibration.
13. The method of claim 12, wherein the calibration signaling comprises the plurality of parameters.
14. The method according to any one of claims 1 to 13, further comprising:
storing the plurality of parameters to a register to send the plurality of parameters to the crystal by controlling the register.
15. The method of claim 14, further comprising:
storing a calibration result to the register, the calibration result indicating the target parameter.
16. The method according to any one of claims 1 to 15, further comprising:
and sending a calibration result and/or a counting difference value of the at least one pulse signal to the test equipment by utilizing a Universal Serial Bus (USB) to serial port and a universal asynchronous receiver-transmitter (UART) HUB (HUB), wherein the calibration result is used for indicating the target parameter, and the counting difference value of the at least one pulse signal is used for comparing the test equipment with a preset counting difference value on a display interface.
17. The method of any one of claims 1 to 16, wherein said obtaining a count difference of at least one pulse signal comprises:
acquiring a plurality of counting differences of each pulse signal in the at least one pulse signal;
determining at least one count difference value later in time of the plurality of count difference values of each of the at least one pulse signal as the count difference value of the corresponding pulse signal.
18. The method according to any one of claims 1 to 17, further comprising:
receiving the reference pulse signal generated with the calibrated application system.
19. The method according to any one of claims 1 to 18, wherein the reference pulse signal is a pulse width modulated, PWM, signal.
20. The method according to any one of claims 1 to 19, wherein the chip is a Bluetooth Low Energy (BLE) chip.
21. A chip, wherein the chip comprises:
a crystal for generating a plurality of pulse signals based on a plurality of parameters, respectively;
a processing unit coupled to the crystal, the processing unit to:
obtaining a count difference of at least one pulse signal, the at least one pulse signal including a pulse signal generated by the crystal based on at least one parameter of a plurality of parameters, the count difference of each pulse signal of the at least one pulse signal being a difference between system tick count values based on the corresponding pulse signal obtained using two external interrupts triggered by a reference pulse signal;
determining a target parameter based on the count difference of the at least one pulse signal;
and determining the pulse signal generated based on the target parameter as the pulse signal after crystal calibration.
22. The chip according to claim 21, wherein the processing unit is specifically configured to:
and acquiring a counting difference value of the at least one pulse signal by utilizing a dichotomy.
23. The chip according to claim 22, characterized in that said processing unit is more specifically configured to:
determining a minimum parameter and a maximum parameter of a plurality of parameters;
generating a first pulse signal and a second pulse signal based on the minimum parameter and the maximum parameter, respectively;
respectively acquiring a first counting difference value of the first pulse signal and a second counting difference value of the second pulse signal;
determining the target parameter based on the first count difference and the second count difference.
24. The chip according to claim 23, characterized in that said processing unit is more specifically configured to:
determining the average value of the minimum parameter and the maximum parameter as the target parameter when the average value of the first count difference and the second count difference is equal to a preset count difference.
25. The chip according to claim 23 or 24, characterized in that said processing unit is more specifically configured to:
determining the average value of the minimum parameter and the maximum parameter plus 1 as a first parameter when the average value of the first count difference and the second count difference is greater than the preset count difference;
generating a third pulse signal based on the first parameter;
acquiring a third count difference value of the third pulse signal;
determining the target parameter based on the third count difference and the second count difference.
26. The chip according to any of claims 23 to 25, characterized in that the processing unit is more specifically configured to:
when the average value of the first counting difference value and the second counting difference value is smaller than the preset counting difference value, subtracting one from the average value of the minimum parameter and the maximum parameter to determine the average value as a second parameter;
generating a fourth pulse signal based on the second parameter;
acquiring a fourth count difference value of the fourth pulse signal;
determining the target parameter based on the fourth count difference and the first count difference.
27. The chip according to claim 21, wherein the processing unit is specifically configured to:
acquiring a plurality of pulse signals respectively generated by the crystal based on the parameters;
acquiring a plurality of counting difference values corresponding to the plurality of pulse signals;
obtaining a target counting difference value which is closest to a preset counting difference value in the plurality of counting difference values by utilizing a bisection method;
and determining the parameter corresponding to the target counting difference as the target parameter.
28. The chip of claim 27, wherein the processing unit is further configured to:
the plurality of count differences are sorted in ascending or descending order.
29. The chip of any one of claims 21 to 28, wherein the parameter values of the plurality of parameters decrease with increasing frequency of the pulse signal.
30. The chip of claim 29, wherein the parameter values of the plurality of parameters are inversely proportional to the frequency of the pulse signal.
31. The chip of claim 29, wherein the processing unit is specifically configured to:
and sequentially acquiring the counting difference value of at least one pulse signal according to the ascending or descending order of the parameter values.
32. The chip of any one of claims 21 to 31, wherein the chip further comprises:
USB changes serial ports and universal asynchronous receiving and dispatching transmitter UART concentrator HUB, USB changes the serial ports and passes through the UART HUB is connected to processing unit, processing unit passes through USB changes the serial ports with the calibration signaling that test equipment sent is received to the UART HUB, the calibration signaling is used for triggering the chip carries out the crystal calibration.
33. The chip of claim 32, wherein the calibration signaling comprises the plurality of parameters.
34. The chip according to any one of claims 21 to 33, wherein the chip further comprises:
a register through which the processing unit is connected to the crystal, the processing unit to store the plurality of parameters to the register so as to send the plurality of parameters to the crystal by controlling the register.
35. The chip of claim 34, wherein the processing unit is further configured to store a calibration result to the register, the calibration result indicating the target parameter.
36. The chip according to any one of claims 21 to 35, wherein the chip further comprises:
USB changes serial ports and universal asynchronous receiving and dispatching transmitter UART concentrator HUB to universal serial bus USB, USB changes the serial ports to pass through UART HUB is connected to processing unit, processing unit passes through USB changes the serial ports with UART HUB sends calibration result and/or at least one pulse signal's count difference to test equipment, the calibration result is used for instructing target parameter, at least one pulse signal's count difference is used for test equipment is showing interface and is predetermineeing the count difference and compare.
37. The chip according to any one of claims 21 to 36, wherein the processing unit is specifically configured to:
acquiring a plurality of counting differences of each pulse signal in the at least one pulse signal;
determining at least one count difference value later in time of the plurality of count difference values of each of the at least one pulse signal as the count difference value of the corresponding pulse signal.
38. The chip according to any one of claims 21 to 37, wherein the processing unit is specifically configured to:
receiving the reference pulse signal generated with the calibrated application system.
39. The chip of any one of claims 21 to 38, wherein the reference pulse signal is a Pulse Width Modulated (PWM) signal.
40. The chip according to any one of claims 21 to 39, wherein the chip is a Bluetooth Low Energy (BLE) chip.
41. A bluetooth headset, comprising:
the chip of any one of claims 21 to 40.
CN202080001624.9A 2020-01-03 2020-01-03 Crystal calibration method, chip and Bluetooth headset Active CN111819787B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/070263 WO2021134783A1 (en) 2020-01-03 2020-01-03 Crystal calibration method, chip and bluetooth earphone

Publications (2)

Publication Number Publication Date
CN111819787A true CN111819787A (en) 2020-10-23
CN111819787B CN111819787B (en) 2023-12-15

Family

ID=72860058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202080001624.9A Active CN111819787B (en) 2020-01-03 2020-01-03 Crystal calibration method, chip and Bluetooth headset

Country Status (2)

Country Link
CN (1) CN111819787B (en)
WO (1) WO2021134783A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040068383A1 (en) * 2002-07-05 2004-04-08 Stmicroelectronics S.A. Method of operating a microcontroller chip having an internal RC oscillator and microcontroller chip embodying the method
US20090049326A1 (en) * 2007-08-14 2009-02-19 Samsung Electronics Co., Ltd. Clock signal generator for generating stable clock signal, semiconductor memory device including the same, and methods of operating
CN102207522A (en) * 2011-04-01 2011-10-05 广州润芯信息技术有限公司 Resistance capacitance (RC) constant measuring method based on frequency measurement
CN102819282A (en) * 2012-07-26 2012-12-12 大唐微电子技术有限公司 Clock recovery circuit device and corresponding method
CN104915305A (en) * 2014-03-11 2015-09-16 泰凌微电子(上海)有限公司 USB equipment chip and frequency calibration method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176400B (en) * 2013-01-14 2015-08-26 杭州海兴电力科技股份有限公司 Intelligent ammeter clock calibration method
CN203759695U (en) * 2014-03-11 2014-08-06 泰凌微电子(上海)有限公司 USB chip

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040068383A1 (en) * 2002-07-05 2004-04-08 Stmicroelectronics S.A. Method of operating a microcontroller chip having an internal RC oscillator and microcontroller chip embodying the method
US20090049326A1 (en) * 2007-08-14 2009-02-19 Samsung Electronics Co., Ltd. Clock signal generator for generating stable clock signal, semiconductor memory device including the same, and methods of operating
CN102207522A (en) * 2011-04-01 2011-10-05 广州润芯信息技术有限公司 Resistance capacitance (RC) constant measuring method based on frequency measurement
CN102819282A (en) * 2012-07-26 2012-12-12 大唐微电子技术有限公司 Clock recovery circuit device and corresponding method
CN104915305A (en) * 2014-03-11 2015-09-16 泰凌微电子(上海)有限公司 USB equipment chip and frequency calibration method thereof

Also Published As

Publication number Publication date
CN111819787B (en) 2023-12-15
WO2021134783A1 (en) 2021-07-08

Similar Documents

Publication Publication Date Title
US7852099B1 (en) Frequency trimming for internal oscillator for test-time reduction
US7035750B2 (en) On-chip test mechanism for transceiver power amplifier and oscillator frequency
US7219269B2 (en) Self-calibrating strobe signal generator
CN205844782U (en) The controller of a kind of High-Speed Automatic calibration chip inner loop vibration frequency and test device
CN110401499A (en) For Fast Frequency Offset calibration method, device, equipment and the medium of radio-frequency module
CN104901690A (en) Method and device for automatically calibrating ring oscillator in test mode
CN113156356B (en) Remote calibration system and calibration method for voltage source
CN104154987A (en) Vibration wire type sensor reader measuring meter
CN216748451U (en) High-precision time service precision measurement system
CN102055539A (en) Automated calibration method and equipment for meter output signal
CN101436911B (en) Method for implementing test production of wireless data transmission module
US20130259100A1 (en) Information processing apparatus, testing method, and computer-readable recording medium having stored therein testing program
US9341658B2 (en) Fast on-chip oscillator trimming
CN111819787B (en) Crystal calibration method, chip and Bluetooth headset
CN110261792A (en) DC power supply detection method, device, test terminal and readable storage medium storing program for executing
US20130015837A1 (en) On-chip signal waveform measurement circuit
CN108540632A (en) OTA test methods, device and intelligent terminal
KR101729094B1 (en) Magnetic resonance device
US20070198202A1 (en) Measuring signal propagation and adjustable delays in electronic devices
CN101828345A (en) System for testing an embedded wireless transceiver
CN112015229A (en) Circuit capable of realizing chip internal clock calibration by using debugger
CN106841777A (en) A kind of measurement apparatus of high accuracy frequency domain stability
CN201928268U (en) Multi-frequency point receiver
US9170602B1 (en) Calibrating a high-speed clock signal generated using a processor internal to the electronic authentication device without using a crystal oscillator
CN215894749U (en) High-precision frequency counter device

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