A fully digital phase-locked loop frequency calibration method and system based on dual-loop structure

Through the frequency calibration method of the double-loop structure, the frequency error of the quartz crystal is calibrated in a fully digital phase-locked loop using a high-precision reference clock, which solves the problem of inaccurate output frequency of the traditional phase-locked loop and realizes high-precision clock signal output.

CN118631245BActive Publication Date: 2024-11-15ZHEJIANG SAISI ELECTRONICAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411113717.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-15
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

The traditional fully digital phase-locked loop is difficult to meet the system requirements due to the inaccurate output frequency of the quartz crystal frequency error.

Method used

The frequency calibration method based on the double-loop structure is adopted, through the coordinated work of the first loop and the second loop, the frequency calibration is performed using a high-precision reference clock to ensure the accuracy of the output frequency. The first loop implements the phase locking function as a broadband loop, and the second loop implements the frequency locking function as a narrowband loop, and adjusts the output calibration frequency through negative feedback.

Benefits of technology

It effectively reduces the impact of quartz crystal frequency error on the output frequency, ensures that the full digital phase-locking loop outputs a stable, high-frequency accuracy clock signal, and improves the accuracy of frequency calibration and dynamic response capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631245B_ABST
    Figure CN118631245B_ABST
Patent Text Reader

Abstract

The present invention relates to a full-digital phase-locked loop frequency calibration method and system based on a dual-loop structure in the technical field of clock calibration, comprising the following steps: based on an initial output clock, a quartz crystal reference clock and an initial value of a first frequency control word corresponding to the quartz crystal reference clock, a negative feedback output clock is output through negative feedback in a first loop; based on the negative feedback output clock, a high-precision reference clock and a second frequency control word corresponding to the high-precision reference clock, a first frequency control word compensation value is output through negative feedback in a second loop; based on the initial value of the first frequency control word and the compensation value of the first frequency control word, a first frequency control word calibration value is calculated, and based on the first frequency control word calibration value, a calibration frequency is output in the first loop, thereby solving the problem of inaccurate output frequency of the full-digital phase-locked loop caused by an error between the actual frequency of the quartz crystal and the theoretical frequency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of clock calibration, and in particular to a full digital phase-locked loop frequency calibration method and system based on a dual-loop structure. Background Art

[0002] In recent years, with the rapid development of 5G technology and CMOS technology, the All Digital Phase Locked Loop (ADPLL) has gradually become the main direction of PLL development due to its advantages such as good portability, small area and low power consumption. In the field of wireless communications, the PLL provides the clock source for the entire system and is directly related to the system performance. The output frequency accuracy, phase noise and frequency range of the PLL are also gradually improving, which is a huge challenge for the all-digital PLL.

[0003] Traditional ADPLL is generally composed of modules such as digital time converter, phase detector, loop filter, digital controlled oscillator and accumulator. Its working principle is to compare the phase difference between the reference clock FREF provided by the quartz crystal and the output clock CKV of the digital controlled oscillator, and realize the phase synchronization function through the negative feedback principle. Therefore, the accuracy of the ADPLL output clock frequency depends on the frequency accuracy of the quartz crystal. However, due to impurities inside the crystal and natural aging, there is generally an error of ±3ppm between the frequency of the quartz crystal and the theoretical value, which will cause the ADPLL to fail to accurately provide the output frequency required by the system. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention provides a full-digital phase-locked loop frequency calibration method and system based on a dual-loop structure, which solves the problem of inaccurate output frequency of the full-digital phase-locked loop caused by the error between the actual frequency of the quartz crystal and the theoretical frequency.

[0005] In order to solve the above technical problems, the present invention is solved by the following technical solutions:

[0006] A frequency calibration method for a fully digital phase-locked loop based on a dual-loop structure comprises the following steps:

[0007] Based on the initial output clock, the quartz crystal reference clock and the initial value of the first frequency control word corresponding to the quartz crystal reference clock, outputting a negative feedback output clock through negative feedback in a first loop;

[0008] Based on the negative feedback output clock, the high-precision reference clock and the second frequency control word corresponding to the high-precision reference clock, outputting the first frequency control word compensation value through negative feedback in the second loop;

[0009] A first frequency control word calibration value is calculated based on the first frequency control word initial value and the first frequency control word compensation value, and a calibration frequency is output in a first loop based on the first frequency control word calibration value.

