A crystal oscillator startup control circuit, method, electronic device and medium

By using programmable drive modules and digital control modules in the crystal oscillator start-up control circuit to calculate and output suitable drive signals, the problem of slow crystal oscillator start-up speed is solved, achieving faster start-up speed and a wider application range.

CN118249805BActive Publication Date: 2024-09-03HANGZHOU SEMISTRON MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410658927.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-09-03
Estimated Expiration
2044-05-27

AI Technical Summary

Technical Problem

The existing crystal oscillator circuit structure causes the crystal oscillator to start up slowly, limiting its application in certain circuits.

Method used

Design a crystal oscillator start-up control circuit, including a programmable drive module, a digital control module, an ADC module and a memory module. By converting historical drive values ​​and analog voltage signals into digital voltage signals, the current drive that meets the preset adaptation conditions is calculated. value, and output a driving signal to speed up the start-up speed of the crystal oscillator.

Benefits of technology

The starting speed of the crystal oscillator is significantly improved, the problem of slow starting speed in the existing technology is solved, and the flexibility of using the crystal oscillator in the circuit is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118249805B
    Figure CN118249805B
Patent Text Reader

Abstract

The present invention discloses a crystal oscillator startup control circuit, method, electronic device and medium, and relates to the field of crystal oscillator control. When the crystal oscillator is connected to the control circuit for the first time, the programmable driving module outputs a historical driving value to control the crystal oscillator startup, the ADC module receives the analog voltage signal output by the crystal oscillator when it is first started and outputs a corresponding digital voltage signal, and the digital control module determines the current driving value of the crystal oscillator that meets the preset adaptation condition according to the historical driving value and the change of the starting amplitude value corresponding to the digital voltage signal output by the ADC module. Because the preset adaptation condition is determined based on the deviation between the estimated value and the actual value of the starting amplitude value, the programmable driving module can greatly speed up the crystal oscillator startup after outputting the driving signal corresponding to the current driving value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of crystal oscillator control, and in particular to a crystal oscillator startup control circuit, method, electronic equipment and medium. Background Art

[0002] With the development of electronic technology, crystal oscillators have been widely used in various electronic devices. Almost all crystal oscillator circuits use the Pierce oscillator circuit, which consists of an inverter, a feedback resistor, a crystal oscillator, and two load capacitors. However, the simple structure also brings inefficient performance, which makes the actual startup of the crystal oscillator slower, so this structure has great limitations in some circuits. Summary of the invention

[0003] The purpose of the present invention is to provide a crystal oscillator startup control circuit, method, electronic device and medium. In this scheme, the programmable drive module can output a drive signal corresponding to the current drive value that meets the preset adaptation conditions, so the crystal oscillator will greatly speed up its own startup speed after receiving the drive signal.

[0004] In order to solve the above technical problems, the present invention provides a crystal oscillator startup control circuit, comprising: a programmable drive module, a digital control module, an ADC module and a memory module;

[0005] The input end of the ADC module is connected to a crystal oscillator, and is used to convert the analog voltage signal transmitted by the crystal oscillator into a corresponding digital voltage signal;

[0006] The input end of the digital control module is respectively connected to the output end of the memory module and the output end of the ADC module, and the output end is connected to the input end of the memory module, and is used to transmit the historical driving value transmitted by the memory module when the crystal oscillator and the ADC module are first connected to the programmable driving module, and calculate the current driving value of the crystal oscillator that meets the preset adaptation condition according to the change of the starting amplitude value corresponding to the received digital voltage signal and the historical driving value, and send the current driving value to the memory module; the preset adaptation condition is an adaptation condition determined based on the deviation between the estimated value and the actual value of the starting amplitude value;

[0007] The input end of the programmable driving module is connected to the digital control module, and the output end is connected to the crystal oscillator, and is used to output a corresponding driving signal to the crystal oscillator based on the historical driving value or the current driving value to drive the crystal oscillator to start.

[0008] Optionally, the digital control module includes: an adder counter, an adder-subtractor counter, a comparator and a control circuit;

[0009] The control circuit is connected to the ADC module, the memory module and the programmable driving module respectively, and is used to receive the digital voltage signal transmitted by the ADC module, receive the historical driving value transmitted by the memory module, and send the historical driving value or the current driving value to the programmable driving module;

[0010] The adder counter is connected to the control circuit and is used for counting when the oscillation amplitude value changes;

[0011] The comparator is connected to the control circuit, and is used to determine the estimated value of the starting amplitude value that will change next time according to the two adjacent starting amplitude values ​​that have changed, and compare the estimated value with the actual value of the starting amplitude value that will change next time;

