WO2018094893A1 - Method and device for calibrating signal amplitude, and computer storage medium - Google Patents

Method and device for calibrating signal amplitude, and computer storage medium Download PDF

Info

Publication number
WO2018094893A1
WO2018094893A1 PCT/CN2017/074954 CN2017074954W WO2018094893A1 WO 2018094893 A1 WO2018094893 A1 WO 2018094893A1 CN 2017074954 W CN2017074954 W CN 2017074954W WO 2018094893 A1 WO2018094893 A1 WO 2018094893A1
Authority
WO
WIPO (PCT)
Prior art keywords
signal
amplitude
value
current control
state
Prior art date
Application number
PCT/CN2017/074954
Other languages
French (fr)
Chinese (zh)
Inventor
李超
谢豪律
Original Assignee
深圳市中兴微电子技术有限公司
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 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2018094893A1 publication Critical patent/WO2018094893A1/en

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
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03LAUTOMATIC CONTROL, STARTING, SYNCHRONISATION OR STABILISATION OF GENERATORS OF ELECTRONIC OSCILLATIONS OR PULSES
    • H03L5/00Automatic control of voltage, current, or power

Definitions

  • the present invention relates to the field of crystal oscillator technology, and in particular, to a signal amplitude calibration method and apparatus, and a computer storage medium.
  • the crystal oscillator includes various types such as a DCXO (Digital Control Crystal Oscillator) and a Voltage Control Crystal Oscillator (VCXO).
  • the crystal oscillator circuit is widely used in modern wireless communication chip systems. It is usually composed of the following parts: an oscillating amplifier that provides the negative resistance required for oscillation, and an amplitude detection and control circuit for oscillating. Some designs also add temperature.
  • the compensation circuit corrects the drift of the oscillation frequency caused by the temperature change; wherein the oscillation amplitude detection and control circuit is used to ensure the start-up and/or the fast start.
  • the embodiment of the present invention provides a calibration method for signal amplitude.
  • the device the computer storage medium, can quickly calibrate the signal amplitude based on the current switch.
  • the current control signal is input to the crystal oscillator to adjust an amplitude value of a sinusoidal signal generated by the crystal oscillator.
  • the method further includes:
  • the level signal is compared with the first reference signal and the second reference signal, respectively, to obtain the first amplitude state signal and the second amplitude state signal, including:
  • the first amplitude state signal is characterized by a second value
  • the second amplitude state signal is characterized by a first value
  • the generating a current control signal according to the first amplitude state signal and the second amplitude state signal includes:
  • the current control signal is increased while the amplitude control time counter is cleared;
  • the current amplitude control signal is unchanged while the second magnitude state signal is characterized by the first value, while the amplitude control time counter continues to count.
  • the method before the generating the current control signal, the method further includes:
  • the initial value of the binary current control signal is half of an initial value of the current control signal.
  • the method further includes:
  • the amplitude control state machine enable signal is set to a first value, the first value indicating that the amplitude control state machine is enabled ;
  • the amplitude control time counter starts counting.
  • the generating a current control signal according to the first amplitude state signal and the second amplitude state signal includes:
  • the current current control signal is adjusted by subtracting the binary current control signal from the current control signal, simultaneously clearing the amplitude control time counter, halving the binary current control signal, and doubling the calibration time interval;
  • the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
  • the current control signal is unchanged when the second amplitude state signal is characterized by the first value; and the amplitude control time counter continues to count, halving the binary current control signal, And double the calibration interval.
  • the generating a current control signal according to the first amplitude state signal and the second amplitude state signal includes:
  • the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
  • the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
  • the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
  • the method further includes:
  • the amplitude control time counter When the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
  • the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
  • An oscillating module configured to generate a sinusoidal signal using a crystal oscillator
  • a detecting module configured to detect an amplitude value of the sinusoidal signal and convert the amplitude value into a corresponding level signal
  • the comparing module is configured to compare the level signal with the first reference signal and the second reference signal, respectively, to obtain a first amplitude state signal and a second amplitude state signal;
  • An amplitude control status module configured to generate a current control signal according to the first amplitude state signal and the second amplitude state signal; input the current control signal to the crystal oscillator to adjust a generated by the crystal oscillator The amplitude value of the sinusoidal signal.
  • the device further includes:
  • the reference signal generating module is configured to generate the first reference signal and the second reference signal, wherein the first reference signal is greater than the second reference signal.
  • the comparing module is further configured to: when the level signal is greater than or equal to the first reference signal, characterize the first amplitude state signal and the second amplitude state by using a first value signal;
  • the first amplitude state signal is characterized by a second value
  • the second amplitude state signal is characterized by a first value
  • the amplitude control state module is further configured to: when the first amplitude state signal and the second amplitude state signal are characterized by the first value, reduce the current control signal, and simultaneously control the amplitude The time counter is cleared;
  • the current control signal is increased while the amplitude control time counter is cleared;
  • the current amplitude control signal is unchanged while the second magnitude state signal is characterized by the first value, while the amplitude control time counter continues to count.
  • the device further includes: a setting unit configured to set initial values of the following parameters: a current control signal, a binary current control signal, an amplitude control time counter, a calibration time interval, an amplitude control state time, and an amplitude control state.
  • a setting unit configured to set initial values of the following parameters: a current control signal, a binary current control signal, an amplitude control time counter, a calibration time interval, an amplitude control state time, and an amplitude control state.
  • the initial value of the binary current control signal is half of an initial value of the current control signal.
  • the setting unit is further configured to set the amplitude control state machine enable signal to a first value when the falling edge of the clock signal and the rising edge of the first amplitude state signal are detected for the first time, The first value indicates that the amplitude control state machine is in an enabled state;
  • the amplitude control time counter starts counting.
  • the amplitude control status module is further configured to: determine whether the value of the amplitude control time counter is consistent with a calibration time interval; and when the value of the amplitude control time counter is consistent with a calibration time interval, determine Whether the binary current control signal is greater than the first value; when the binary current control signal is greater than the first value, performing one of the following operations:
  • the current current control signal is adjusted by: subtracting the binary current control signal from the current control signal; and simultaneously clearing the amplitude control time counter Zero, halve the binary current control signal, And multiplying the calibration interval;
  • the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
  • the current control signal is unchanged when the second amplitude state signal is characterized by the first value; and the amplitude control time counter continues to count, halving the binary current control signal, And double the calibration interval.
  • the amplitude control status module is further configured to: determine whether the value of the amplitude control time counter is consistent with a calibration time interval; and when the value of the amplitude control time counter is consistent with a calibration time interval, determine Whether the binary current control signal is equal to the first value; when the binary current control signal is equal to the first value, performing one of the following operations:
  • the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
  • the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
  • the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
  • the amplitude control time counter when the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
  • the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
  • the computer storage medium provided by the embodiment of the present invention stores a computer program configured to perform the calibration method of the signal amplitude.
  • a crystal oscillator is used to generate a sinusoidal signal; an amplitude value of the sinusoidal signal is detected, and the amplitude value is converted into a corresponding level signal; and the level signal is respectively associated with the first Comparing the reference signal and the second reference signal to obtain a first amplitude state signal and a second amplitude state signal; generating a current control signal according to the first amplitude state signal and the second amplitude state signal; inputting the current control signal To the crystal oscillator to adjust the amplitude value of the sinusoidal signal generated by the crystal oscillator.
  • a faster signal amplitude calibration can be achieved.
  • FIG. 1 is a schematic flow chart of a method for calibrating a signal amplitude according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a signal amplitude calibration apparatus according to an embodiment of the present invention.
  • FIG. 3 is a block diagram of amplitude control of a crystal oscillator according to an embodiment of the present invention.
  • FIG. 4 is a structural diagram of a basic circuit of a crystal oscillator according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an amplitude control process according to an embodiment of the present invention.
  • FIG. 6 is a flowchart showing the operation of an amplitude control state machine according to an embodiment of the present invention.
  • FIG. 7 is a timing waveform diagram of an amplitude control output according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a method for calibrating a signal amplitude according to an embodiment of the present invention. As shown in FIG. 1, the method for calibrating a signal amplitude includes the following steps:
  • Step 101 Generate a sinusoidal signal using a crystal oscillator.
  • Step 102 Detect an amplitude value of the sinusoidal signal and convert the amplitude value into a corresponding level signal.
  • Step 103 Compare the level signal with the first reference signal and the second reference signal, respectively, to obtain a first amplitude state signal and a second amplitude state signal.
  • the method further includes: generating a first reference signal and a second reference signal, wherein the first reference signal is greater than the second reference signal.
  • the level signal is compared with the first reference signal and the second reference signal, respectively, to obtain the first amplitude state signal and the second amplitude state signal, including:
  • the first amplitude state signal is characterized by a second value
  • the second amplitude state signal is characterized by a first value
  • Step 104 Generate a current control signal according to the first amplitude state signal and the second amplitude state signal.
  • the generating a current control signal according to the first amplitude state signal and the second amplitude state signal includes:
  • the current control signal is decreased while the amplitude control time counter is cleared;
  • the current control signal is increased while the amplitude control time counter is cleared;
  • Characterizing the first amplitude state signal by a second value characterizing the first value by the first value
  • the current control signal remains unchanged while the amplitude control time counter continues to count.
  • the method before the generating the current control signal, the method further includes:
  • the initial value of the binary current control signal is half of an initial value of the current control signal.
  • the amplitude control state machine enable signal is set to a first value, the first value indicating that the amplitude control state machine is The enable state; when the amplitude control state machine enable signal is the first value, the amplitude control time counter starts counting. Perform the steps in 1) and 2) below.
  • the current current control signal is adjusted by: subtracting the binary current control signal from the current control signal; and simultaneously clearing the amplitude control time counter Zero, halving the binary current control signal and doubling the calibration interval;
  • the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
  • Characterizing the first amplitude state signal by a second value characterizing the first value by the first value
  • the current control signal is unchanged; at the same time the amplitude control time counter continues to count, halving the binary current control signal, and doubling the calibration time interval.
  • the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
  • the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
  • the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
  • the method further includes:
  • the amplitude control time counter When the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
  • the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
  • Step 105 Input the current control signal to the crystal oscillator to adjust an amplitude value of a sinusoidal signal generated by the crystal oscillator.
  • FIG. 2 is a schematic structural diagram of a signal amplitude calibration apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus includes:
  • the oscillating module 21 is configured to generate a sinusoidal signal by using a crystal oscillator
  • the detecting module 22 is configured to detect an amplitude value of the sinusoidal signal and convert the amplitude value into a corresponding level signal;
  • the comparing module 23 is configured to compare the level signal with the first reference signal and the second reference signal respectively to obtain a first amplitude state signal and a second amplitude state signal;
  • the amplitude control state module 24 is configured to generate a current control signal according to the first amplitude state signal and the second amplitude state signal; input the current control signal to the crystal oscillator to adjust the crystal oscillator generation The amplitude value of the sinusoidal signal.
  • the device further includes:
  • the reference signal generating module 25 is configured to generate a first reference signal and a second reference signal, wherein the first reference signal is greater than the second reference signal.
  • the comparing module 23 is further configured to: when the level signal is greater than or equal to the first reference signal, characterize the first amplitude state signal and the second amplitude by using a first value Status signal
  • the first amplitude state signal is characterized by a second value
  • the second amplitude state signal is characterized by a first value
  • the amplitude control state module 24 is further configured to: when the first amplitude state signal and the second amplitude state signal are characterized by the first value, reduce the current control signal, and simultaneously increase the amplitude The control time counter is cleared;
  • the current control signal is increased while the amplitude control time counter is cleared;
  • the current control signal is unchanged, and the amplitude control time counter continues count.
  • the device further includes: a setting unit 26 configured to set initial values of the following parameters: a current control signal, a binary current control signal, an amplitude control time counter, a calibration time interval, an amplitude control state time, and an amplitude control State machine enable signal;
  • the initial value of the binary current control signal is half of an initial value of the current control signal.
  • the setting unit 26 is further configured to set the amplitude control state machine enable signal to the first value when the falling edge of the clock signal and the rising edge of the first amplitude state signal are detected for the first time.
  • the first value indicates that the amplitude control state machine is in an enabled state
  • the amplitude control time counter starts counting.
  • the amplitude control state module 24 is further configured to: determine whether the value of the amplitude control time counter is consistent with the calibration time interval; when the value of the amplitude control time counter is consistent with the calibration time interval, Determining whether the binary current control signal is greater than a first value; when the binary current control signal is greater than the first value, performing one of the following operations:
  • the current current control signal is adjusted by: subtracting the binary current control signal from the current control signal; and simultaneously clearing the amplitude control time counter Zero, halving the binary current control signal and doubling the calibration interval;
  • the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
  • the current control signal is unchanged when the second amplitude state signal is characterized by the first value; and the amplitude control time counter continues Count, halve the binary current control signal and double the calibration interval.
  • the amplitude control state module 24 is further configured to: determine whether the value of the amplitude control time counter is consistent with the calibration time interval; when the value of the amplitude control time counter is consistent with the calibration time interval, Determining whether the binary current control signal is equal to the first value; when the binary current control signal is equal to the first value, performing one of the following operations:
  • the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
  • the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
  • the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
  • the amplitude control time counter when the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
  • the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
  • each unit in the calibration device of the signal amplitude may be implemented by a central processing unit (CPU) or a microprocessor (Micro Processor Unit) located in the calibration device of the signal amplitude.
  • CPU central processing unit
  • MPU Micro Processor Unit
  • DSP Digital Signal Processor
  • FPGA Field Programmable Gate Array
  • each module in the calibration device of the illustrated signal amplitude can be realized by a program running on the processor, or can be realized by a specific logic circuit.
  • FIG. 3 is a block diagram of amplitude control of a crystal oscillator according to an embodiment of the present invention.
  • the functions of each module in the block diagram are as follows:
  • Oscillation core circuit Generates a sinusoidal signal.
  • Peak detector The module detects the amplitude of the sinusoidal signal output from the oscillating core circuit, and converts the amplitude value into a level signal Vpeak, which is sent to the comparator circuit (Comparator).
  • Reference Voltage Generator A reference signal required to generate a comparator.
  • the circuit generates two reference voltages Vh and Vl, and Vh > Vl, and the magnitudes of Vh and Vl can be changed by configuration.
  • the module contains two Comparators, and the reference voltages of the two Comparators are Vh and Vl.
  • Amplitude Control state machine according to the amplitude state signal (ampcntr_stateh and ampcntr_statel) output by the comparator circuit, the current control signal (ibias_cntr_d1) of the oscillation core circuit (OSC_core) is generated, and the oscillation core circuit is changed ( The current of OSC_core), which changes the amplitude of the output of the oscillating core circuit (OSC_core).
  • the crystal oscillator in this example is the oscillation core circuit (OSC_core) in FIG. 3, as shown in FIG. 4, the crystal oscillator includes The current source 41, an oscillating amplifier 42 that provides a negative resistance required for oscillation, a feedback resistor (Rf) 43, a crystal 44, a capacitor (C1) 45, and a capacitor (C2) 46.
  • the current control signal (ibias_cntr_d1) is input to the current source 41, and the current switch is used to control the current of the crystal oscillator, thereby controlling The magnitude of the crystal oscillator.
  • FIG. 5 is a diagram of an amplitude control process according to an embodiment of the present invention, in which a clock divider inputs a clock signal to each circuit.
  • the amplitude detector circuit receives the sinusoidal signal OSC_OUTP generated by the crystal oscillator, detects the amplitude value of the sinusoidal signal, and converts the amplitude value into a corresponding level signal Vpeak, and outputs Vpeak to the two channels separately.
  • Comparison circuit (Comparator).
  • the reference voltage generator generates two reference voltages Vcom_high (ie, Vh) and Vcom_low (ie, V1), which are respectively output to two comparator circuits (Comparator).
  • One of the comparison circuits compares Vpeak and Vcom_high, and outputs ampcntr_stateh as the first amplitude status signal; wherein the other comparison circuit compares Vpeak and Vcom_low, and outputs ampcntr_statel as the second amplitude status signal.
  • the Amplitude Control state machine generates a current control signal (ibias_cntr_d1) according to ampcntr_stateh and ampcntr_state1, and changes the current of the oscillating core circuit (OSC_core), thereby changing the amplitude of the output of the oscillating core circuit (OSC_core).
  • the Amplitude Control statet machine changes the input current of the oscillating core circuit (Osc_core) according to ampcntr_stateh and ampcntr_statel, thereby changing the output amplitude of the oscillating core circuit (Osc_core).
  • FIG. 6 is a flowchart of operation of an amplitude control state machine according to an embodiment of the present invention, where:
  • Step1 Initialization start process of the crystal oscillator.
  • the amplitude control time counter amp_cal_cnt 0.
  • the calibration time interval amp_cal_time 5'b00001, 5'b indicates that it is represented by a 5-bit binary, and 00001 is a specific binary value.
  • the amplitude control state time amp_stab_time 5'b11111, 5'b indicates that it is represented by a 5-bit binary, and 11111 is a specific binary value.
  • the amplitude control state machine enable signal amp_cntr_en 0.
  • Osc_core After Osc_core is enabled, Osc_core starts to generate a sinusoidal signal.
  • the amplitude detector detects the amplitude of the sinusoidal signal and sends it to the comparison circuit Comparator.
  • the comparison circuit sends the comparison results ampcntr_stateh and ampcntr_statel to the amplitude control state machine Amplitude Control statemachine.
  • ibias_cntr_d2 1 if the amplitude still does not meet the requirements, the amplitude calibration is started in unit step mode, and the current control only reduces or increases one bit per calibration. , ie ibias_cntr_d1-1 or +1, continues the amplitude calibration.
  • FIG. 7 is a waveform diagram of amplitude control output timing according to an embodiment of the present invention.
  • FIG. 7 is related to the process shown in FIG. 6, and the process of step 6 to step 7 can be used to effectively calibrate the amplitude quickly.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the device is implemented in a flow chart A function specified in a block or blocks of a process or multiple processes and/or block diagrams.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • embodiments of the present invention also provide a computer storage medium in which a computer program is stored, the computer program being configured to perform a method of calibrating a signal amplitude of an embodiment of the present invention.
  • a crystal oscillator is used to generate a sinusoidal signal; an amplitude value of the sinusoidal signal is detected, and the amplitude value is converted into a corresponding level signal; and the level signal is respectively associated with the first reference Comparing the signal with the second reference signal to obtain a first amplitude state signal and a second amplitude state signal; generating a current control signal according to the first amplitude state signal and the second amplitude state signal; inputting the current control signal to
  • the crystal oscillator is configured to adjust an amplitude value of a sinusoidal signal generated by the crystal oscillator.