[0010] Optionally, the method further includes configuring the proportional gain and the integral gain of the filters of the first loop and the second loop to obtain a stable all-digital phase-locked loop, which specifically includes the following steps:

[0011] Setting the bandwidth of the first loop to at least 100 times the bandwidth of the second loop;

[0012] The proportional gain and the integral gain of the filter of the first loop and the filter of the second loop are calculated based on the transfer function of the all-digital phase-locked loop.

[0013] Optionally, the expression of the transfer function is:

[0014] ,in, Indicates the bandwidth of the loop; FCW indicates the frequency control word of the loop; represents the damping factor, , represents the proportional gain of the loop filter, represents the integral gain of the loop filter; represents the eigenfrequency, , represents the loop reference clock output frequency; s represents the Laplace operator.

[0015] Optionally, outputting a negative feedback output clock through negative feedback in the first loop includes the following steps:

[0016] Calculating a first loop phase error one based on the initial output clock, the quartz crystal reference clock, and the first frequency control word initial value;

[0017] Determine whether the first loop phase error 1 is zero, if so, use the initial output clock as the negative feedback output clock, if not, adjust the initial output clock to obtain an adjusted output clock;

[0018] The first loop phase error one is recalculated based on the adjusted output clock, the quartz crystal reference clock and the initial value of the first frequency control word, so that the recalculated first loop phase error one is zero, and the adjusted output clock is used as the negative feedback output clock.

[0019] Optionally, calculating the first loop phase error one based on the initial output clock, the quartz crystal reference clock, and the first frequency control word initial value comprises the following steps:

[0020] Based on the initial output clock, counting is performed at the falling edge of the output signal of the full digital phase-locked loop to obtain the first loop current integer phase one of the initial output clock of the full digital phase-locked loop;

[0021] Calculating the time interval between the quartz crystal reference clock and the initial output clock to obtain a first loop fractional phase error of one;

[0022] Accumulating and processing the initial value of the first frequency control word to obtain the first loop current reference phase one of the quartz crystal reference clock;

[0023] Based on the first loop current integer phase one, the first loop fractional phase error one, and the first loop current reference phase one, a first loop phase error one is calculated, wherein the first loop phase error one=the first loop current reference phase one-the first loop current integer phase one+the first loop fractional phase error one.

[0024] Optionally, outputting the first frequency control word compensation value through negative feedback in the second loop includes the following steps:

[0025] Based on the negative feedback output clock, counting is performed at the falling edge of the negative feedback output clock of the full digital phase-locked loop to obtain the second loop current integer phase of the negative feedback output clock of the full digital phase-locked loop;

[0026] Calculating the time interval between the high-precision reference clock and the negative feedback output clock to obtain a second loop decimal phase error;

[0027] Accumulating and processing the second frequency control word to obtain a current reference phase of a second loop of the high-precision reference clock;

[0028] Calculate a second loop phase error based on the second loop current integer phase, the second loop fractional phase error and the second loop current reference phase, wherein the second loop phase error=the second loop current reference phase-the second loop current integer phase+the second loop fractional phase error;

[0029] The second loop phase error is low-pass filtered to adjust the dynamic response of the second loop, and a second loop frequency tuning control word is generated to obtain a first frequency control word compensation value.

[0030] Optionally, the calculation formula of the calibration frequency is:

[0031] ,in, Indicates the frequency hopping frequency of the fully digital phase-locked loop, , represents the first frequency control word calibration value, Indicates the initial value of the first loop frequency control word, Indicates the actual output frequency error of the quartz crystal; represents the damping factor, , represents the proportional gain of the loop filter, represents the integral gain of the loop filter; represents the eigenfrequency, , represents the loop reference clock output frequency; s represents the Laplace operator.

[0032] A full-digital phase-locked loop frequency calibration system based on a dual-loop structure, the full-digital phase-locked loop frequency calibration system executing any one of the full-digital phase-locked loop frequency calibration methods based on a dual-loop structure as described above, comprising a first loop and a second loop;

[0033] The first loop is used to receive the initial value of the first frequency control word, the initial output clock and the quartz crystal reference clock, and output a negative feedback output clock after negative feedback regulation;

[0034] The second loop is used to receive the second frequency control word, the high-precision reference clock and the negative feedback output clock, and output the first frequency control word compensation value after negative feedback adjustment;