[0012] The add-subtract counter is connected to the control circuit, and is used to change the size of the historical drive value based on the estimated value of the starting amplitude value that will change next time, and transmit the changed historical drive value to the programmable drive module through the control circuit; adjust the changed historical drive value based on the size relationship until the difference between the estimated value and the actual value is within a preset range, generate the current drive value, and transmit the current drive value to the programmable drive module through the control circuit.

[0013] Optionally, the digital control module further includes:

[0014] A register, wherein the register is respectively connected to the adder counter, the add-subtract counter, and the comparator, and is used to store the starting amplitude value, the estimated value, the actual value, the historical driving value, and the current driving value.

[0015] Optionally, the programmable driving module includes: a plurality of inverters composed of PMOS tubes and NMOS tubes.

[0016] Optionally, also include:

[0017] An amplitude detector, the input end of which is connected to the crystal oscillator, and the output end of which is connected to the input end of the ADC module, is used to amplify the analog voltage signal transmitted by the crystal oscillator and transmit the amplified analog voltage signal to the ADC module.

[0018] Optionally, also include:

[0019] An internal clock module, the internal clock module is connected to the control circuit and is used to transmit a preset clock signal to the control circuit, wherein the frequency of the preset clock signal is greater than a frequency threshold;

[0020] Accordingly, the control circuit is also used for:

[0021] After the oscillation amplitude value of the digital voltage signal changes for the first time, determining whether the oscillation amplitude value changes for the second time within a preset time period corresponding to the preset clock signal;

[0022] If the oscillation amplitude value changes for the second time within the preset time period corresponding to the preset clock signal, continue to control the adder counter to count the changes in the oscillation amplitude value;

[0023] If the oscillation amplitude value does not change for the second time within the preset time period corresponding to the preset clock signal, a corresponding alarm is issued.

[0024] In order to solve the above technical problems, the present invention also provides a crystal oscillator startup control method, which is applied to a crystal oscillator startup control circuit. The crystal oscillator startup control circuit includes: a programmable drive module, a digital control module, an ADC module and a memory module; the method includes:

[0025] The ADC module converts the analog voltage signal transmitted by the crystal oscillator into a corresponding digital voltage signal;

[0026] The digital control module transmits the historical driving value transmitted by the memory module to the programmable driving module when the crystal oscillator is connected to the ADC module for the first time, and calculates the current driving value of the crystal oscillator that meets the preset adaptation condition according to the change of the starting amplitude value corresponding to the received digital voltage signal and the historical driving value, and sends the current driving value to the memory module; the preset adaptation condition is an adaptation condition determined based on the deviation between the estimated value and the actual value of the starting amplitude value;

[0027] The programmable driving module outputs a corresponding driving signal to the crystal oscillator based on the historical driving value or the current driving value, so as to drive the crystal oscillator to start.

[0028] In order to solve the above technical problem, the present invention further provides an electronic device, comprising the crystal oscillator startup control circuit as described above.

[0029] In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the crystal oscillator startup control method as described above are implemented.

[0030] The purpose of the present invention is to provide a crystal oscillator startup control circuit, method, electronic device and medium. When the crystal oscillator is connected to the control circuit for the first time, the programmable drive module will output a historical drive value to control the crystal oscillator startup, the ADC module will receive the analog voltage signal output by the crystal oscillator when it is first started and output a corresponding digital voltage signal, and the digital control module will determine the current drive value of the crystal oscillator that meets the preset adaptation condition based on the historical drive value and the change in the starting amplitude value corresponding to the digital voltage signal output by the ADC module. Because the preset adaptation condition is determined based on the deviation between the estimated value and the actual value of the starting amplitude value, the programmable drive module will greatly speed up the crystal oscillator startup after outputting the drive signal corresponding to the current drive value. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0032] Figure 1 A schematic diagram of the structure of a crystal oscillator startup control circuit provided by the present invention;

[0033] Figure 2 A structural schematic diagram of a digital control module provided by the present invention;

[0034] Figure 3 A schematic diagram of the structure of a programmable drive module provided by the present invention;

[0035] Figure 4 A schematic structural diagram of another crystal oscillator startup control circuit provided by the present invention. DETAILED DESCRIPTION

[0036] The core of the present invention is to provide a crystal oscillator startup control circuit, method, electronic device and medium. In this scheme, the programmable drive module can output a drive signal corresponding to the current drive value that meets the preset adaptation conditions, so the crystal oscillator will greatly speed up its own startup after receiving the drive signal.