Landscapes

  • Oscillators With Electromechanical Resonators (AREA)

Abstract

A method and a device for calibrating signal amplitude, and a computer storage medium, the method comprising: generating a sinusoidal signal using a crystal oscillator (101); detecting amplitude value of the sinusoidal signal, and converting the amplitude value into a corresponding level signal (102); comparing the level signal with each of a first reference signal and a second reference signal, to obtain a first amplitude status signal and a second amplitude status signal (103); generating a current control signal according to the first amplitude status signal and the second amplitude status signal (104); and inputting the current control signal to the crystal oscillator, so as to adjust the amplitude value of the sinusoidal signal generated by the crystal oscillator (105).

Description

一种信号幅度的校准方法及装置、计算机存储介质Method and device for calibrating signal amplitude, computer storage medium 技术领域Technical field
本发明涉及晶体振荡器技术领域,尤其涉及一种信号幅度的校准方法及装置、计算机存储介质。The present invention relates to the field of crystal oscillator technology, and in particular, to a signal amplitude calibration method and apparatus, and a computer storage medium.
背景技术Background technique
晶体振荡器包括数控晶体振荡器(DCXO,Digital Control Crystal Oscillator)和压控晶体振荡器(VCXO,Voltage Control Crystal Oscillator)等多种类型。晶体振荡器电路在现代无线通信芯片系统中得到广泛应用,通常由以下几部分组成:提供振荡所需负阻的振荡放大器,保证起振的振幅检测与控制电路,有的设计还会加上温度补偿电路来修正温度变化带来的振荡频率的漂移;其中,振荡幅度检测和控制电路用来保证起振和/或快速的启动。The crystal oscillator includes various types such as a DCXO (Digital Control Crystal Oscillator) and a Voltage Control Crystal Oscillator (VCXO). The crystal oscillator circuit is widely used in modern wireless communication chip systems. It is usually composed of the following parts: an oscillating amplifier that provides the negative resistance required for oscillation, and an amplitude detection and control circuit for oscillating. Some designs also add temperature. The compensation circuit corrects the drift of the oscillation frequency caused by the temperature change; wherein the oscillation amplitude detection and control circuit is used to ensure the start-up and/or the fast start.
在晶体振荡器起振后,对输出信号幅度进行很好的控制是提高晶体振荡器电路的可靠性,进而延长晶体寿命的有效方式;基于此,晶体振荡器电路如何对输出信号幅度进行很好的控制已成为亟待解决的问题。After the crystal oscillator starts to vibrate, good control of the output signal amplitude is an effective way to improve the reliability of the crystal oscillator circuit and thus extend the life of the crystal; based on this, how the crystal oscillator circuit performs well on the output signal amplitude. The control has become an urgent problem to be solved.
对输出信号幅度进行控制主要有两种方案,一种是采用模拟电路,控制偏置电压的方式改变电流,这种方式幅度校准速度虽然较快,但是会引入大量的噪声,导致晶体振荡器的噪声性能较差。另一种是采用调节电流开关的方式,在此方法中通常采用单位递增或递减的方式改变电流,这种方式虽然噪声性能较好,但是幅度校准的速度很慢。There are two main options for controlling the amplitude of the output signal. One is to use an analog circuit to change the current by controlling the bias voltage. In this way, although the amplitude calibration speed is faster, it introduces a large amount of noise, resulting in a crystal oscillator. The noise performance is poor. The other is to adjust the current switch. In this method, the current is usually changed by unit increment or decrement. This method has a good noise performance, but the amplitude calibration speed is very slow.
发明内容Summary of the invention
为解决上述技术问题,本发明实施例提供了一种信号幅度的校准方法 及装置、计算机存储介质,能够基于电流开关的方式对信号幅度进行快速校准。In order to solve the above technical problem, the embodiment of the present invention provides a calibration method for signal amplitude. And the device, the computer storage medium, can quickly calibrate the signal amplitude based on the current switch.
本发明实施例提供的信号幅度的校准方法,包括:A method for calibrating a signal amplitude provided by an embodiment of the present invention includes:
利用晶体振荡器产生正弦信号;Generating a sinusoidal signal using a crystal oscillator;
检测所述正弦信号的幅度值,并将所述幅度值转化为相应的电平信号;Detecting an amplitude value of the sinusoidal signal and converting the amplitude value into a corresponding level signal;
将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号;Comparing the level signal with the first reference signal and the second reference signal, respectively, to obtain a first amplitude state signal and a second amplitude state signal;
根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号;Generating a current control signal according to the first amplitude state signal and the second amplitude state signal;
将所述电流控制信号输入至所述晶体振荡器,以调整所述晶体振荡器产生的正弦信号的幅度值。The current control signal is input to the crystal oscillator to adjust an amplitude value of a sinusoidal signal generated by the crystal oscillator.
本发明实施例中,所述方法还包括:In the embodiment of the present invention, the method further includes:
产生第一参考信号和第二参考信号,其中,所述第一参考信号大于所述第二参考信号。Generating a first reference signal and a second reference signal, wherein the first reference signal is greater than the second reference signal.
本发明实施例中,所述将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号,包括:In the embodiment of the present invention, the level signal is compared with the first reference signal and the second reference signal, respectively, to obtain the first amplitude state signal and the second amplitude state signal, including:
当所述电平信号大于等于所述第一参考信号时,通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号;When the level signal is greater than or equal to the first reference signal, characterizing the first amplitude state signal and the second amplitude state signal by a first value;
当所述电平信号小于等于所述第二参考信号时,通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号;When the level signal is less than or equal to the second reference signal, characterizing the first amplitude state signal and the second amplitude state signal by a second value;
当所述电平信号大于所述第二参考信号且小于所述第一参考信号时,通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号。When the level signal is greater than the second reference signal and less than the first reference signal, the first amplitude state signal is characterized by a second value, and the second amplitude state signal is characterized by a first value.
本发明实施例中,所述根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号,包括:In the embodiment of the present invention, the generating a current control signal according to the first amplitude state signal and the second amplitude state signal includes:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号 时,减小电流控制信号,同时将幅度控制时间计数器清零;Characterizing the first amplitude state signal and the second amplitude state signal by a first value When the current control signal is decreased, the amplitude control time counter is cleared at the same time;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,增加电流控制信号,同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current control signal is increased while the amplitude control time counter is cleared;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变,同时幅度控制时间计数器继续计数。When the first amplitude state signal is characterized by a second value, the current amplitude control signal is unchanged while the second magnitude state signal is characterized by the first value, while the amplitude control time counter continues to count.
本发明实施例中,产生电流控制信号之前,所述方法还包括:In the embodiment of the present invention, before the generating the current control signal, the method further includes:
设置如下参数的初始值:电流控制信号、二分电流控制信号、幅度控制时间计数器、校准时间间隔、幅度控制状态时间、幅度控制状态机使能信号;Set the initial values of the following parameters: current control signal, binary current control signal, amplitude control time counter, calibration time interval, amplitude control state time, amplitude control state machine enable signal;
其中,所述二分电流控制信号的初始值为所述电流控制信号的初始值的一半。The initial value of the binary current control signal is half of an initial value of the current control signal.
本发明实施例中,所述方法还包括:In the embodiment of the present invention, the method further includes:
当首次检测到时钟信号的下降沿和第一幅度状态信号的上升沿时,将所述幅度控制状态机使能信号置为第一数值,所述第一数值表明幅度控制状态机处于使能状态;When the falling edge of the clock signal and the rising edge of the first amplitude state signal are detected for the first time, the amplitude control state machine enable signal is set to a first value, the first value indicating that the amplitude control state machine is enabled ;
当所述幅度控制状态机使能信号为第一数值时,所述幅度控制时间计数器开始计数。When the amplitude control state machine enable signal is the first value, the amplitude control time counter starts counting.
本发明实施例中,所述根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号,包括:In the embodiment of the present invention, the generating a current control signal according to the first amplitude state signal and the second amplitude state signal includes:
判断所述幅度控制时间计数器的值是否与校准时间间隔一致;Determining whether the value of the amplitude control time counter is consistent with a calibration time interval;
当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否大于第一数值;Determining whether the binary current control signal is greater than the first value when the value of the amplitude control time counter is consistent with the calibration time interval;
当所述二分电流控制信号大于第一数值时,执行以下操作之一:When the binary current control signal is greater than the first value, perform one of the following operations:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号 时,通过以下方式调整当前的电流控制信号:电流控制信号减去二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;Characterizing the first amplitude state signal and the second amplitude state signal by a first value The current current control signal is adjusted by subtracting the binary current control signal from the current control signal, simultaneously clearing the amplitude control time counter, halving the binary current control signal, and doubling the calibration time interval;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数,将二分电流控制信号减半,以及将校准时间间隔增倍。When the first amplitude state signal is characterized by the second value, the current control signal is unchanged when the second amplitude state signal is characterized by the first value; and the amplitude control time counter continues to count, halving the binary current control signal, And double the calibration interval.
本发明实施例中,所述根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号,包括:In the embodiment of the present invention, the generating a current control signal according to the first amplitude state signal and the second amplitude state signal includes:
判断所述幅度控制时间计数器的值是否与校准时间间隔一致;Determining whether the value of the amplitude control time counter is consistent with a calibration time interval;
当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否等于第一数值;Determining whether the binary current control signal is equal to the first value when the value of the amplitude control time counter coincides with the calibration time interval;
当所述二分电流控制信号等于第一数值时,执行以下操作之一:When the binary current control signal is equal to the first value, perform one of the following operations:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数。 When the first amplitude state signal is characterized by a second value, the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
本发明实施例中,调整当前的电流控制信号后,所述方法还包括:In the embodiment of the present invention, after the current current control signal is adjusted, the method further includes:
当所述幅度控制时间计数器清零时,幅度控制时间计数器重新开始计数,并重新调整当前的电流控制信号;When the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
当所述幅度控制时间计数器的值与所述幅度控制状态时间一致时,电流控制信号调整结束,将所述幅度控制状态机使能信号置为第二数值。When the value of the amplitude control time counter coincides with the amplitude control state time, the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
本发明实施例提供的信号幅度的校准装置,包括:The apparatus for calibrating the signal amplitude provided by the embodiment of the invention includes:
振荡模块,配置为利用晶体振荡器产生正弦信号;An oscillating module configured to generate a sinusoidal signal using a crystal oscillator;
检测模块,配置为检测所述正弦信号的幅度值,并将所述幅度值转化为相应的电平信号;a detecting module configured to detect an amplitude value of the sinusoidal signal and convert the amplitude value into a corresponding level signal;
比较模块,配置为将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号;The comparing module is configured to compare the level signal with the first reference signal and the second reference signal, respectively, to obtain a first amplitude state signal and a second amplitude state signal;
幅度控制状态模块,配置为根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号;将所述电流控制信号输入至所述晶体振荡器,以调整所述晶体振荡器产生的正弦信号的幅度值。An amplitude control status module configured to generate a current control signal according to the first amplitude state signal and the second amplitude state signal; input the current control signal to the crystal oscillator to adjust a generated by the crystal oscillator The amplitude value of the sinusoidal signal.
本发明实施例中,所述装置还包括:In the embodiment of the present invention, the device further includes:
参考信号产生模块,配置为产生第一参考信号和第二参考信号,其中,所述第一参考信号大于所述第二参考信号。The reference signal generating module is configured to generate the first reference signal and the second reference signal, wherein the first reference signal is greater than the second reference signal.
本发明实施例中,所述比较模块,还配置为:当所述电平信号大于等于所述第一参考信号时,通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号;In the embodiment of the present invention, the comparing module is further configured to: when the level signal is greater than or equal to the first reference signal, characterize the first amplitude state signal and the second amplitude state by using a first value signal;
当所述电平信号小于等于所述第二参考信号时,通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号;When the level signal is less than or equal to the second reference signal, characterizing the first amplitude state signal and the second amplitude state signal by a second value;
当所述电平信号大于所述第二参考信号且小于所述第一参考信号时,通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号。 When the level signal is greater than the second reference signal and less than the first reference signal, the first amplitude state signal is characterized by a second value, and the second amplitude state signal is characterized by a first value.
本发明实施例中,所述幅度控制状态模块,还配置为:当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,减小电流控制信号,同时将幅度控制时间计数器清零;In the embodiment of the present invention, the amplitude control state module is further configured to: when the first amplitude state signal and the second amplitude state signal are characterized by the first value, reduce the current control signal, and simultaneously control the amplitude The time counter is cleared;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,增加电流控制信号,同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current control signal is increased while the amplitude control time counter is cleared;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变,同时幅度控制时间计数器继续计数。When the first amplitude state signal is characterized by a second value, the current amplitude control signal is unchanged while the second magnitude state signal is characterized by the first value, while the amplitude control time counter continues to count.
本发明实施例中,所述装置还包括:设置单元,配置为设置如下参数的初始值:电流控制信号、二分电流控制信号、幅度控制时间计数器、校准时间间隔、幅度控制状态时间、幅度控制状态机使能信号;In the embodiment of the present invention, the device further includes: a setting unit configured to set initial values of the following parameters: a current control signal, a binary current control signal, an amplitude control time counter, a calibration time interval, an amplitude control state time, and an amplitude control state. Machine enable signal
其中,所述二分电流控制信号的初始值为所述电流控制信号的初始值的一半。The initial value of the binary current control signal is half of an initial value of the current control signal.
本发明实施例中,所述设置单元,还配置为当首次检测到时钟信号的下降沿和第一幅度状态信号的上升沿时,将所述幅度控制状态机使能信号置为第一数值,所述第一数值表明幅度控制状态机处于使能状态;In the embodiment of the present invention, the setting unit is further configured to set the amplitude control state machine enable signal to a first value when the falling edge of the clock signal and the rising edge of the first amplitude state signal are detected for the first time, The first value indicates that the amplitude control state machine is in an enabled state;
当所述幅度控制状态机使能信号为第一数值时,所述幅度控制时间计数器开始计数。When the amplitude control state machine enable signal is the first value, the amplitude control time counter starts counting.
本发明实施例中,所述幅度控制状态模块,还配置为:判断所述幅度控制时间计数器的值是否与校准时间间隔一致;当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否大于第一数值;当所述二分电流控制信号大于第一数值时,执行以下操作之一:In the embodiment of the present invention, the amplitude control status module is further configured to: determine whether the value of the amplitude control time counter is consistent with a calibration time interval; and when the value of the amplitude control time counter is consistent with a calibration time interval, determine Whether the binary current control signal is greater than the first value; when the binary current control signal is greater than the first value, performing one of the following operations:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半, 以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by: subtracting the binary current control signal from the current control signal; and simultaneously clearing the amplitude control time counter Zero, halve the binary current control signal, And multiplying the calibration interval;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数,将二分电流控制信号减半,以及将校准时间间隔增倍。When the first amplitude state signal is characterized by the second value, the current control signal is unchanged when the second amplitude state signal is characterized by the first value; and the amplitude control time counter continues to count, halving the binary current control signal, And double the calibration interval.
本发明实施例中,所述幅度控制状态模块,还配置为:判断所述幅度控制时间计数器的值是否与校准时间间隔一致;当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否等于第一数值;当所述二分电流控制信号等于第一数值时,执行以下操作之一:In the embodiment of the present invention, the amplitude control status module is further configured to: determine whether the value of the amplitude control time counter is consistent with a calibration time interval; and when the value of the amplitude control time counter is consistent with a calibration time interval, determine Whether the binary current control signal is equal to the first value; when the binary current control signal is equal to the first value, performing one of the following operations:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数。When the first amplitude state signal is characterized by a second value, the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
本发明实施例中,当所述幅度控制时间计数器清零时,幅度控制时间计数器重新开始计数,并重新调整当前的电流控制信号;In the embodiment of the present invention, when the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
当所述幅度控制时间计数器的值与所述幅度控制状态时间一致时,电流控制信号调整结束,将所述幅度控制状态机使能信号置为第二数值。 When the value of the amplitude control time counter coincides with the amplitude control state time, the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
本发明实施例提供的计算机存储介质存储有计算机程序,该计算机程序配置为执行上述信号幅度的校准方法。The computer storage medium provided by the embodiment of the present invention stores a computer program configured to perform the calibration method of the signal amplitude.
本发明实施例的技术方案中,利用晶体振荡器产生正弦信号;检测所述正弦信号的幅度值,并将所述幅度值转化为相应的电平信号;将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号;根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号;将所述电流控制信号输入至所述晶体振荡器,以调整所述晶体振荡器产生的正弦信号的幅度值。采用本发明实施例的技术方案,能够实现更快速的信号幅度校准。In the technical solution of the embodiment of the present invention, a crystal oscillator is used to generate a sinusoidal signal; an amplitude value of the sinusoidal signal is detected, and the amplitude value is converted into a corresponding level signal; and the level signal is respectively associated with the first Comparing the reference signal and the second reference signal to obtain a first amplitude state signal and a second amplitude state signal; generating a current control signal according to the first amplitude state signal and the second amplitude state signal; inputting the current control signal To the crystal oscillator to adjust the amplitude value of the sinusoidal signal generated by the crystal oscillator. With the technical solution of the embodiment of the invention, a faster signal amplitude calibration can be achieved.
附图说明DRAWINGS
附图以示例而非限制的方式大体示出了本文中所讨论的各个实施例。The drawings generally illustrate the various embodiments discussed herein by way of example and not limitation.
图1为本发明实施例的信号幅度的校准方法的流程示意图;1 is a schematic flow chart of a method for calibrating a signal amplitude according to an embodiment of the present invention;
图2为本发明实施例的信号幅度的校准装置的结构组成示意图;2 is a schematic structural diagram of a signal amplitude calibration apparatus according to an embodiment of the present invention;
图3为本发明实施例的晶体振荡器幅度控制框图;3 is a block diagram of amplitude control of a crystal oscillator according to an embodiment of the present invention;
图4为本发明实施例的晶体振荡器基本电路结构图;4 is a structural diagram of a basic circuit of a crystal oscillator according to an embodiment of the present invention;
图5为本发明实施例的幅度控制过程图;FIG. 5 is a schematic diagram of an amplitude control process according to an embodiment of the present invention; FIG.
图6为本发明实施例的幅度控制状态机的工作流程图;6 is a flowchart showing the operation of an amplitude control state machine according to an embodiment of the present invention;
图7为本发明实施例的幅度控制输出时序波形图。FIG. 7 is a timing waveform diagram of an amplitude control output according to an embodiment of the present invention.
具体实施方式detailed description
为了能够更加详尽地了解本发明实施例的特点与技术内容,下面结合附图对本发明实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本发明实施例。The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
图1为本发明实施例的信号幅度的校准方法的流程示意图,如图1所示,所述信号幅度的校准方法包括以下步骤: 1 is a schematic flowchart of a method for calibrating a signal amplitude according to an embodiment of the present invention. As shown in FIG. 1, the method for calibrating a signal amplitude includes the following steps:
步骤101:利用晶体振荡器产生正弦信号。Step 101: Generate a sinusoidal signal using a crystal oscillator.
步骤102:检测所述正弦信号的幅度值,并将所述幅度值转化为相应的电平信号。Step 102: Detect an amplitude value of the sinusoidal signal and convert the amplitude value into a corresponding level signal.
步骤103:将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号。Step 103: Compare the level signal with the first reference signal and the second reference signal, respectively, to obtain a first amplitude state signal and a second amplitude state signal.
本发明实施例中,所述方法还包括:产生第一参考信号和第二参考信号,其中,所述第一参考信号大于所述第二参考信号。In an embodiment of the invention, the method further includes: generating a first reference signal and a second reference signal, wherein the first reference signal is greater than the second reference signal.
本发明实施例中,所述将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号,包括:In the embodiment of the present invention, the level signal is compared with the first reference signal and the second reference signal, respectively, to obtain the first amplitude state signal and the second amplitude state signal, including:
当所述电平信号大于等于所述第一参考信号时,通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号;When the level signal is greater than or equal to the first reference signal, characterizing the first amplitude state signal and the second amplitude state signal by a first value;
当所述电平信号小于等于所述第二参考信号时,通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号;When the level signal is less than or equal to the second reference signal, characterizing the first amplitude state signal and the second amplitude state signal by a second value;
当所述电平信号大于所述第二参考信号且小于所述第一参考信号时,通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号。When the level signal is greater than the second reference signal and less than the first reference signal, the first amplitude state signal is characterized by a second value, and the second amplitude state signal is characterized by a first value.
步骤104:根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号。Step 104: Generate a current control signal according to the first amplitude state signal and the second amplitude state signal.
本发明实施例中,所述根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号,包括:In the embodiment of the present invention, the generating a current control signal according to the first amplitude state signal and the second amplitude state signal includes:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,减小电流控制信号,同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current control signal is decreased while the amplitude control time counter is cleared;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,增加电流控制信号,同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current control signal is increased while the amplitude control time counter is cleared;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述 第二幅度状态信号时,电流控制信号不变,同时幅度控制时间计数器继续计数。Characterizing the first amplitude state signal by a second value, characterizing the first value by the first value When the second amplitude status signal is present, the current control signal remains unchanged while the amplitude control time counter continues to count.
在一具体示例中,产生电流控制信号之前,所述方法还包括:In a specific example, before the generating the current control signal, the method further includes:
设置如下参数的初始值:电流控制信号、二分电流控制信号、幅度控制时间计数器、校准时间间隔、幅度控制状态时间、幅度控制状态机使能信号;Set the initial values of the following parameters: current control signal, binary current control signal, amplitude control time counter, calibration time interval, amplitude control state time, amplitude control state machine enable signal;
其中,所述二分电流控制信号的初始值为所述电流控制信号的初始值的一半。The initial value of the binary current control signal is half of an initial value of the current control signal.
基于此,当首次检测到时钟信号的下降沿和第一幅度状态信号的上升沿时,将所述幅度控制状态机使能信号置为第一数值,所述第一数值表明幅度控制状态机处于使能状态;当所述幅度控制状态机使能信号为第一数值时,所述幅度控制时间计数器开始计数。执行如下1)和2)中的步骤。Based on this, when the falling edge of the clock signal and the rising edge of the first amplitude state signal are detected for the first time, the amplitude control state machine enable signal is set to a first value, the first value indicating that the amplitude control state machine is The enable state; when the amplitude control state machine enable signal is the first value, the amplitude control time counter starts counting. Perform the steps in 1) and 2) below.
1)判断所述幅度控制时间计数器的值是否与校准时间间隔一致;1) determining whether the value of the amplitude control time counter is consistent with the calibration time interval;
当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否大于第一数值;Determining whether the binary current control signal is greater than the first value when the value of the amplitude control time counter is consistent with the calibration time interval;
当所述二分电流控制信号大于第一数值时,执行以下操作之一:When the binary current control signal is greater than the first value, perform one of the following operations:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by: subtracting the binary current control signal from the current control signal; and simultaneously clearing the amplitude control time counter Zero, halving the binary current control signal and doubling the calibration interval;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述 第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数,将二分电流控制信号减半,以及将校准时间间隔增倍。Characterizing the first amplitude state signal by a second value, characterizing the first value by the first value At the second amplitude state signal, the current control signal is unchanged; at the same time the amplitude control time counter continues to count, halving the binary current control signal, and doubling the calibration time interval.
2)判断所述幅度控制时间计数器的值是否与校准时间间隔一致;2) determining whether the value of the amplitude control time counter is consistent with the calibration time interval;
当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否等于第一数值;Determining whether the binary current control signal is equal to the first value when the value of the amplitude control time counter coincides with the calibration time interval;
当所述二分电流控制信号等于第一数值时,执行以下操作之一:When the binary current control signal is equal to the first value, perform one of the following operations:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数。When the first amplitude state signal is characterized by a second value, the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
本发明实施例中,调整当前的电流控制信号后,所述方法还包括:In the embodiment of the present invention, after the current current control signal is adjusted, the method further includes:
当所述幅度控制时间计数器清零时,幅度控制时间计数器重新开始计数,并重新调整当前的电流控制信号;When the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
当所述幅度控制时间计数器的值与所述幅度控制状态时间一致时,电流控制信号调整结束,将所述幅度控制状态机使能信号置为第二数值。When the value of the amplitude control time counter coincides with the amplitude control state time, the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
步骤105:将所述电流控制信号输入至所述晶体振荡器,以调整所述晶体振荡器产生的正弦信号的幅度值。Step 105: Input the current control signal to the crystal oscillator to adjust an amplitude value of a sinusoidal signal generated by the crystal oscillator.
图2为本发明实施例的信号幅度的校准装置的结构组成示意图,如图2所示,所述装置包括:2 is a schematic structural diagram of a signal amplitude calibration apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus includes:
振荡模块21,配置为利用晶体振荡器产生正弦信号; The oscillating module 21 is configured to generate a sinusoidal signal by using a crystal oscillator;
检测模块22,配置为检测所述正弦信号的幅度值,并将所述幅度值转化为相应的电平信号;The detecting module 22 is configured to detect an amplitude value of the sinusoidal signal and convert the amplitude value into a corresponding level signal;
比较模块23,配置为将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号;The comparing module 23 is configured to compare the level signal with the first reference signal and the second reference signal respectively to obtain a first amplitude state signal and a second amplitude state signal;
幅度控制状态模块24,配置为根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号;将所述电流控制信号输入至所述晶体振荡器,以调整所述晶体振荡器产生的正弦信号的幅度值。The amplitude control state module 24 is configured to generate a current control signal according to the first amplitude state signal and the second amplitude state signal; input the current control signal to the crystal oscillator to adjust the crystal oscillator generation The amplitude value of the sinusoidal signal.
本发明实施例中,所述装置还包括:In the embodiment of the present invention, the device further includes:
参考信号产生模块25,配置为产生第一参考信号和第二参考信号,其中,所述第一参考信号大于所述第二参考信号。The reference signal generating module 25 is configured to generate a first reference signal and a second reference signal, wherein the first reference signal is greater than the second reference signal.
本发明实施例中,所述比较模块23,还配置为:当所述电平信号大于等于所述第一参考信号时,通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号;In the embodiment of the present invention, the comparing module 23 is further configured to: when the level signal is greater than or equal to the first reference signal, characterize the first amplitude state signal and the second amplitude by using a first value Status signal
当所述电平信号小于等于所述第二参考信号时,通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号;When the level signal is less than or equal to the second reference signal, characterizing the first amplitude state signal and the second amplitude state signal by a second value;
当所述电平信号大于所述第二参考信号且小于所述第一参考信号时,通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号。When the level signal is greater than the second reference signal and less than the first reference signal, the first amplitude state signal is characterized by a second value, and the second amplitude state signal is characterized by a first value.
本发明实施例中,所述幅度控制状态模块24,还配置为:当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,减小电流控制信号,同时将幅度控制时间计数器清零;In the embodiment of the present invention, the amplitude control state module 24 is further configured to: when the first amplitude state signal and the second amplitude state signal are characterized by the first value, reduce the current control signal, and simultaneously increase the amplitude The control time counter is cleared;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,增加电流控制信号,同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current control signal is increased while the amplitude control time counter is cleared;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变,同时幅度控制时间计数器继续 计数。When the first amplitude state signal is characterized by a second value, when the second amplitude state signal is characterized by the first value, the current control signal is unchanged, and the amplitude control time counter continues count.
本发明实施例中,所述装置还包括:设置单元26,配置为设置如下参数的初始值:电流控制信号、二分电流控制信号、幅度控制时间计数器、校准时间间隔、幅度控制状态时间、幅度控制状态机使能信号;In the embodiment of the present invention, the device further includes: a setting unit 26 configured to set initial values of the following parameters: a current control signal, a binary current control signal, an amplitude control time counter, a calibration time interval, an amplitude control state time, and an amplitude control State machine enable signal;
其中,所述二分电流控制信号的初始值为所述电流控制信号的初始值的一半。The initial value of the binary current control signal is half of an initial value of the current control signal.
本发明实施例中,所述设置单元26,还配置为当首次检测到时钟信号的下降沿和第一幅度状态信号的上升沿时,将所述幅度控制状态机使能信号置为第一数值,所述第一数值表明幅度控制状态机处于使能状态;In the embodiment of the present invention, the setting unit 26 is further configured to set the amplitude control state machine enable signal to the first value when the falling edge of the clock signal and the rising edge of the first amplitude state signal are detected for the first time. The first value indicates that the amplitude control state machine is in an enabled state;
当所述幅度控制状态机使能信号为第一数值时,所述幅度控制时间计数器开始计数。When the amplitude control state machine enable signal is the first value, the amplitude control time counter starts counting.
本发明实施例中,所述幅度控制状态模块24,还配置为:判断所述幅度控制时间计数器的值是否与校准时间间隔一致;当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否大于第一数值;当所述二分电流控制信号大于第一数值时,执行以下操作之一:In the embodiment of the present invention, the amplitude control state module 24 is further configured to: determine whether the value of the amplitude control time counter is consistent with the calibration time interval; when the value of the amplitude control time counter is consistent with the calibration time interval, Determining whether the binary current control signal is greater than a first value; when the binary current control signal is greater than the first value, performing one of the following operations:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by: subtracting the binary current control signal from the current control signal; and simultaneously clearing the amplitude control time counter Zero, halving the binary current control signal and doubling the calibration interval;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续 计数,将二分电流控制信号减半,以及将校准时间间隔增倍。When the first amplitude state signal is characterized by a second value, the current control signal is unchanged when the second amplitude state signal is characterized by the first value; and the amplitude control time counter continues Count, halve the binary current control signal and double the calibration interval.
本发明实施例中,所述幅度控制状态模块24,还配置为:判断所述幅度控制时间计数器的值是否与校准时间间隔一致;当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否等于第一数值;当所述二分电流控制信号等于第一数值时,执行以下操作之一:In the embodiment of the present invention, the amplitude control state module 24 is further configured to: determine whether the value of the amplitude control time counter is consistent with the calibration time interval; when the value of the amplitude control time counter is consistent with the calibration time interval, Determining whether the binary current control signal is equal to the first value; when the binary current control signal is equal to the first value, performing one of the following operations:
当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数。When the first amplitude state signal is characterized by a second value, the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
本发明实施例中,当所述幅度控制时间计数器清零时,幅度控制时间计数器重新开始计数,并重新调整当前的电流控制信号;In the embodiment of the present invention, when the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
当所述幅度控制时间计数器的值与所述幅度控制状态时间一致时,电流控制信号调整结束,将所述幅度控制状态机使能信号置为第二数值。When the value of the amplitude control time counter coincides with the amplitude control state time, the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
在实际应用中,所述信号幅度的校准装置中的各个单元所实现的功能,均可由位于信号幅度的校准装置中的中央处理器(Central Processing Unit,CPU)、或微处理器(Micro Processor Unit,MPU)、或数字信号处理器(Digital Signal Processor,DSP)、或现场可编程门阵列(Field Programmable Gate Array,FPGA)等实现。In practical applications, the functions implemented by each unit in the calibration device of the signal amplitude may be implemented by a central processing unit (CPU) or a microprocessor (Micro Processor Unit) located in the calibration device of the signal amplitude. , MPU), or Digital Signal Processor (DSP), or Field Programmable Gate Array (FPGA) implementation.
本领域技术人员应当理解,图2所示的信号幅度的校准装置中的各模块的实现功能可参照前述信号幅度的校准方法的相关描述而理解。图2所 示的信号幅度的校准装置中的各模块的功能可通过运行于处理器上的程序而实现,也可通过具体的逻辑电路而实现。It will be understood by those skilled in the art that the implementation functions of the modules in the calibration apparatus of the signal amplitude shown in FIG. 2 can be understood by referring to the related description of the calibration method of the aforementioned signal amplitude. Figure 2 The function of each module in the calibration device of the illustrated signal amplitude can be realized by a program running on the processor, or can be realized by a specific logic circuit.
下面结合具体晶体振荡器电路对本发明实施例的信号幅度的校准方法做进一步详细描述。The method for calibrating the signal amplitude of the embodiment of the present invention will be further described in detail below with reference to a specific crystal oscillator circuit.
参照图3,图3为本发明实施例的晶体振荡器幅度控制框图,框图中的各个模块的功能如下:Referring to FIG. 3, FIG. 3 is a block diagram of amplitude control of a crystal oscillator according to an embodiment of the present invention. The functions of each module in the block diagram are as follows:
1)振荡核心电路(OSC_core):产生正弦信号。1) Oscillation core circuit (OSC_core): Generates a sinusoidal signal.
2)幅度检测电路(Peak detector):模块检测振荡核心电路输出的正弦信号的幅度,并将幅度值转换为电平信号Vpeak,送到比较电路(Comparator)。2) Peak detector: The module detects the amplitude of the sinusoidal signal output from the oscillating core circuit, and converts the amplitude value into a level signal Vpeak, which is sent to the comparator circuit (Comparator).
3)参考信号产生电路(Reference Voltage Generator):产生比较电路(Comparator)需要的参考信号。该电路产生2个参考电压Vh和Vl,且Vh>Vl,可以通过配置改变Vh和Vl的大小。3) Reference Voltage Generator: A reference signal required to generate a comparator. The circuit generates two reference voltages Vh and Vl, and Vh > Vl, and the magnitudes of Vh and Vl can be changed by configuration.
4)比较电路(Comparator):该模块包含两个Comparator,两个Comparator的参考电压分别为Vh和Vl。4) Comparator: The module contains two Comparators, and the reference voltages of the two Comparators are Vh and Vl.
5)幅度控制状态机(Amplitude Control state machine):根据比较电路(Comparator)输出的幅度状态信号(ampcntr_stateh和ampcntr_statel),产生振荡核心电路(OSC_core)的电流控制信号(ibias_cntr_d1),改变振荡核心电路(OSC_core)的电流,从而改变振荡核心电路(OSC_core)输出的幅度。5) Amplitude Control state machine: according to the amplitude state signal (ampcntr_stateh and ampcntr_statel) output by the comparator circuit, the current control signal (ibias_cntr_d1) of the oscillation core circuit (OSC_core) is generated, and the oscillation core circuit is changed ( The current of OSC_core), which changes the amplitude of the output of the oscillating core circuit (OSC_core).
参照图4,图4为本发明实施例的晶体振荡器基本电路结构图,本示例中的晶体振荡器即为图3中的振荡核心电路(OSC_core),如图4所示,晶体振荡器包括电流源41、提供振荡所需负阻的振荡放大器42、反馈电阻(Rf)43、晶体44、电容(C1)45、电容(C2)46。其中,电流控制信号(ibias_cntr_d1)输入至电流源41,通过电流开关来控制晶体振荡器的电流大小,进而控制 晶体振荡器的幅度大小。4 is a basic circuit structure diagram of a crystal oscillator according to an embodiment of the present invention. The crystal oscillator in this example is the oscillation core circuit (OSC_core) in FIG. 3, as shown in FIG. 4, the crystal oscillator includes The current source 41, an oscillating amplifier 42 that provides a negative resistance required for oscillation, a feedback resistor (Rf) 43, a crystal 44, a capacitor (C1) 45, and a capacitor (C2) 46. Wherein, the current control signal (ibias_cntr_d1) is input to the current source 41, and the current switch is used to control the current of the crystal oscillator, thereby controlling The magnitude of the crystal oscillator.
参照图5,图5为本发明实施例的幅度控制过程图,其中,时钟分频器(Clock divider)将时钟信号输入至各个电路中。幅度检测电路(Peak detector)接收晶体振荡器产生的正弦信号OSC_OUTP,检测所述正弦信号的幅度值,并将所述幅度值转化为相应的电平信号Vpeak,将Vpeak分两路分别输出给两个比较电路(Comparator)。参考信号产生电路(Reference Voltage Generator)产生2个参考电压Vcom_high(也即Vh)和Vcom_low(也即Vl),分别输出给两个比较电路(Comparator)。其中一个比较电路(Comparator)比较Vpeak与Vcom_high,输出ampcntr_stateh作为第一幅度状态信号;其中另一个比较电路(Comparator)比较Vpeak与Vcom_low,输出ampcntr_statel作为第二幅度状态信号。幅度控制状态机(Amplitude Control state machine)根据ampcntr_stateh和ampcntr_statel,产生电流控制信号(ibias_cntr_d1),改变振荡核心电路(OSC_core)的电流,从而改变振荡核心电路(OSC_core)输出的幅度。Referring to FIG. 5, FIG. 5 is a diagram of an amplitude control process according to an embodiment of the present invention, in which a clock divider inputs a clock signal to each circuit. The amplitude detector circuit (Peak detector) receives the sinusoidal signal OSC_OUTP generated by the crystal oscillator, detects the amplitude value of the sinusoidal signal, and converts the amplitude value into a corresponding level signal Vpeak, and outputs Vpeak to the two channels separately. Comparison circuit (Comparator). The reference voltage generator generates two reference voltages Vcom_high (ie, Vh) and Vcom_low (ie, V1), which are respectively output to two comparator circuits (Comparator). One of the comparison circuits compares Vpeak and Vcom_high, and outputs ampcntr_stateh as the first amplitude status signal; wherein the other comparison circuit compares Vpeak and Vcom_low, and outputs ampcntr_statel as the second amplitude status signal. The Amplitude Control state machine generates a current control signal (ibias_cntr_d1) according to ampcntr_stateh and ampcntr_state1, and changes the current of the oscillating core circuit (OSC_core), thereby changing the amplitude of the output of the oscillating core circuit (OSC_core).
本发明实施例中,比较电路(Comparator)进行比较的过程如下:当Vpeak≥Vh时,输出ampcntr_stateh=1、ampcntr_statel=1;当Vpeak≤Vl时,输出ampcntr_stateh=0、ampcntr_statel=0;当Vl<Vpeak<Vh时,输出ampcntr_stateh=0、ampcntr_statel=1。输出的ampcntr_stateh和ampcntr_statel送到下一模块幅度控制状态机(Amplitude Control statet machine)。幅度控制状态机(Amplitude Control statet machine)根据ampcntr_stateh和ampcntr_statel,改变振荡核心电路(Osc_core)的输入电流,从而改变振荡核心电路(Osc_core)的输出幅度。其中,当ampcntr_stateh=1、ampcntr_statel=1时,电流控制信号(ibias_cntr_d1)减小,同时幅度控制时间计数器清零;当ampcntr_stateh=0、ampcntr_statel=0时,电流控制信号(ibias_cntr_d1)增加,同时幅度控制时间计数器清零;当ampcntr_stateh=0、 ampcntr_statel=1时,电流控制信号(ibias_cntr_d1)不变,同时幅度控制时间计数器不清零,继续计数。In the embodiment of the present invention, the comparison circuit (Comparator) performs the comparison process as follows: when Vpeak≥Vh, the output ampcntr_stateh=1, ampcntr_statel=1; when Vpeak≤Vl, the output ampcntr_stateh=0, ampcntr_statel=0; when Vl< When Vpeak<Vh, the output ampcntr_stateh=0, ampcntr_statel=1. The output of ampcntr_stateh and ampcntr_statel is sent to the next module Amplitude Control statet machine. The Amplitude Control statet machine changes the input current of the oscillating core circuit (Osc_core) according to ampcntr_stateh and ampcntr_statel, thereby changing the output amplitude of the oscillating core circuit (Osc_core). Wherein, when ampcntr_stateh=1, ampcntr_statel=1, the current control signal (ibias_cntr_d1) decreases, and the amplitude control time counter is cleared; when ampcntr_stateh=0, ampcntr_statel=0, the current control signal (ibias_cntr_d1) increases, and the amplitude control The time counter is cleared; when ampcntr_stateh=0, When ampcntr_statel=1, the current control signal (ibias_cntr_d1) is unchanged, and the amplitude control time counter is not cleared, and counting continues.
参照图6,图6为本发明实施例的幅度控制状态机的工作流程图,其中:Referring to FIG. 6, FIG. 6 is a flowchart of operation of an amplitude control state machine according to an embodiment of the present invention, where:
step1:晶体振荡器的初始化启动过程,开始时,Osc_core的电流控制信号ibias_cntr_d1置为最大值,即ibias_cntr_d1=4'b1111,4'b表示通过4比特二进制表示,1111为具体的二进制值。二分电流控制信号ibias_cntr_d2为电流控制信号的一半,即ibias_cntr_d2=ibias_cntr_d1>>1,其中,>>为右移符号。幅度控制时间计数器amp_cal_cnt=0。校准时间间隔amp_cal_time=5'b00001,5'b表示通过5比特二进制表示,00001为具体的二进制值。幅度控制状态时间amp_stab_time=5'b11111,5'b表示通过5比特二进制表示,11111为具体的二进制值。幅度控制状态机使能信号amp_cntr_en=0。Step1: Initialization start process of the crystal oscillator. At the beginning, the current control signal ibias_cntr_d1 of Osc_core is set to the maximum value, that is, ibias_cntr_d1=4'b1111, 4'b represents a 4-bit binary representation, and 1111 is a specific binary value. The binary current control signal ibias_cntr_d2 is half of the current control signal, ie ibias_cntr_d2=ibias_cntr_d1>>1, where >> is a right shift symbol. The amplitude control time counter amp_cal_cnt=0. The calibration time interval amp_cal_time=5'b00001, 5'b indicates that it is represented by a 5-bit binary, and 00001 is a specific binary value. The amplitude control state time amp_stab_time=5'b11111, 5'b indicates that it is represented by a 5-bit binary, and 11111 is a specific binary value. The amplitude control state machine enable signal amp_cntr_en=0.
Osc_core使能后,Osc_core开始产生正弦信号,幅度检测模块Peak detector检测正弦信号的幅度,并送给比较电路Comparator,比较电路将比较结果ampcntr_stateh和ampcntr_statel送给幅度控制状态机Amplitude Control statemachine。幅度控制状态机通过检测比较器的输出ampcntr_stateh和时钟信号osc_out_clk,当第一次检测到osc_out_clk的下降沿和ampcntr_stateh的上升沿时,开启幅度控制状态机,此时amp_cntr_en=1,幅度控制时间计数器开始计数。After Osc_core is enabled, Osc_core starts to generate a sinusoidal signal. The amplitude detector detects the amplitude of the sinusoidal signal and sends it to the comparison circuit Comparator. The comparison circuit sends the comparison results ampcntr_stateh and ampcntr_statel to the amplitude control state machine Amplitude Control statemachine. The amplitude control state machine detects the output of the comparator ampcntr_stateh and the clock signal osc_out_clk. When the falling edge of osc_out_clk and the rising edge of ampcntr_stateh are detected for the first time, the amplitude control state machine is turned on. At this time, amp_cntr_en=1, the amplitude control time counter starts. count.
step2~6:当amp_cntr_en=1时,幅度控制时间计数器开始计数。开始时,ibias_cntr_d2>1,采用二分法改变二分电流控制信号,进行幅度校准,以实现幅度校准的快速收敛,同时随着二分法步数的增加,校准的时间间隔amp_cal_time增大一倍,电流变化的校准时间间隔ibias_cntr_d2减小一倍,直到变为1时,二分法结束。采用这种随着二分法步进的同时,增加振荡器的稳定时间的方法,不仅能够实现幅度的快速校准,也能保证晶振 的幅度校准达到要求的精度。Step2~6: When amp_cntr_en=1, the amplitude control time counter starts counting. At the beginning, ibias_cntr_d2>1, the dichotomy current control signal is changed by the dichotomy method, and the amplitude calibration is performed to achieve the fast convergence of the amplitude calibration. At the same time, as the number of dichotomous steps increases, the calibration time interval amp_cal_time is doubled, and the current changes. The calibration interval ibias_cntr_d2 is doubled until it becomes 1, the dichotomy ends. By adopting this method of increasing the stabilization time of the oscillator while stepping with the dichotomy, not only the rapid calibration of the amplitude but also the crystal oscillator can be ensured. The amplitude calibration achieves the required accuracy.
在step2~6的过程中,当二分法结束时,此时ibias_cntr_d2=1,如果幅度仍未达到要求,开始采用单位步进的方式进行幅度校准,电流控制每次校准只减小或增加一位,即ibias_cntr_d1-1或+1的方式继续进行幅度校准。In the process of step 2~6, when the dichotomy ends, ibias_cntr_d2=1, if the amplitude still does not meet the requirements, the amplitude calibration is started in unit step mode, and the current control only reduces or increases one bit per calibration. , ie ibias_cntr_d1-1 or +1, continues the amplitude calibration.
step7:在step2~6的过程中,当检测到幅度控制时间计数器amp_cal_cnt=amp_stab_time时,校准结束,关闭幅度校准。Step7: In the process of steps 2 to 6, when the amplitude control time counter amp_cal_cnt=amp_stab_time is detected, the calibration ends and the amplitude calibration is turned off.
参照图7,图7为本发明实施例的幅度控制输出时序波形图,图7参照图6所示的步骤,从step6到step7的过程可见,本发明实施例能够快速对幅度进行有效校准。Referring to FIG. 7, FIG. 7 is a waveform diagram of amplitude control output timing according to an embodiment of the present invention. FIG. 7 is related to the process shown in FIG. 6, and the process of step 6 to step 7 can be used to effectively calibrate the amplitude quickly.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个 流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The device is implemented in a flow chart A function specified in a block or blocks of a process or multiple processes and/or block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
相应地,本发明实施例还提供一种计算机存储介质,其中存储有计算机程序,该计算机程序配置为执行本发明实施例的信号幅度的校准方法。Accordingly, embodiments of the present invention also provide a computer storage medium in which a computer program is stored, the computer program being configured to perform a method of calibrating a signal amplitude of an embodiment of the present invention.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
工业实用性Industrial applicability
本发明实施例的技术方案,利用晶体振荡器产生正弦信号;检测所述正弦信号的幅度值,并将所述幅度值转化为相应的电平信号;将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号;根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号;将所述电流控制信号输入至所述晶体振荡器,以调整所述晶体振荡器产生的正弦信号的幅度值。采用本发明实施例的技术方案,能够实现更快速的信号幅度校准。 In the technical solution of the embodiment of the present invention, a crystal oscillator is used to generate a sinusoidal signal; an amplitude value of the sinusoidal signal is detected, and the amplitude value is converted into a corresponding level signal; and the level signal is respectively associated with the first reference Comparing the signal with the second reference signal to obtain a first amplitude state signal and a second amplitude state signal; generating a current control signal according to the first amplitude state signal and the second amplitude state signal; inputting the current control signal to The crystal oscillator is configured to adjust an amplitude value of a sinusoidal signal generated by the crystal oscillator. With the technical solution of the embodiment of the invention, a faster signal amplitude calibration can be achieved.