[0035] The first loop is further configured to calculate a first frequency control word calibration value based on a first frequency control word initial value and a first frequency control word compensation value, and output a calibration frequency based on the first frequency control word calibration value.

[0036] Optionally, the first loop includes a first reference phase accumulator, a first variable phase accumulator, a first time-to-digital converter, a first phase detector, a first loop filter and a digitally controlled oscillator;

[0037] The output ends of the first reference phase accumulator, the first variable phase accumulator and the first time-to-digital converter are connected to the input end of the first phase detector, the output end of the first phase detector is connected to the input end of the first loop filter, and the output end of the first loop filter is connected to the input end of the digitally controlled oscillator.

[0038] Optionally, the second loop includes a second reference phase accumulator, a second variable phase accumulator, a second time-to-digital converter, a second phase detector and a second loop filter;

[0039] The output ends of the second reference phase accumulator, the second variable phase accumulator and the second time-to-digital converter are all connected to the input end of the second phase detector, and the output end of the second phase detector is connected to the input end of the second loop filter.

[0040] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects:

[0041] By adding a second loop containing a high-precision reference clock to the full-digital phase-locked loop, the error between the actual frequency and the theoretical frequency of the quartz crystal in the first loop is calibrated, thereby ensuring the accuracy of the output frequency of the full-digital phase-locked loop; on the other hand, a dual-loop structure of the first loop combined with the second loop is adopted, so that during the locking process of the full-digital phase-locked loop, the two loops work together, and the first loop realizes the phase-locked function. As a broadband loop, it has a strong dynamic response capability, so that the full-digital phase-locked loop can quickly reach a locked state, while the second loop realizes the frequency locking function. As a narrowband loop, the initial value of the frequency control word of the first loop is calibrated and fine-tuned by a high-precision reference clock, so that the full-digital phase-locked loop finally outputs a stable, high-frequency precision clock signal. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 This is a flow chart of a frequency calibration method for a fully digital phase-locked loop based on a dual-loop structure proposed in the first embodiment;

[0044] Figure 2 This is a simulation result diagram of the change of the first frequency control word calibration value recorded over time through the full digital phase-locked loop frequency calibration method proposed in the first embodiment;

[0045] Figure 3 This is a structural diagram of the first loop circuit proposed in the second embodiment;

[0046] Figure 4 This is a structural diagram of the second loop circuit proposed in the second embodiment;

[0047] Figure 5 This is a circuit structure diagram of a full digital phase-locked loop frequency calibration system based on a dual-loop structure proposed in the second embodiment. DETAILED DESCRIPTION

[0048] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.

[0049] Example 1

[0050] A full digital phase-locked loop frequency calibration method based on a dual-loop structure is implemented by a calibration circuit composed of a first loop and a second loop, and includes the following steps: firstly, based on an initial output clock, a quartz crystal reference clock and an initial value of a first frequency control word corresponding to the quartz crystal reference clock, a negative feedback output clock is output in the first loop through negative feedback.

[0051] Specifically, the input end of the first loop receives the quartz crystal reference clock Fref2 provided by the quartz crystal. After the reference frequency signal is locked by the negative feedback of the first loop, a negative feedback clock signal Fout2 with a higher frequency can be obtained by configuring the initial value FCW1 of the first frequency control word, wherein the calculation formula of FCW1 is as follows: FCW1=Fout1 / Fref2, Fref2 is the nominal value of the quartz crystal reference clock; Fout1 is the target locking frequency of the full digital phase-locked loop, that is, the initial output clock; in this example, taking the target locking frequency Fout1 as 2.500625GHz and the nominal value of the quartz crystal reference clock as 25MHz, it can be deduced that the configuration value of FCW1 is 100.025 according to the above formula.

[0052] Further, the first loop phase error one is calculated based on the initial output clock, the quartz crystal reference clock, and the initial value of the first frequency control word; it is determined whether the first loop phase error one is zero, and if so, the initial output clock is used as the negative feedback output clock; if not, the initial output clock is adjusted to obtain the adjusted output clock; the first loop phase error one is recalculated based on the adjusted output clock, the quartz crystal reference clock, and the initial value of the first frequency control word, so that the recalculated first loop phase error one is zero, and the adjusted output clock is used as the negative feedback output clock.