[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] Please refer to Figure 1 , Figure 1 The schematic diagram of the structure of a crystal oscillator startup control circuit provided by the present invention. The crystal oscillator startup control circuit comprises: a programmable drive module 3, a digital control module 2, an ADC module 1 and a memory module 4;

[0039] The input end of the ADC module 1 is connected to the crystal oscillator, and is used to convert the analog voltage signal transmitted by the crystal oscillator into a corresponding digital voltage signal;

[0040] The input end of the digital control module 2 is respectively connected to the output end of the memory module 4 and the output end of the ADC module 1, and the output end is connected to the input end of the memory module 4, and is used to transmit the historical driving value transmitted by the memory module 4 to the programmable driving module 3 when the crystal oscillator and the ADC module 1 are first connected, and calculate the current driving value of the crystal oscillator that meets the preset adaptation condition according to the change of the starting amplitude value corresponding to the received digital voltage signal and the historical driving value, and send the current driving value to the memory module 4; the preset adaptation condition is an adaptation condition determined based on the deviation between the estimated value and the actual value of the starting amplitude value;

[0041] The input end of the programmable driving module 3 is connected to the digital control module 2, and the output end is connected to the crystal oscillator, and is used to output a corresponding driving signal to the crystal oscillator based on a historical driving value or a current driving value to drive the crystal oscillator to start.

[0042] In the present invention, in order to solve the problem of slow crystal oscillator startup in the prior art, a crystal oscillator startup control circuit is provided, in which a programmable drive module 3, a digital control module 2, an ADC (Analog-to-Digital Converter, analog / digital converter) module and memory module 4, wherein, when the crystal oscillator is connected to the crystal oscillator start-up control circuit for the first time, the digital control module 2 will transmit the historical drive value transmitted by the memory module 4 to the programmable drive module 3, and output the drive signal corresponding to the historical drive value to the crystal oscillator through the programmable drive module 3 to control the crystal oscillator to start. After the crystal oscillator is started, the ADC module 1 will convert the analog voltage signal transmitted by the crystal oscillator into a corresponding digital voltage signal, and the digital control module 2 will calculate the current drive value of the crystal oscillator that meets the preset adaptation conditions according to the change of the starting amplitude value corresponding to the received digital voltage signal and the historical drive value, and send the current drive value to the memory module 4 for storage, so that it can be called when the crystal oscillator needs to be started later. In addition, the digital control module 2 will also send the current drive value to the programmable drive module 3, so that the programmable drive module 3 can output the corresponding drive signal to the crystal oscillator according to the current drive value, so as to improve the start-up speed of the crystal oscillator.

[0043] The present embodiment provides a crystal oscillator startup control circuit. When the crystal oscillator is connected to the control circuit for the first time, the programmable driving module 3 will output a historical driving value to control the crystal oscillator startup. The ADC module 1 will receive the analog voltage signal output by the crystal oscillator when it is first started and output a corresponding digital voltage signal. The digital control module 2 will determine the current driving value of the crystal oscillator that meets the preset adaptation condition based on the historical driving value and the change in the starting amplitude value corresponding to the digital voltage signal output by the ADC module 1. Because the preset adaptation condition is determined based on the deviation between the estimated value and the actual value of the starting amplitude value, the programmable driving module 3 will greatly speed up the crystal oscillator startup after outputting the driving signal corresponding to the current driving value.

[0044] Based on the above embodiments:

[0045] As an optional embodiment, the digital control module 2 includes: an adder counter, an adder-subtractor counter, a comparator and a control circuit;

[0046] The control circuit is respectively connected to the ADC module 1, the memory module 4 and the programmable drive module 3, and is used to receive the digital voltage signal transmitted by the ADC module 1, receive the historical drive value transmitted by the memory module 4, and send the historical drive value or the current drive value to the programmable drive module 3;

[0047] The adding counter is connected to the control circuit and is used for counting when the starting amplitude value changes;

[0048] The comparator is connected to the control circuit and is used to determine the estimated value of the starting amplitude value that will change next time according to the two adjacent starting amplitude values ​​that have changed, and compare the estimated value with the actual value of the starting amplitude value that will change next time;

[0049] The add-subtract counter is connected to the control circuit, and is used to change the size of the historical drive value based on the estimated value of the starting amplitude value that will change next time, and transmit the changed historical drive value to the programmable drive module 3 through the control circuit; adjust the changed historical drive value based on the size relationship until the difference between the estimated value and the actual value is within a preset range, generate the current drive value, and transmit the current drive value to the programmable drive module 3 through the control circuit.