Claims (19)

  1. 一种信号幅度的校准方法,所述方法包括:A method of calibrating signal amplitude, the method comprising:
    利用晶体振荡器产生正弦信号;Generating a sinusoidal signal using a crystal oscillator;
    检测所述正弦信号的幅度值,并将所述幅度值转化为相应的电平信号;Detecting an amplitude value of the sinusoidal signal and converting the amplitude value into a corresponding level signal;
    将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号;Comparing the level signal with the first reference signal and the second reference signal, respectively, to obtain a first amplitude state signal and a second amplitude state signal;
    根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号;Generating a current control signal according to the first amplitude state signal and the second amplitude state signal;
    将所述电流控制信号输入至所述晶体振荡器,以调整所述晶体振荡器产生的正弦信号的幅度值。The current control signal is input to the crystal oscillator to adjust an amplitude value of a sinusoidal signal generated by the crystal oscillator.
  2. 根据权利要求1所述的信号幅度的校准方法,其中,所述方法还包括:The method of calibrating a signal amplitude according to claim 1, wherein the method further comprises:
    产生第一参考信号和第二参考信号,其中,所述第一参考信号大于所述第二参考信号。Generating a first reference signal and a second reference signal, wherein the first reference signal is greater than the second reference signal.
  3. 根据权利要求2所述的信号幅度的校准方法,其中,所述将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号,包括:The method for calibrating a signal amplitude according to claim 2, wherein said comparing said level signal with a first reference signal and a second reference signal respectively, to obtain a first amplitude state signal and a second amplitude state signal, include:
    当所述电平信号大于等于所述第一参考信号时,通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号;When the level signal is greater than or equal to the first reference signal, characterizing the first amplitude state signal and the second amplitude state signal by a first value;
    当所述电平信号小于等于所述第二参考信号时,通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号;When the level signal is less than or equal to the second reference signal, characterizing the first amplitude state signal and the second amplitude state signal by a second value;
    当所述电平信号大于所述第二参考信号且小于所述第一参考信号时,通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号。When the level signal is greater than the second reference signal and less than the first reference signal, the first amplitude state signal is characterized by a second value, and the second amplitude state signal is characterized by a first value.
  4. 根据权利要求3所述的信号幅度的校准方法,其中,所述根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号,包括: The method of calibrating a signal amplitude according to claim 3, wherein said generating a current control signal according to said first amplitude state signal and said second amplitude state signal comprises:
    当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,减小电流控制信号,同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current control signal is decreased while the amplitude control time counter is cleared;
    当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,增加电流控制信号,同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current control signal is increased while the amplitude control time counter is cleared;
    当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变,同时幅度控制时间计数器继续计数。When the first amplitude state signal is characterized by a second value, the current amplitude control signal is unchanged while the second magnitude state signal is characterized by the first value, while the amplitude control time counter continues to count.
  5. 根据权利要求1所述的信号幅度的校准方法,其中,产生电流控制信号之前,所述方法还包括:The method of calibrating a signal amplitude according to claim 1, wherein before the generating the current control signal, the method further comprises:
    设置如下参数的初始值:电流控制信号、二分电流控制信号、幅度控制时间计数器、校准时间间隔、幅度控制状态时间、幅度控制状态机使能信号;Set the initial values of the following parameters: current control signal, binary current control signal, amplitude control time counter, calibration time interval, amplitude control state time, amplitude control state machine enable signal;
    其中,所述二分电流控制信号的初始值为所述电流控制信号的初始值的一半。The initial value of the binary current control signal is half of an initial value of the current control signal.
  6. 根据权利要求5所述的信号幅度的校准方法,其中,所述方法还包括:The method of calibrating a signal amplitude according to claim 5, wherein the method further comprises:
    当首次检测到时钟信号的下降沿和第一幅度状态信号的上升沿时,将所述幅度控制状态机使能信号置为第一数值,所述第一数值表明幅度控制状态机处于使能状态;When the falling edge of the clock signal and the rising edge of the first amplitude state signal are detected for the first time, the amplitude control state machine enable signal is set to a first value, the first value indicating that the amplitude control state machine is enabled ;
    当所述幅度控制状态机使能信号为第一数值时,所述幅度控制时间计数器开始计数。When the amplitude control state machine enable signal is the first value, the amplitude control time counter starts counting.
  7. 根据权利要求5所述的信号幅度的校准方法,其中,所述根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号,包括:The method of calibrating a signal amplitude according to claim 5, wherein said generating a current control signal according to said first amplitude state signal and said second amplitude state signal comprises:
    判断所述幅度控制时间计数器的值是否与校准时间间隔一致;Determining whether the value of the amplitude control time counter is consistent with a calibration time interval;
    当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二 分电流控制信号是否大于第一数值;Determining the second when the value of the amplitude control time counter coincides with the calibration time interval Whether the divided current control signal is greater than the first value;
    当所述二分电流控制信号大于第一数值时,执行以下操作之一:When the binary current control signal is greater than the first value, perform one of the following operations:
    当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by: subtracting the binary current control signal from the current control signal; and simultaneously clearing the amplitude control time counter Zero, halving the binary current control signal and doubling the calibration interval;
    当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
    当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数,将二分电流控制信号减半,以及将校准时间间隔增倍。When the first amplitude state signal is characterized by the second value, the current control signal is unchanged when the second amplitude state signal is characterized by the first value; and the amplitude control time counter continues to count, halving the binary current control signal, And double the calibration interval.
  8. 根据权利要求5所述的信号幅度的校准方法,其中,所述根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号,包括:The method of calibrating a signal amplitude according to claim 5, wherein said generating a current control signal according to said first amplitude state signal and said second amplitude state signal comprises:
    判断所述幅度控制时间计数器的值是否与校准时间间隔一致;Determining whether the value of the amplitude control time counter is consistent with a calibration time interval;
    当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否等于第一数值;Determining whether the binary current control signal is equal to the first value when the value of the amplitude control time counter coincides with the calibration time interval;
    当所述二分电流控制信号等于第一数值时,执行以下操作之一:When the binary current control signal is equal to the first value, perform one of the following operations:
    当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
    当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上第一数值;同时将幅度控制时间计数器清零; When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
    当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数。When the first amplitude state signal is characterized by a second value, the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
  9. 根据权利要求7或8所述的信号幅度的校准方法,其中,调整当前的电流控制信号后,所述方法还包括:The method for calibrating a signal amplitude according to claim 7 or 8, wherein after the current current control signal is adjusted, the method further comprises:
    当所述幅度控制时间计数器清零时,幅度控制时间计数器重新开始计数,并重新调整当前的电流控制信号;When the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
    当所述幅度控制时间计数器的值与所述幅度控制状态时间一致时,电流控制信号调整结束,将所述幅度控制状态机使能信号置为第二数值。When the value of the amplitude control time counter coincides with the amplitude control state time, the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
  10. 一种信号幅度的校准装置,所述装置包括:A calibration device for signal amplitude, the device comprising:
    振荡模块,配置为利用晶体振荡器产生正弦信号;An oscillating module configured to generate a sinusoidal signal using a crystal oscillator;
    检测模块,配置为检测所述正弦信号的幅度值,并将所述幅度值转化为相应的电平信号;a detecting module configured to detect an amplitude value of the sinusoidal signal and convert the amplitude value into a corresponding level signal;
    比较模块,配置为将所述电平信号分别与第一参考信号和第二参考信号进行比较,得到第一幅度状态信号和第二幅度状态信号;The comparing module is configured to compare the level signal with the first reference signal and the second reference signal, respectively, to obtain a first amplitude state signal and a second amplitude state signal;
    幅度控制状态模块,配置为根据所述第一幅度状态信号和第二幅度状态信号,产生电流控制信号;将所述电流控制信号输入至所述晶体振荡器,以调整所述晶体振荡器产生的正弦信号的幅度值。An amplitude control status module configured to generate a current control signal according to the first amplitude state signal and the second amplitude state signal; input the current control signal to the crystal oscillator to adjust a generated by the crystal oscillator The amplitude value of the sinusoidal signal.
  11. 根据权利要求10所述的信号幅度的校准装置,其中,所述装置还包括:The apparatus for calibrating a signal amplitude according to claim 10, wherein the apparatus further comprises:
    参考信号产生模块,配置为产生第一参考信号和第二参考信号,其中,所述第一参考信号大于所述第二参考信号。The reference signal generating module is configured to generate the first reference signal and the second reference signal, wherein the first reference signal is greater than the second reference signal.
  12. 根据权利要求11所述的信号幅度的校准装置,其中,所述比较模块,还配置为:当所述电平信号大于等于所述第一参考信号时,通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号; The apparatus for calibrating a signal amplitude according to claim 11, wherein the comparison module is further configured to: when the level signal is greater than or equal to the first reference signal, characterize the first amplitude by a first value a status signal and the second amplitude status signal;
    当所述电平信号小于等于所述第二参考信号时,通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号;When the level signal is less than or equal to the second reference signal, characterizing the first amplitude state signal and the second amplitude state signal by a second value;
    当所述电平信号大于所述第二参考信号且小于所述第一参考信号时,通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号。When the level signal is greater than the second reference signal and less than the first reference signal, the first amplitude state signal is characterized by a second value, and the second amplitude state signal is characterized by a first value.
  13. 根据权利要求12所述的信号幅度的校准装置,其中,所述幅度控制状态模块,还配置为:当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,减小电流控制信号,同时将幅度控制时间计数器清零;The apparatus for calibrating a signal amplitude according to claim 12, wherein said amplitude control status module is further configured to: when said first amplitude state signal and said second amplitude state signal are characterized by a first value, Small current control signal, while clearing the amplitude control time counter;
    当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,增加电流控制信号,同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current control signal is increased while the amplitude control time counter is cleared;
    当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变,同时幅度控制时间计数器继续计数。When the first amplitude state signal is characterized by a second value, the current amplitude control signal is unchanged while the second magnitude state signal is characterized by the first value, while the amplitude control time counter continues to count.
  14. 根据权利要求10所述的信号幅度的校准装置,其中,所述装置还包括:设置单元,配置为设置如下参数的初始值:电流控制信号、二分电流控制信号、幅度控制时间计数器、校准时间间隔、幅度控制状态时间、幅度控制状态机使能信号;The apparatus for calibrating a signal amplitude according to claim 10, wherein said apparatus further comprises: a setting unit configured to set initial values of the following parameters: current control signal, binary current control signal, amplitude control time counter, calibration time interval , amplitude control state time, amplitude control state machine enable signal;
    其中,所述二分电流控制信号的初始值为所述电流控制信号的初始值的一半。The initial value of the binary current control signal is half of an initial value of the current control signal.
  15. 根据权利要求14所述的信号幅度的校准装置,其中,所述设置单元,还配置为当首次检测到时钟信号的下降沿和第一幅度状态信号的上升沿时,将所述幅度控制状态机使能信号置为第一数值,所述第一数值表明幅度控制状态机处于使能状态;The apparatus for calibrating a signal amplitude according to claim 14, wherein said setting unit is further configured to: when said falling edge of a clock signal and a rising edge of said first amplitude state signal are detected for the first time, said amplitude control state machine The enable signal is set to a first value, the first value indicating that the amplitude control state machine is in an enabled state;
    当所述幅度控制状态机使能信号为第一数值时,所述幅度控制时间计 数器开始计数。The amplitude control time meter when the amplitude control state machine enable signal is the first value The counter starts counting.
  16. 根据权利要求14所述的信号幅度的校准装置,其中,所述幅度控制状态模块,还配置为:判断所述幅度控制时间计数器的值是否与校准时间间隔一致;当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否大于第一数值;当所述二分电流控制信号大于第一数值时,执行以下操作之一:The apparatus for calibrating a signal amplitude according to claim 14, wherein said amplitude control status module is further configured to: determine whether a value of said amplitude control time counter coincides with a calibration time interval; when said amplitude control time counter When the value is consistent with the calibration time interval, it is determined whether the binary current control signal is greater than the first value; when the binary current control signal is greater than the first value, performing one of the following operations:
    当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by: subtracting the binary current control signal from the current control signal; and simultaneously clearing the amplitude control time counter Zero, halving the binary current control signal and doubling the calibration interval;
    当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上二分电流控制信号;同时将幅度控制时间计数器清零,将二分电流控制信号减半,以及将校准时间间隔增倍;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: the current control signal plus the binary current control signal; and the amplitude control time counter is cleared Zero, halving the binary current control signal and doubling the calibration interval;
    当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数,将二分电流控制信号减半,以及将校准时间间隔增倍。When the first amplitude state signal is characterized by the second value, the current control signal is unchanged when the second amplitude state signal is characterized by the first value; and the amplitude control time counter continues to count, halving the binary current control signal, And double the calibration interval.
  17. 根据权利要求14所述的信号幅度的校准装置,其中,所述幅度控制状态模块,还配置为:判断所述幅度控制时间计数器的值是否与校准时间间隔一致;当所述幅度控制时间计数器的值与校准时间间隔一致时,判断所述二分电流控制信号是否等于第一数值;当所述二分电流控制信号等于第一数值时,执行以下操作之一:The apparatus for calibrating a signal amplitude according to claim 14, wherein said amplitude control status module is further configured to: determine whether a value of said amplitude control time counter coincides with a calibration time interval; when said amplitude control time counter When the value is consistent with the calibration time interval, it is determined whether the binary current control signal is equal to the first value; when the binary current control signal is equal to the first value, one of the following operations is performed:
    当通过第一数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号减去第一数值;同时将幅度控制时间计数器清零; When the first amplitude state signal and the second amplitude state signal are characterized by the first value, the current current control signal is adjusted by subtracting the first value from the current control signal; and simultaneously clearing the amplitude control time counter ;
    当通过第二数值表征所述第一幅度状态信号和所述第二幅度状态信号时,通过以下方式调整当前的电流控制信号:电流控制信号加上第一数值;同时将幅度控制时间计数器清零;When the first amplitude state signal and the second amplitude state signal are characterized by the second value, the current current control signal is adjusted by: adding a first value to the current control signal; and simultaneously clearing the amplitude control time counter ;
    当通过第二数值表征所述第一幅度状态信号,通过第一数值表征所述第二幅度状态信号时,电流控制信号不变;同时幅度控制时间计数器继续计数。When the first amplitude state signal is characterized by a second value, the current control signal is unchanged when the second magnitude state signal is characterized by the first value; and the amplitude control time counter continues to count.
  18. 根据权利要求16或17所述的信号幅度的校准装置,其中,The apparatus for calibrating a signal amplitude according to claim 16 or 17, wherein
    当所述幅度控制时间计数器清零时,幅度控制时间计数器重新开始计数,并重新调整当前的电流控制信号;When the amplitude control time counter is cleared, the amplitude control time counter restarts counting and re-adjusts the current current control signal;
    当所述幅度控制时间计数器的值与所述幅度控制状态时间一致时,电流控制信号调整结束,将所述幅度控制状态机使能信号置为第二数值。When the value of the amplitude control time counter coincides with the amplitude control state time, the current control signal adjustment ends, and the amplitude control state machine enable signal is set to the second value.
  19. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,该计算机可执行指令配置为执行权利要求1-9任一项所述的信号幅度的校准方法。 A computer storage medium having stored therein computer executable instructions configured to perform the method of calibrating signal amplitudes of any of claims 1-9.