[0053] Among them, the first loop phase error one is calculated based on the initial output clock, the quartz crystal reference clock, and the initial value of the first frequency control word, including the following steps: based on the initial output clock, counting is performed at the falling edge of the output signal of the full digital phase-locked loop to obtain the first loop current integer phase one of the initial output clock of the full digital phase-locked loop; the time interval between the quartz crystal reference clock and the initial output clock is calculated to obtain the first loop fractional phase error one; the initial value of the first frequency control word is accumulated to obtain the first loop current reference phase one of the quartz crystal reference clock; based on the first loop current integer phase one, the first loop fractional phase error one, and the first loop current reference phase one, the first loop phase error one is calculated, wherein the first loop phase error one = the first loop current reference phase one - the first loop current integer phase one + the first loop fractional phase error one.

[0054] After the first loop obtains the negative feedback output clock, there is an error between the frequency of the quartz crystal and the theoretical value, and the theoretical value of the quartz crystal is used when the first loop calculates the negative feedback output clock, that is, the negative feedback output clock is calculated using the nominal value of the quartz crystal reference clock. Therefore, in order to adjust this error, this embodiment sets a second loop and receives a high-precision reference clock from the Precision Time Protocol (PTP) or satellite timing through the second loop, thereby calibrating the error in the first loop.

[0055] Among them, when the second loop is calibrated, it is necessary to output the first frequency control word compensation value in the second loop through negative feedback based on the negative feedback output clock, the high-precision reference clock and the second frequency control word corresponding to the high-precision reference clock, specifically including the following steps: based on the negative feedback output clock, counting is performed at the falling edge of the negative feedback output clock of the full-digital phase-locked loop to obtain the second loop current integer phase of the negative feedback output clock of the full-digital phase-locked loop; the time interval between the high-precision reference clock and the negative feedback output clock is calculated to obtain the second loop decimal phase error; the second frequency control word is accumulated to obtain the second loop current reference phase of the high-precision reference clock; based on the second loop current integer phase, the second loop decimal phase error and the second loop current reference phase, the second loop phase error is calculated, wherein the second loop phase error = the second loop current reference phase - the second loop current integer phase + the second loop decimal phase error; the second loop phase error is low-pass filtered to adjust the dynamic response of the second loop, and the second loop frequency tuning control word is generated to obtain the first frequency control word compensation value.

[0056] Specifically, the input end of the second loop receives a high-precision reference clock from PTP or satellite timing, and the output value of the second loop is connected to the initial value of the first frequency control word. After the second loop frequency tuning control word is calculated, the first frequency control word calibration value can be calculated, wherein the frequency control word calculation formula of the second loop is as follows: FCW3=Fout2 / Fref3, wherein Fref3 represents the output frequency from a high-precision reference clock such as PTP and satellite timing. It should be noted that, in this embodiment, the method of outputting the first frequency control word compensation value through negative feedback in the second loop is the same as the negative feedback adjustment method in the first loop, the difference lies in the difference between the input and output during the negative feedback adjustment, therefore, the process description of the negative feedback adjustment will not be repeated here.

[0057] On the other hand, in order to ensure the stability of the dual-loop system (i.e., the calibration circuit composed of the first loop and the second loop), it is also necessary to configure the proportional gain and integral gain of the filters of the first loop and the second loop to obtain a stable full-digital phase-locked loop, which specifically includes the following steps: setting the bandwidth of the first loop to at least 100 times the bandwidth of the second loop; and calculating the proportional gain and integral gain of the filter of the first loop and the filter of the second loop based on the transfer function of the full-digital phase-locked loop.

[0058] Among them, in the single-loop structure, the expression of the transfer function is: ,in, Indicates the bandwidth of the loop; FCW indicates the frequency control word of the loop; represents the damping factor, , represents the proportional gain of the loop filter, represents the integral gain of the loop filter; represents the eigenfrequency, , represents the loop reference clock output frequency; s represents the Laplace operator.

[0059] in, Generally, the optimal damping ratio is 0.707. To ensure the stability of the dual-loop system, the bandwidth of the inner loop needs to be much larger than the bandwidth of the outer loop, so as to ensure that the inner loop responds quickly and stably controls rapid dynamic changes, while the outer loop responds slowly to avoid mutual interference and system instability. It is generally believed that a bandwidth multiple setting of 100 times can satisfy the relationship that the bandwidth of the inner loop is much larger than that of the outer loop. Therefore, in this embodiment, the bandwidth of the first loop is specifically set to at least 100 times the bandwidth of the second loop. For example, the bandwidth of the first loop is configured to 250kHz, and the bandwidth of the second loop is configured to 400Hz. Thus, the integral gain and proportional gain of the first loop, as well as the integral gain and proportional gain of the second loop can be calculated through the transfer function formula.