[0050] In the present invention, the digital control module 2 is provided with an adder counter, an adder-subtractor counter, a comparator and a control circuit, wherein the control circuit is responsible for connecting with the ADC module 1, the memory module 4, the programmable drive module 3, the adder counter, the comparator and the adder-subtractor counter. When the crystal oscillator is connected to the crystal oscillator start-up control circuit for the first time, the control circuit receives the historical drive value transmitted by the memory module 4, and transmits it to the programmable drive module 3, and sends the digital voltage signal to the adder counter after the ADC transmits it. The adder counter counts when the starting amplitude value of the digital voltage signal changes, and the comparator determines the estimated value of the starting amplitude value that changes next time according to the two adjacent starting amplitude values ​​that have changed. The adder-subtractor counter is used to calculate the starting amplitude value of the digital voltage signal. The counter will change the size of the historical drive value based on the estimated value, and transmit the changed historical drive value to the programmable drive module 3 through the control circuit. After receiving the drive signal corresponding to the changed historical drive value sent by the programmable drive module 3, the crystal oscillator will output a corresponding analog voltage signal, and the comparator will compare the size relationship between the actual value of the starting amplitude value corresponding to the new analog voltage signal and the estimated value. The addition and subtraction counter will adjust the changed historical drive value according to the size relationship until the difference between the estimated value and the actual value is within the preset range. The final adjusted historical drive value is the current drive value to be obtained in this application, and the current drive value is transmitted to the programmable drive module 3 through the control circuit, which can speed up the startup speed of the crystal oscillator.

[0051] It should be noted that in actual applications, the programmable drive module 3 may include eight groups of inverters with different numbers of control P tubes and control N tubes, namely 1, 2, 4, 8, 16, 32, 64, and 128 groups. Because the ADC value (starting amplitude value) is 16 bits, and the starting amplitude value increases each time it changes, the default value is 0, and it can change 15 times, so it can only be detected 15 times.

[0052] It should also be noted that the process of determining the current driving value generally requires first determining a rough range, and then using the dichotomy method to determine the specific value of the current driving value, for example:

[0053] Step 1: When the crystal oscillator is first connected to the circuit, the CTRL value stored in the corresponding frequency is the default value 8'h80. This value is read and loaded into the add-subtract counter. The digital control module 2 controls the default opening of 128 inverter groups through CTRL (historical drive value).

[0054] Step 2: Wait for the change of D0 value (digital voltage signal). If D0 value changes, it is recorded as the first change, and the adder counter starts counting; if D0 value does not change within the set time, increase CTRL (historical drive value) to the maximum value, and continue to wait for the change of D0 value. If D0 value still does not change within the specified time, reduce CTRL to the minimum value, and continue to wait for the change of D0 value. If D0 value still does not change within the specified time, an error is reported (even if the size of the drive value output to the programmable drive module 3 is changed to the maximum or minimum value, if D0 value still does not change within the set time, an error is reported).

[0055] Step 3: The adder counter continues counting until the value of D0 changes again, which is recorded as the second change. The current value of the adder counter is cached as CNT1 and counts again.

[0056] Step 4: The adder counter continues counting until the value of D0 changes again, which is recorded as the third change. The current adder counter value is cached as CNT2 and counts again. The comparator compares CNT2 and CNT1 and estimates CNT3P. The adder counter adds 16, increases the CTRL value to 8'h90, and adjusts the programmable drive module 3.

[0057] Step 5: The adder counter continues to count until the D0 value changes again, which is recorded as the fourth change. The current adder counter value is cached as CNT3 and counts again. The comparator compares CNT3 and CNT3P. If CNT3P is larger, the adder counter remains unchanged. If CNT3 is larger, the adder counter is reduced by 32, and the CTRL value is reduced to 8'b70. The first four changes are mainly used to determine the direction of change of the CTRL value. In this example, CNT3P is larger, and the adder counter remains unchanged.

[0058] If CNT3P is larger, then go to step 6: the adder counter continues to count until the D0 value changes again, which is recorded as the fifth change. The current adder counter value is cached as CNT4 and counts again. The comparator compares CNT3 and CNT4 and estimates CNT5P. The adder counter adds 16, increases the CTRL value to 8'hA0, and adjusts the programmable drive module 3.