PCT/CN2017/074954 2016-11-22 2017-02-27 Method and device for calibrating signal amplitude, and computer storage medium WO2018094893A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611032074.9A CN108092625B (en) 2016-11-22 2016-11-22 Signal amplitude calibration method and device
CN201611032074.9 2016-11-22

Publications (1)

Publication Number Publication Date
WO2018094893A1 true WO2018094893A1 (en) 2018-05-31

Family

ID=62168905

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/074954 WO2018094893A1 (en) 2016-11-22 2017-02-27 Method and device for calibrating signal amplitude, and computer storage medium

Country Status (2)

Country Link
CN (1) CN108092625B (en)
WO (1) WO2018094893A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884170A (en) * 2022-05-26 2022-08-09 惠州市盛微电子有限公司 Constant current method, constant current device and battery management system based on PWM

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040160285A1 (en) * 2003-02-13 2004-08-19 Lovelace David K. Crystal oscillator with control feedback to maintain oscillation
US20060071729A1 (en) * 2004-09-24 2006-04-06 Cypress Semiconductor Corporation Clock circuit and method
CN101366180A (en) * 2005-10-28 2009-02-11 飞思卡尔半导体公司 Low noise reference oscillator with fast start-up
CN102624335A (en) * 2012-04-17 2012-08-01 钜泉光电科技(上海)股份有限公司 Novel crystal oscillator circuit
CN103166572A (en) * 2011-12-09 2013-06-19 国民技术股份有限公司 Vibration acceleration method of oscillator, vibration acceleration unit and oscillator
CN103944514A (en) * 2014-04-28 2014-07-23 无锡中星微电子有限公司 Amplitude detection control circuit and numerical control crystal oscillator system
WO2017000571A1 (en) * 2015-06-29 2017-01-05 深圳市中兴微电子技术有限公司 Crystal oscillator circuit and method for controlling output signal amplitude thereof
CN106330145A (en) * 2015-06-26 2017-01-11 深圳市中兴微电子技术有限公司 Crystal oscillator circuit and control method of output signal amplitude

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202634382U (en) * 2012-05-29 2012-12-26 天津瑞发科半导体技术有限公司 Configurable automatic calibration system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040160285A1 (en) * 2003-02-13 2004-08-19 Lovelace David K. Crystal oscillator with control feedback to maintain oscillation
US20060071729A1 (en) * 2004-09-24 2006-04-06 Cypress Semiconductor Corporation Clock circuit and method
CN101366180A (en) * 2005-10-28 2009-02-11 飞思卡尔半导体公司 Low noise reference oscillator with fast start-up
CN103166572A (en) * 2011-12-09 2013-06-19 国民技术股份有限公司 Vibration acceleration method of oscillator, vibration acceleration unit and oscillator
CN102624335A (en) * 2012-04-17 2012-08-01 钜泉光电科技(上海)股份有限公司 Novel crystal oscillator circuit
CN103944514A (en) * 2014-04-28 2014-07-23 无锡中星微电子有限公司 Amplitude detection control circuit and numerical control crystal oscillator system
CN106330145A (en) * 2015-06-26 2017-01-11 深圳市中兴微电子技术有限公司 Crystal oscillator circuit and control method of output signal amplitude
WO2017000571A1 (en) * 2015-06-29 2017-01-05 深圳市中兴微电子技术有限公司 Crystal oscillator circuit and method for controlling output signal amplitude thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884170A (en) * 2022-05-26 2022-08-09 惠州市盛微电子有限公司 Constant current method, constant current device and battery management system based on PWM
CN114884170B (en) * 2022-05-26 2024-03-22 惠州市盛微电子有限公司 Constant-current method, constant-current device and battery management system based on PWM