[0060] Finally, the first frequency control word calibration value can be calculated based on the first frequency control word initial value and the first frequency control word compensation value, and the calibration frequency can be output in the first loop based on the first frequency control word calibration value, wherein the calculation formula of the calibration frequency is: , Indicates the frequency hopping frequency of the fully digital phase-locked loop, , represents the first frequency control word calibration value, Indicates the initial value of the first loop frequency control word, Indicates the actual output frequency error of the quartz crystal; represents the damping factor, , represents the proportional gain of the loop filter, represents the integral gain of the loop filter; represents the eigenfrequency, , represents the loop reference clock output frequency; s represents the Laplace operator.

[0061] To simulate the frequency deviation error caused by internal impurities and natural aging of quartz crystals in actual scenarios, in this example, the first loop reference clock (i.e., quartz crystal reference clock) is set to a 25MHz clock with a frequency deviation of -3ppm. Due to the negative feedback principle, when the first and second loops reach the locked state at the same time:

[0062] According to the locking condition of the first loop, we can get: ;

[0063] According to the locking condition of the second loop, we can get: ;

[0064] Therefore, according to the locking conditions of the first loop and the second loop, the formulas are combined to obtain: .

[0065] Among them, Fref2 refers to the nominal frequency of the quartz crystal, that is, the nominal value of the quartz crystal reference clock, which is set to 25MHz in this implementation; Fref1 refers to the output frequency of the quartz crystal with errors in the actual working process, that is, 25×(1-3ppm)=24.999925MHz; refers to the input frequency of the high-precision reference clock (PTP, satellite timing) of the second loop, which is set to 1Hz in this embodiment; FCW3 represents the frequency control word of the second loop, that is, 2.500625×10 9 ; Fout1 refers to the target output frequency of the fully digital phase-locked loop, which is 2.500625GHz.

[0066] According to calculations, after the dual-ring system is locked, .

[0067] When the first loop and the second loop are locked at the same time, the reference clock phases of the two loops are not synchronized. The reference clock frequency of the second loop is very slow because it uses PTP or satellite timing, and the output clock of the full digital phase-locked loop only tracks the phase of the faster inner loop reference clock most of the time. Therefore, it only briefly tracks the second loop when the rising edge of the second loop reference clock arrives. At this time, the first loop plays the function of "phase locking" and the second loop plays the function of "frequency locking".

[0068] This embodiment further analyzes the influence of the second loop on the system locking time after the second loop is introduced, and regards the calibration of the initial value of the first frequency control word by the second loop as a frequency hopping process in which the output of the ADPLL suddenly changes by ∆f. The expression of ∆f is as follows: .

[0069] When the second loop is locked, the system reaches steady state again. At this time, this process is equivalent to the process that FCW2 remains unchanged, and the reference frequency of the outer loop input changes from Fref3- ∆f / FCW3 to Fref3. Converting this step function to the frequency domain is equivalent to adding a ∆f to the outer loop input. R(s) =∆f / (FCW3×s), according to the above formula, the calibration frequency of the fully digital phase-locked loop can be obtained as: It should be noted that the transfer function at this time is When calculating the calibration frequency, the transfer function calculation formula of the second loop is substituted.

[0070] like Figure 2 As shown, the simulation results of the first frequency control word calibration value recorded over time in the all-digital phase-locked loop based on the dual-loop structure are shown by the all-digital phase-locked loop frequency calibration method of this embodiment, wherein the simulation environment is consistent with the parameters used in the above theoretical derivation, that is: in the simulation, the target locking frequency Fout1 is 2.500625GHz, the quartz crystal reference clock is 25MHz, and there is a 3ppm frequency deviation error; the PTP input frequency of the second loop is 1Hz; the initial value of the first frequency control word FCW1 is 100.025, and the initial value of FCW3 is 2.500625×10 9 .