[0059] Step 7: The adder counter continues to count until the value of D0 changes again, which is recorded as the 6th change. The current adder counter value is cached as CNT5 and counts again. The comparator compares CNT5 and CNT5P. If CNT5P is larger, the adder counter remains unchanged. If CNT5 is larger, the adder counter is reduced by 8 and the CTRL value is reduced. In this example, CNT5 is larger, the adder counter is reduced by 8, and the CTRL value is reduced to 8'h98. The current optimal CTRL value is between 8'h80 and 8'hA0. After a range is determined, the binary search method is used for judgment each time.

[0060] If CNT5 is larger, go to step 8: the adder counter continues to count until the value of D0 changes again, which is recorded as the 7th change. The current value of the adder counter is cached as CNT6 and counts again.

[0061] Step 9: The adder counter continues counting until the value of D0 changes again, which is recorded as the 8th change. The current adder counter value is cached as CNT7 and counts again. The comparator compares CNT6 and CNT7 and estimates CNT8P. The adder counter decreases by 8, reduces the CTRL value to 8'h90, and adjusts the programmable drive module 3.

[0062] Step 10: The adder counter continues to count until the value of D0 changes again, which is recorded as the 9th change. The current adder counter value is cached as CNT8 and counts again. The comparator compares CNT8 and CNT8P. If CNT8P is larger, the adder counter remains unchanged. If CNT8 is larger, the adder counter is increased by 4 and the CTRL value is increased to 8'h94. In this example, CNT8 is larger, the adder counter is increased by 4, and the CTRL value is increased to 8'h94. The current optimal CTRL value is between 8'h90 and 8'hA0. Since 8'h98 is better than 8'h90 and 8'hA0, the optimal CTRL value is most likely to appear between 8'h90 and 8'h98.

[0063] Step 11: Repeat the above steps until the optimal CTRL value or its range value is found after the ADC changes 15 times. Store the corresponding frequency and the current CTRL value, and whether it is a range value, etc. in the memory.

[0064] Step 12: When the crystal oscillator is connected to the circuit for the second time, read the CTRL value stored at the corresponding frequency and load it into the up / down counter. If the current value is already the optimal CTRL value, there is no need to adjust the CTRL value repeatedly. If the current value is within a certain range, repeat steps 2 to 11 to narrow the range until the optimal CTRL value is obtained.

[0065] As an optional embodiment, the digital control module 2 further includes:

[0066] Registers are respectively connected to the adder counter, the add-subtract counter, and the comparator, and are used to store the starting amplitude value, the estimated value, the actual value, the historical drive value, and the current drive value.

[0067] In the present invention, Figure 2As shown, the digital control module 2 is also provided with a register, which can store the starting amplitude value, the estimated value, the actual value, the historical driving value and the current driving value, and the register also has the function of data buffering, for example: before the comparator receives the starting amplitude value after the count transmitted by the adder counter, data buffering is performed; the stability of the scheme is improved.

[0068] As an optional embodiment, the programmable driving module 3 includes: a plurality of inverters composed of PMOS tubes and NMOS tubes.

[0069] In the present invention, Figure 3 As shown, the programmable driving module 3 is provided with an inverter composed of several groups of PMOS tubes and NMOS tubes. The inverter has the advantages of low output impedance and insensitivity to noise. In addition, the inverter also has low power consumption, high integration and good anti-interference ability.

[0070] It should be noted that Figure 3 In the figure, D0N[0]-D0N[n] represents the voltage input to the N-type MOS tube, D0[0]-D0[n] represents the voltage input to the P-type MOS tube, VDD represents the operating voltage, and VSS represents the common ground voltage. XA represents the voltage input to the gate of the MOS tube (the input voltage of the inverter), and XB represents the voltage output from the drain of the MOS tube (the output voltage of the inverter). The levels corresponding to XA and XB are opposite. Because the level of driving the P-type MOS tube and the level of driving the N-type MOS tube are opposite, a NOT gate is used between D0[n] and D0N[n]. In addition, when the levels of XA and D0N[n] are equal, the N-type MOS tubes are all turned on. At this time, the output level XB of the inverter is pulled up to VDD. Conversely, when the levels of XA and D0[n] are equal, the P-type MOS tubes are all turned on. At this time, the output level XB of the inverter is pulled down to VSS.

[0071] As an optional embodiment, it also includes:

[0072] The amplitude detector 5 has an input end connected to the crystal oscillator, and an output end connected to the input end of the ADC module 1 , and is used to amplify the analog voltage signal transmitted by the crystal oscillator and transmit the amplified analog voltage signal to the ADC module 1 .

[0073] In the present invention, the crystal oscillator start-up control circuit is further provided with an amplitude detector 5, which can amplify the analog voltage signal transmitted by the crystal oscillator, that is, receive the peak-to-peak value of the analog voltage signal transmitted by the crystal oscillator and amplify it, so as to facilitate the ADC module 1 to quantize the analog voltage signal.