Also Published As

Publication number Publication date
CN108092625A (en) 2018-05-29
CN108092625B (en) 2020-06-09

Similar Documents

Publication Publication Date Title
US10181844B1 (en) Clock duty cycle calibration and frequency multiplier circuit
US10418941B2 (en) Integrated circuit crystal oscillator having digital automatic gain control comprising oscillation detection and amplitude control loops
US9197227B2 (en) Semiconductor device
TW201626721A (en) Pulse width modulation signal generation circuit and method
JP2012005124A (en) Phase locked loop and operation method of the same
WO2018094893A1 (en) Method and device for calibrating signal amplitude, and computer storage medium
TWI466449B (en) Signal generating device and frequency synthesizer
WO2022001940A1 (en) Phase jitter compensation method and module and digital phase-locked loop
KR101866486B1 (en) Temperature sensing circuit
WO2009153838A1 (en) Receiving device
US10826474B2 (en) Clock generation circuit and clock adjustment method thereof
WO2017000571A1 (en) Crystal oscillator circuit and method for controlling output signal amplitude thereof
KR101297413B1 (en) Adaptive clock generating apparatus and method thereof
US8786374B2 (en) Error detection at an oscillator
TW201815071A (en) Frequency calibration method for digitally controlled oscillator and apparatus using the same
KR20160110604A (en) Circuit for generating clock
JP2005337980A (en) Alternating current signal measuring instrument
CN111722520B (en) Time-to-digital converter and phase difference detection method
CN109842374B (en) Amplitude-limiting high-frequency oscillation circuit and oscillation signal generating method
US20090189595A1 (en) Circuit for detecting the duty cycle of clock signals
KR101427527B1 (en) Apparatus for recovering clock and data
JP5802507B2 (en) PLL circuit
KR101449855B1 (en) Frequency lock apparatus
KR20230098057A (en) Frequency control circuit and method for controlling the frequency
JP2009515488A (en) Nonlinear feedback control loop as a spread spectrum clock generator.

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17875037

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17875037

Country of ref document: EP

Kind code of ref document: A1