[0071] As can be seen from the figure, it can be seen that at about 3.5ms, the calibration value of the first frequency control word tends to be stable and the fluctuation value is very small, that is, the system has reached a locked state, and at this time the calibration value of the first frequency control word fluctuates between 100.025306 and 100.025299. It can be estimated that the maximum output frequency error at this time is approximately (100.025306-100.025299)×25M=175Hz<200Hz, and the output frequency error is only 0.08ppm, which successfully reduces the 3ppm frequency deviation error brought by the quartz crystal to the output clock. Therefore, the calibration method of this real example verifies the accuracy of frequency correction based on the fully digital phase-locked loop with a dual-loop structure. This method can be used to calibrate the frequency error introduced by the quartz crystal and improve the frequency accuracy of the phase-locked loop output clock.

[0072] Example 2

[0073] A fully digital phase-locked loop frequency calibration system based on a dual-loop structure comprises a first loop and a second loop, wherein the first loop is used to receive a first frequency control word initial value, an initial output clock and a quartz crystal reference clock, and output a negative feedback output clock after negative feedback adjustment; the second loop is used to receive a second frequency control word, a high-precision reference clock and a negative feedback output clock, and output a first frequency control word compensation value after negative feedback adjustment; the first loop is also used to calculate a first frequency control word calibration value based on the first frequency control word initial value and the first frequency control word compensation value, and output a calibration frequency based on the first frequency control word calibration value.

[0074] Specifically, Figure 3 As shown, the first loop includes a first reference phase accumulator, a first variable phase accumulator, a first time-to-digital converter, a first phase detector, a first loop filter and a digitally controlled oscillator; wherein the output ends of the first reference phase accumulator, the first variable phase accumulator and the first time-to-digital converter are connected to the input end of the first phase detector, the output end of the first phase detector is connected to the input end of the first loop filter, and the output end of the first loop filter is connected to the input end of the digitally controlled oscillator.

[0075] like Figure 4 As shown, the second loop includes a second reference phase accumulator, a second variable phase accumulator, a second time-to-digital converter, a second phase detector and a second loop filter; the output ends of the second reference phase accumulator, the second variable phase accumulator and the second time-to-digital converter are all connected to the input end of the second phase detector, and the output end of the second phase detector is connected to the input end of the second loop filter.

[0076] like Figure 5 As shown, when performing full digital phase-locked loop frequency calibration, first, the first loop performs negative feedback regulation to obtain a negative feedback output clock, and each circuit element performs the following steps respectively:

[0077] A first reference phase accumulator receives the first frequency control word initial value, and accumulates the input first frequency control word initial value to obtain the first loop current reference phase 1 of the quartz crystal reference clock;

[0078] A first variable phase accumulator receives an initial output clock and counts at the falling edge of the initial output clock to obtain a first loop current integer phase 1 of the initial output clock of the full digital phase-locked loop;

[0079] A first time digital converter: receiving a quartz crystal reference clock and an initial output clock, and calculating a time interval between the quartz crystal reference clock and the initial output clock to obtain a first loop decimal phase error of one;

[0080] The first phase detector receives the first loop current reference phase 1, the first loop current integer phase 1 and the first loop decimal phase error 1, and calculates the first loop phase error 1 based on the first loop current reference phase 1, the first loop current integer phase 1 and the first loop decimal phase error 1;

[0081] First loop filter: low-pass filtering the first loop phase error 1, adjusting the dynamic response of the first loop, and generating a first loop frequency tuning control word 1 of the digital controlled oscillator;

[0082] Digitally controlled oscillator: Based on the first loop frequency tuning control word, it outputs a negative feedback output clock.

[0083] After the negative feedback processing of the first loop is completed, a first frequency control word calibration value for calibrating the first loop is obtained through the second loop. Specifically, each circuit element of the second loop performs the following operations:

[0084] A second reference phase accumulator receives a second frequency control word and accumulates the input second frequency control word to obtain a current reference phase of a second loop of a high-precision reference clock;

[0085] The second variable phase accumulator receives the negative feedback output clock and counts at the falling edge of the negative feedback output clock to obtain the second loop current integer phase of the negative feedback output clock of the full digital phase-locked loop;

[0086] The second time digital converter receives the high-precision reference clock and the negative feedback output clock, and calculates the time interval between the high-precision reference clock and the negative feedback output clock to obtain the second loop decimal phase error;

[0087] A second phase detector: receiving a current reference phase of the second loop, a current integer phase of the second loop, and a decimal phase error of the second loop, and calculating a second loop phase error based on the current reference phase of the second loop, the current integer phase of the second loop, and the decimal phase error of the second loop;