[0074] As an optional embodiment, it also includes:

[0075] An internal clock module 6, the internal clock module 6 is connected to the control circuit and is used to transmit a preset clock signal to the control circuit, wherein the frequency of the preset clock signal is greater than a frequency threshold;

[0076] Accordingly, the control circuit is also used for:

[0077] After the oscillation amplitude value of the digital voltage signal changes for the first time, determining whether the oscillation amplitude value changes for the second time within a preset time period corresponding to the preset clock signal;

[0078] If the oscillation amplitude value changes for the second time within the preset time period corresponding to the preset clock signal, the adder counter is continuously controlled to count the changes in the oscillation amplitude value;

[0079] If the oscillation amplitude value does not change for the second time within the preset time period corresponding to the preset clock signal, a corresponding alarm is issued.

[0080] In the present invention, when the internal clock module 6 is not provided in the crystal oscillator start-up control circuit, the control circuit in the digital control module 2 can only control the adder counter to count the changes in the starting amplitude value. However, if the adder counter fails and can only identify the first change in the starting amplitude value, the comparator cannot obtain the two adjacent starting amplitude values ​​that have changed, resulting in the inability to carry out the subsequent control process and the inability to obtain the current driving value. Therefore, the crystal oscillator start-up control circuit provided in the present application is also provided with an internal clock module 6, and the internal clock module 6 can transmit a preset clock signal to the control circuit, so that the control circuit determines whether the starting amplitude value changes for the second time within the preset time period corresponding to the preset clock signal after the starting amplitude value of the digital voltage signal changes for the first time. If the starting amplitude value changes for the second time within the preset time period corresponding to the preset clock signal, the adder counter continues to be controlled to count the changes in the starting amplitude value; conversely, if the starting amplitude value does not change for the second time within the preset time period corresponding to the preset clock signal, a corresponding alarm is issued. It can accurately control the determination process of the current driving value according to the change of the starting amplitude value, and issue an alarm immediately after a problem occurs, which is convenient for subsequent maintenance and improves the reliability and accuracy of the solution.

[0081] It should be noted that after adding the amplitude detector 5 and the internal clock module 6, the structure of the crystal oscillator start control circuit is as follows: Figure 4 As shown, the module is introduced as follows:

[0082] The module ports of the programmable drive module 3 mainly include XA, XB, and CTRL, among which XA and XB are connected to the external crystal oscillator, and CTRL is connected to the output control bus of the digital control module 2. The main function of the module is to provide different drives for the external crystal oscillator, and at the same time be controlled by the digital control module 2. The module circuit structure includes multiple groups of inverter groups with different numbers of control P tubes and control N tubes.

[0083] The module ports of the digital control module 2 mainly include CTRL, D0, D1, and CLK, among which CTRL is connected to the programmable drive module 3, D0 is connected to the ADC module 1, D1 is connected to the memory module 4, and CLK is connected to the internal clock module 6. The main function of the module is to calculate and test the drive that best suits the current crystal frequency based on the ADC value (representing the different starting amplitudes of the crystal oscillator), and store the value in the memory, so that the CTRL value (historical drive value) of the corresponding frequency can be directly called the next time the crystal oscillator starts. The module circuit structure includes an adder counter, an adder-subtractor counter, a register, a comparator, and some control circuits. The main function of the adder counter is to calculate the time required for the ADC value to change. The implementation method is to count the changes in the D0 signal (digital voltage signal) to obtain the result CNTn (n is a non-zero natural number); the main function of the adder and subtracter counter is to change the CTRL value according to the result of the comparator and adjust the number of drive tubes of the programmable drive module 3. The implementation method is to increase or decrease the CTRL value according to the result of the comparator; the main function of the comparator is to determine whether the change in the drive controlled by the last CTRL has accelerated the start-up speed of the crystal oscillator. The implementation method is to estimate CNTn+1P based on CNTn and CNTn-1, and compare CNTn+1P with CNTn+1 to obtain the result; the register is used to cache the required CNTn value, CNTnP value, CTRL value, etc. for corresponding calculations.

[0084] The module ports of the amplitude detector 5 are mainly XA, XB, and VPP. Among them, XA and XB are connected to the external crystal oscillator, and VPP is connected to the ADC module 1. The main function of this module is to obtain the peak-to-peak value of the XA and XB signals (analog voltage signals) and amplify them, so as to facilitate the quantization processing of the VPP value by the ADC module 1.

[0085] ADC module 1, the module ports mainly include VPP and D0. Among them, VPP is connected to the amplitude detector 5, and D0 is connected to the digital control module 2. The main function of this module is to convert the continuous variable analog voltage signal VPP into a discrete digital voltage signal D0, which is convenient for the digital control module 2 to process.

[0086] Internal clock module 6, the module port mainly has CLK. CLK is connected to digital control module 2. The main function of this module is to generate a high-frequency clock signal for use by the digital control module 2 adder counter, adder and subtracter counter, etc.

[0087] The memory module 4 mainly has D1 as the port, which is connected to the digital control module 2. In addition, the memory module 4 requires clock, chip select, address and other signal lines, which are not described in detail here. The main function of this module is to store the corresponding CTRL value of the corresponding frequency, so that the CTRL value of the corresponding frequency can be directly called when the crystal oscillator starts oscillating next time.

[0088] The present invention also provides an embodiment corresponding to a crystal oscillator startup control method, which is applied to a crystal oscillator startup control circuit. The crystal oscillator startup control circuit includes: a programmable drive module 3, a digital control module 2, an ADC module 1 and a memory module 4; the method includes:

[0089] The analog voltage signal transmitted by the crystal oscillator is converted into a corresponding digital voltage signal through the ADC module 1;

[0090] When the crystal oscillator and the ADC module 1 are connected for the first time, the historical driving value transmitted by the memory module 4 is transmitted to the programmable driving module 3 through the digital control module 2, and the current driving value of the crystal oscillator that meets the preset adaptation condition is calculated according to the change of the starting amplitude value corresponding to the received digital voltage signal and the historical driving value, and the current driving value is sent to the memory module 4; the preset adaptation condition is an adaptation condition determined based on the deviation between the estimated value and the actual value of the starting amplitude value;

[0091] The programmable driving module 3 outputs a corresponding driving signal to the crystal oscillator based on the historical driving value or the current driving value to drive the crystal oscillator to start.

[0092] The crystal oscillator startup control method provided in this embodiment corresponds to the above-mentioned crystal oscillator startup control circuit, so it has the same beneficial effects as the above-mentioned crystal oscillator startup control circuit. Therefore, for the embodiments of the crystal oscillator startup control method, please refer to the description of the embodiments of the crystal oscillator startup control circuit, which will not be repeated here.

[0093] The present invention also provides a corresponding embodiment of an electronic device, comprising the crystal oscillator startup control circuit as described above.

[0094] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.

[0095] The electronic device provided in this embodiment corresponds to the above method and has the same beneficial effects as the above method. Therefore, for the embodiments of the electronic device part, please refer to the description of the embodiments of the method part, which will not be repeated here.

[0096] The present invention also provides an embodiment corresponding to a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the crystal oscillator startup control method as described above are implemented.

[0097] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0098] The computer-readable storage medium provided in this embodiment corresponds to the above method, and therefore has the same beneficial effects as the above method. Therefore, for the embodiments of the computer-readable storage medium part, please refer to the description of the embodiments of the method part, which will not be repeated here.

[0099] It should be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0100] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A crystal oscillator startup control circuit, characterized in that: include: Programmable drive module, digital control module, ADC module and memory module; The input end of the ADC module is connected to a crystal oscillator, and is used to convert the analog voltage signal transmitted by the crystal oscillator into a corresponding digital voltage signal; The input end of the digital control module is respectively connected to the output end of the memory module and the output end of the ADC module, and the output end is connected to the input end of the memory module, and is used to transmit the historical driving value transmitted by the memory module to the programmable driving module when the crystal oscillator and the ADC module are connected for the first time, and determine two adjacent starting amplitude values ​​that have changed in the starting amplitude value change according to the starting amplitude value change corresponding to the received digital voltage signal, and change the size of the historical driving value based on the estimated value of the starting amplitude value that will change next time determined by the two adjacent starting amplitude values, and transmit the changed historical driving value to the programmable driving module until a current driving value that meets the preset adaptation condition is calculated, and the current driving value is sent to the memory module; The preset adaptation condition is that the difference between the estimated value and the actual value of the starting amplitude value that changes next time is within a preset range; The input end of the programmable driving module is connected to the digital control module, and the output end is connected to the crystal oscillator, and is used to output a corresponding driving signal to the crystal oscillator based on the historical driving value or the current driving value to drive the crystal oscillator to start; The programmable driving module includes: a plurality of inverters composed of PMOS tubes and NMOS tubes; The programmable drive module is specifically used for: Based on the historical driving value or the current driving value, the plurality of inverters composed of PMOS tubes and NMOS tubes contained in the control unit are controlled, and a corresponding driving signal is output to the crystal oscillator to drive the crystal oscillator to start.