[0088] Second loop filter: performs low-pass filtering on the second loop phase error, adjusts the dynamic response of the second loop, and generates a second loop frequency tuning control word to obtain a first frequency control word compensation value.

[0089] Finally, the error of the first loop can be calibrated according to the first frequency control word calibration value, and the calibration frequency can be output. Specifically, each circuit element of the first loop performs the following steps:

[0090] A first reference phase accumulator, used for receiving a first frequency control word calibration value, and accumulating the input first frequency control word calibration value to obtain a first loop current phase two of the quartz crystal reference clock;

[0091] A first variable phase accumulator is used to receive the negative feedback output clock and count at the falling edge of the negative feedback output clock to obtain the first loop current integer phase two of the negative feedback output clock of the full digital phase-locked loop;

[0092] A first time-to-digital converter, used for receiving a quartz crystal reference clock and a negative feedback output clock, and calculating a time interval between the quartz crystal reference clock and the negative feedback output clock to obtain a first loop decimal phase error of two;

[0093] A first phase detector is used to receive the first loop current phase 2, the first loop current integer phase 2 and the first loop decimal phase error 2, and calculate the first loop phase error 2 based on the first loop current phase 2, the first loop current integer phase 2 and the first loop decimal phase error 2;

[0094] A first loop filter, used for low-pass filtering the first loop phase error 2, adjusting the dynamic response of the first loop, and generating a first loop frequency tuning control word 2 of the digital controlled oscillator;

[0095] The digital controlled oscillator is used to output a calibration clock based on the first loop frequency tuning control word 2 to obtain a calibration frequency.

[0096] It should be noted that, since the full digital phase-locked loop frequency calibration system of this embodiment executes the full digital phase-locked loop frequency calibration method based on the dual-loop structure as described in the first embodiment, it will not be repeated in this embodiment.

[0097] The above is only a preferred embodiment of the present invention, and is not any formal or substantial limitation of the present invention. It should be pointed out that ordinary technicians in this technical field can make several improvements and supplements without departing from the method of the present invention, and these improvements and supplements should also be regarded as the protection scope of the present invention. Any technician familiar with this profession, without departing from the spirit and scope of the present invention, can make some changes, modifications and evolutions of the technical content disclosed above, which are equivalent embodiments of the present invention; at the same time, any changes, modifications and evolutions of any equivalent changes made to the above embodiments based on the essential technology of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A fully digital phase-locked loop frequency calibration method based on a dual-loop structure, It is characterized in that The following steps are involved: Based on the initial output clock, the quartz crystal reference clock and the initial value of the first frequency control word corresponding to the quartz crystal reference clock, outputting a negative feedback output clock through negative feedback in a first loop; Based on the negative feedback output clock, the high-precision reference clock and the second frequency control word corresponding to the high-precision reference clock, the first frequency control word compensation value is output through negative feedback in the second loop, specifically including the following steps: based on the negative feedback output clock, counting is performed at the falling edge of the negative feedback output clock of the full-digital phase-locked loop to obtain the second loop current integer phase of the negative feedback output clock of the full-digital phase-locked loop; the time interval between the high-precision reference clock and the negative feedback output clock is calculated to obtain the second loop decimal phase error; the second frequency control word is accumulated to obtain the second loop current reference phase of the high-precision reference clock; based on the second loop current integer phase, the second loop decimal phase error and the second loop current reference phase, the second loop phase error is calculated, wherein the second loop phase error = the second loop current reference phase - the second loop current integer phase + the second loop decimal phase error; the second loop phase error is low-pass filtered to adjust the dynamic response of the second loop, and the second loop frequency tuning control word is generated to obtain the first frequency control word compensation value; A first frequency control word calibration value is calculated based on the first frequency control word initial value and the first frequency control word compensation value, and a calibration frequency is output in a first loop based on the first frequency control word calibration value.

2. According to claim 1, a full digital phase-locked loop frequency calibration method based on a dual-loop structure, It is characterized in that The method further includes configuring the proportional gain and the integral gain of the filters of the first loop and the second loop to obtain a stable all-digital phase-locked loop, which specifically includes the following steps: Setting the bandwidth of the first loop to at least 100 times the bandwidth of the second loop; The proportional gain and the integral gain of the filter of the first loop and the filter of the second loop are calculated based on the transfer function of the all-digital phase-locked loop.

3. The method for calibrating a frequency of a fully digital phase-locked loop based on a dual-loop structure according to claim 2, It is characterized in that The expression of the transfer function is: ,in, Indicates the bandwidth of the loop; FCW indicates the frequency control word of the loop; represents the damping factor, , represents the proportional gain of the loop filter, represents the integral gain of the loop filter; represents the eigenfrequency, , represents the loop reference clock output frequency; s represents the Laplace operator.

4. The method for calibrating a frequency of a fully digital phase-locked loop based on a dual-loop structure according to claim 1, It is characterized in that The negative feedback output clock is outputted through negative feedback in the first loop, comprising the following steps: Calculating a first loop phase error one based on the initial output clock, the quartz crystal reference clock, and the first frequency control word initial value; Determine whether the first loop phase error 1 is zero, if so, use the initial output clock as the negative feedback output clock, if not, adjust the initial output clock to obtain an adjusted output clock; The first loop phase error one is recalculated based on the adjusted output clock, the quartz crystal reference clock and the initial value of the first frequency control word, so that the recalculated first loop phase error one is zero, and the adjusted output clock is used as the negative feedback output clock.

5. The method for calibrating frequency of a fully digital phase-locked loop based on a dual-loop structure according to claim 4, It is characterized in that Calculating the first loop phase error one based on the initial output clock, the quartz crystal reference clock, and the first frequency control word initial value comprises the following steps: Based on the initial output clock, counting is performed at the falling edge of the output signal of the full digital phase-locked loop to obtain the first loop current integer phase one of the initial output clock of the full digital phase-locked loop; Calculating the time interval between the quartz crystal reference clock and the initial output clock to obtain a first loop fractional phase error of one; Accumulating and processing the initial value of the first frequency control word to obtain the first loop current reference phase one of the quartz crystal reference clock; Based on the first loop current integer phase one, the first loop fractional phase error one, and the first loop current reference phase one, a first loop phase error one is calculated, wherein the first loop phase error one=the first loop current reference phase one-the first loop current integer phase one+the first loop fractional phase error one.

6. The frequency calibration method of a fully digital phase-locked loop based on a dual-loop structure according to claim 1, It is characterized in that The calculation formula of the calibration frequency is: ,in, Indicates the frequency hopping frequency of the fully digital phase-locked loop, , represents the first frequency control word calibration value, Indicates the initial value of the first loop frequency control word, Indicates the actual output frequency error of the quartz crystal; represents the damping factor, , represents the proportional gain of the loop filter, represents the integral gain of the loop filter; represents the eigenfrequency, , represents the loop reference clock output frequency; s represents the Laplace operator.

7. A fully digital phase-locked loop frequency calibration system based on a dual-loop structure, It is characterized in that The all-digital phase-locked loop frequency calibration system performs the all-digital phase-locked loop frequency calibration method based on a dual-loop structure as described in any one of claims 1 to 6, including a first loop and a second loop; The first loop is used to receive the initial value of the first frequency control word, the initial output clock and the quartz crystal reference clock, and output a negative feedback output clock after negative feedback regulation; The second loop is used to receive the second frequency control word, the high-precision reference clock and the negative feedback output clock, and output the first frequency control word compensation value after negative feedback adjustment; The first loop is further configured to calculate a first frequency control word calibration value based on a first frequency control word initial value and a first frequency control word compensation value, and output a calibration frequency based on the first frequency control word calibration value.

8. The all-digital phase-locked loop frequency calibration system based on a dual-loop structure according to claim 7, It is characterized in that The first loop includes a first reference phase accumulator, a first variable phase accumulator, a first time-to-digital converter, a first phase detector, a first loop filter, and a digitally controlled oscillator; The output ends of the first reference phase accumulator, the first variable phase accumulator and the first time-to-digital converter are connected to the input end of the first phase detector, the output end of the first phase detector is connected to the input end of the first loop filter, and the output end of the first loop filter is connected to the input end of the digitally controlled oscillator.

9. The all-digital phase-locked loop frequency calibration system based on a dual-loop structure according to claim 7, It is characterized in that The second loop includes a second reference phase accumulator, a second variable phase accumulator, a second time-to-digital converter, a second phase detector, and a second loop filter; The output ends of the second reference phase accumulator, the second variable phase accumulator and the second time-to-digital converter are all connected to the input end of the second phase detector, and the output end of the second phase detector is connected to the input end of the second loop filter.