2. The crystal oscillator startup control circuit according to claim 1, characterized in that: The digital control module includes: an adder counter, an adder-subtractor counter, a comparator and a control circuit; The control circuit is connected to the ADC module, the memory module and the programmable driving module respectively, and is used to receive the digital voltage signal transmitted by the ADC module, receive the historical driving value transmitted by the memory module, and send the historical driving value or the current driving value to the programmable driving module; The adder counter is connected to the control circuit and is used for counting when the starting amplitude value changes according to the change of the starting amplitude value; The comparator is connected to the control circuit, and is used to determine the estimated value of the starting amplitude value that will change next time according to the two adjacent starting amplitude values ​​that have changed, and compare the estimated value with the actual value of the starting amplitude value that will change next time; The add-subtract counter is connected to the control circuit, and is used to change the size of the historical drive value based on the estimated value of the starting amplitude value that will change next time, and transmit the changed historical drive value to the programmable drive module through the control circuit; adjust the changed historical drive value based on the size relationship until the difference between the estimated value and the actual value is within a preset range, generate the current drive value, and transmit the current drive value to the programmable drive module through the control circuit.

3. The crystal oscillator startup control circuit according to claim 2, characterized in that: The digital control module further includes: A register, wherein the register is respectively connected to the adder counter, the add-subtract counter, and the comparator, and is used to store the starting amplitude value, the estimated value, the actual value, the historical driving value, and the current driving value.

4. The crystal oscillator startup control circuit according to claim 1, characterized in that: Also includes: An amplitude detector, the input end of which is connected to the crystal oscillator, and the output end of which is connected to the input end of the ADC module, is used to amplify the analog voltage signal transmitted by the crystal oscillator and transmit the amplified analog voltage signal to the ADC module.

5. The crystal oscillator startup control circuit according to claim 2 or 3, characterized in that: Also includes: An internal clock module, the internal clock module is connected to the control circuit and is used to transmit a preset clock signal to the control circuit, wherein the frequency of the preset clock signal is greater than a frequency threshold; Accordingly, the control circuit is also used for: After the oscillation amplitude value of the digital voltage signal changes for the first time, determining whether the oscillation amplitude value changes for the second time within a preset time period corresponding to the preset clock signal; If the oscillation amplitude value changes for the second time within the preset time period corresponding to the preset clock signal, continue to control the adder counter to count the changes in the oscillation amplitude value; If the oscillation amplitude value does not change for the second time within the preset time period corresponding to the preset clock signal, a corresponding alarm is issued.

6. A crystal oscillator startup control method, characterized in that: Applied to a crystal oscillator startup control circuit, the crystal oscillator startup control circuit includes: a programmable drive module, a digital control module, an ADC module and a memory module; the method includes: The ADC module converts the analog voltage signal transmitted by the crystal oscillator into a corresponding digital voltage signal; The historical driving value transmitted by the memory module is transmitted to the programmable driving module by the digital control module when the crystal oscillator and the ADC module are connected for the first time, and two adjacent starting amplitude values ​​that have changed in the starting amplitude value change are determined according to the starting amplitude value change corresponding to the received digital voltage signal, and the size of the historical driving value is changed based on the estimated value of the starting amplitude value that will change next time determined by the two adjacent starting amplitude values ​​that have changed, and the changed historical driving value is transmitted to the programmable driving module until a current driving value that meets a preset adaptation condition is calculated, and the current driving value is sent to the memory module; the preset adaptation condition is that the difference between the estimated value and the actual value of the starting amplitude value that will change next time is within a preset range; Outputting a corresponding driving signal to the crystal oscillator based on the historical driving value or the current driving value through the programmable driving module to drive the crystal oscillator to start; The programmable driving module includes: a plurality of inverters composed of PMOS tubes and NMOS tubes; The outputting a corresponding driving signal to the crystal oscillator based on the historical driving value or the current driving value to drive the crystal oscillator to start includes: Based on the historical driving value or the current driving value, the plurality of inverters composed of PMOS tubes and NMOS tubes contained in the control unit are controlled, and a corresponding driving signal is output to the crystal oscillator to drive the crystal oscillator to start.

7. An electronic device, characterized in that: It comprises the crystal oscillator startup control circuit as claimed in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the crystal oscillator startup control method according to claim 5 are implemented.