Digital clock frequency monitoring method and device

Through the combination of a 2-level D flip-flop and a simplified digital phase-locked loop, high-resolution and low-latency digital clock frequency monitoring is achieved, which solves the problems of frequency monitoring accuracy and latency in the existing technology and is suitable for integration into products. for online monitoring.

CN118646409APending Publication Date: 2024-09-13SOUTHWEST CHINA RES INST OF ELECTRONICS EQUIP

Patent Information

Application Number
CN202410824472.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

Existing digital clock frequency monitoring methods are difficult to achieve high resolution (<10mHz) and low measurement delay (<0.3s), and are not suitable for integration into products for online monitoring.

Method used

A 2-level D flip-flop is used to latch the divided signal, and a simplified digital phase-locked loop is used to track the latched signal. High-resolution frequency error estimation is achieved through 1-bit quantization and digital phase-locked loop, combined with frequency division processing and The accumulation function of the digital phase-locked loop calculates the frequency error of the monitored clock.

Benefits of technology

It achieves high-resolution frequency measurement accuracy (<10mHz) and low measurement delay (<0.3s), while simplifying the circuit and is suitable for implementation in field-programmable logic devices (FPGA, CPLD, ASIC, CPU), expanding the possibilities Monitor the upper frequency limit and error range without affecting the timing characteristics of the clock domain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646409A
    Figure CN118646409A
Patent Text Reader

Abstract

The invention provides a digital clock frequency monitoring method and device. The method comprises the following steps: S1, carrying out frequency division processing on a monitored clock; s2, latching the signal after frequency division by using a two-stage D trigger; s3, tracking the latched signal by using a simplified digital phase-locked loop to obtain a frequency error estimated value of the latched signal; and S4, calculating the frequency error of the monitored clock according to the frequency error estimation value output by the simplified digital phase-locked loop. According to the invention, high frequency measurement resolution (lt; 10mHz), a lower measurement delay (lt; 0.3 s), and is easy to be integrated and applied (realized by a pure digital logic circuit).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of time-frequency circuits, and in particular to a method and device for monitoring digital clock frequency. Background Art

[0002] In the field of time-frequency technology, there are generally strict requirements for clock signals. When the clock has frequency deviation, it will cause system performance to decline or even fail. Therefore, it is necessary to monitor the key clock signals in the system in real time (measurement delay is less than 1 second), and the resolution must reach a high accuracy (<10mHz) to achieve fast and effective fault diagnosis of clock signals in high-precision systems. With the digital development trend of electronic systems, the clocks inside the boards and chips of time-frequency circuits often exist in the form of digital signals. How to achieve high-resolution and fast monitoring of clock frequencies at a low cost has posed an important engineering challenge.

[0003] Existing digital clock frequency monitoring methods include:

[0004] a) The low-frequency clock under test is sampled and counted by the high-frequency reference clock to obtain a count value, which reflects the frequency multiple relationship between the reference clock and the clock under test, so as to estimate the frequency deviation of the monitored clock;

[0005] b) Divide the lower frequency of the reference clock and the measured clock to obtain a very low frequency signal (for example, a 1 Hz signal), use the higher frequency of the reference clock and the measured clock to sample and count the divided signal, and estimate the measured clock frequency deviation based on this, as described in Chinese patent CN106597096B;

[0006] c) Take measurement readings through external high-precision test equipment (frequency meter, etc.).

[0007] Method a) uses sampling counting to measure the monitored clock cycle, and then calculates the monitored clock frequency based on the cycle (time). Therefore, its accuracy is limited by the time resolution of the sampling clock. The larger the sampling cycle (the lower the sampling frequency), the lower the monitoring resolution. Method b) improves method a) by indirectly improving the time resolution of the measurement through frequency division, thereby improving the frequency measurement accuracy. However, since the complete cycle of the extremely low frequency signal after frequency division needs to be measured, it will bring a large measurement delay. If a higher resolution is to be achieved, the measurement delay is generally greater than 1 second. Method c) is only suitable for laboratory testing, with high cost and large size, and is not suitable for integration into products for online monitoring. Summary of the invention

[0008] In view of the above-mentioned technical problems, the present invention provides a digital clock frequency monitoring method and device to achieve higher frequency measurement resolution (<10mHz), lower measurement delay (<0.3s), and easy integration and application (implemented by pure digital logic circuit).

[0009] The present invention provides a digital clock frequency monitoring method, comprising the following steps:

[0010] Step S1: frequency division processing of the monitored clock;

[0011] Step S2: Use a 2-stage D flip-flop to latch the divided signal;

[0012] Step S3: using a simplified digital phase-locked loop to track the latched signal to obtain a frequency error estimation value of the latched signal;

[0013] Step S4: Calculate the frequency error of the monitored clock according to the frequency error estimate value output by the simplified digital phase-locked loop.

[0014] Furthermore, in step S1, the monitored clock is divided by m to obtain a divided clock, wherein m is an integer and the minimum is 2.

[0015] Further, step S2 includes: using a first D flip-flop to latch the divided clock at the rising edge of the reference clock signal to obtain a first clock signal; using a second D flip-flop to latch the first clock signal at the rising edge of the reference clock signal to obtain a second clock signal.

[0016] Furthermore, step S3 includes: treating the second clock signal as a 1-bit quantized digital sequence whose sampling frequency is equal to the frequency of the reference clock signal, using a simplified digital phase-locked loop to track the second clock signal, and obtaining a high-resolution frequency error signal after the digital phase-locked loop is locked.

[0017] Furthermore, the simplified digital phase-locked loop includes a first XOR gate, a second XOR gate, a first counter, a second counter, a first decoder, a second decoder, an adder and a first operator;

[0018] The second clock signal is connected to the input end of the first XOR gate and the input end of the second XOR gate, the output signal of the first decoder is connected to the other input end of the first XOR gate, the output signal of the second decoder is connected to the other input end of the second XOR gate, the output signal of the first XOR gate is connected to the input end of the first counter, the output signal of the second XOR gate is connected to the input end of the second counter, the output signal of the first counter and the output signal of the second counter are connected to the input end of the first operator, the first output signal of the first operator controls the timing reset of the first counter and the second counter, the second output signal of the first operator is connected to the input end of the adder, the output signal of the adder is fed back to the other input end of the adder to realize the accumulation function of the output signal of the first operator, and the output signal of the adder is simultaneously connected to the input end of the first operator, the first decoder and the input end of the second decoder;

[0019] The reference clock is connected to the clock input terminals of the first counter, the second counter, the first decoder, the second decoder, the adder and the first operator. The first counter, the second counter, the first decoder, the second decoder, the adder and the first operator operate synchronously according to the clock cycle of the reference clock.

[0020] Furthermore, the counting method of the first counter is: when the reset signal is invalid, the level state of the output signal of the first XOR gate is collected at the rising edge of the reference clock, if it is a high level, the output signal value of the first counter is increased by one, otherwise it remains unchanged; when the reset signal is valid, the output signal value of the first counter is cleared to zero;

[0021] Furthermore, the counting method of the second counter is: when the reset signal is invalid, the level state of the second XOR gate output signal is collected at the rising edge of the reference clock. If it is a high level, the output signal value of the second counter is increased by one, otherwise it remains unchanged; when the reset signal is valid, the output signal value of the second counter is cleared to zero.

[0022] Furthermore, the decoding method of the first decoder is: directly outputting the highest bit of its input signal to obtain its output signal, which is a 1-bit sine wave signal after phase shifting by 180 degrees;

[0023] Furthermore, the decoding method of the second decoder is: the highest bit and the second highest bit of its input signal are XORed and output to obtain its output signal, which is a 1-bit cosine wave signal with a phase shift of 180 degrees.

[0024] Furthermore, the first counter needs to complete the phase error estimation, loop filter calculation, NCO frequency control word calculation and frequency error estimation functions of the digital phase-locked loop in step S3, and the calculation steps are as follows:

[0025] Step S31: Initialize variables at time 0, so that y[0]=0, p[0]=0;

[0026] Step S32: Starting from time T, the first digital phase-locked loop update calculation is performed, and then an update calculation is completed every time T. The update calculation formula and calculation sequence are as follows:

[0027]

[0028] y[n]=y[n-1]+K1×p[n]-K2×p[n-1](2)

[0029]

[0030] The variables in formulas (1) to (3) are defined as follows:

[0031] m is the frequency division ratio of the frequency divider 110, m≥2 and is an integer;

[0032] n is an integer greater than 0, representing the current update calculation times;

[0033] K1 and K2 are calculation factors selected to suit specific application scenarios;

[0034] M1[n] is the first count value at time n×T;

[0035] M2[n] is the second count value at time n×T;

[0036] N T is the number of cycles of the reference clock 301 corresponding to time T;

[0037] atan(x) is the inverse tangent function of the independent variable x;

[0038] round(x) is the rounding function of the independent variable x;

[0039] fc is the nominal frequency of the monitored clock;

[0040] fo is the actual frequency of the reference clock;

[0041] p[n] is the phase error at time n×T;

[0042] x[n] is the NCO frequency control word at time n×T, corresponding to the output value of the first operator;

[0043] y[n] is the frequency error estimate of the digital phase-locked loop at time n×T, corresponding to the output value of the first operator.

[0044] Furthermore, the second operator needs to complete the calculation process of calculating the frequency error value of the monitored clock according to the frequency error estimate value output by the digital phase-locked loop in step S4, and the calculation of the output value of the second operator is obtained for the first time from time L×T, and then updated and calculated once every time L×T. The calculation formula is as follows:

[0045]

[0046] The variables in formula (4) are defined as follows:

[0047] k is an integer greater than 0, representing the number of update calculations to obtain the output value of the second operator;

[0048] z[k] is the output value of the second operator at time k×L×T, and is also the frequency error monitoring value of the monitored clock.

[0049] The present invention also provides a digital clock frequency monitoring device, comprising a frequency divider, a first D flip-flop, a second D flip-flop, a simplified digital phase-locked loop and a second operator connected in sequence;

[0050] The simplified digital phase-locked loop includes a first XOR gate, a second XOR gate, a first counter, a second counter, a first decoder, a second decoder, an adder and a first operator;

[0051] The second clock signal is connected to the input end of the first XOR gate and the input end of the second XOR gate, the output signal of the first decoder is connected to the other input end of the first XOR gate, the output signal of the second decoder is connected to the other input end of the second XOR gate, the output signal of the first XOR gate is connected to the input end of the first counter, the output signal of the second XOR gate is connected to the input end of the second counter, the output signal of the first counter and the output signal of the second counter are connected to the input end of the first operator, the first output signal of the first operator controls the timing reset of the first counter and the second counter, the second output signal of the first operator is connected to the input end of the adder, the output signal of the adder is fed back to the other input end of the adder to realize the accumulation function of the output signal of the first operator, and the output signal of the adder is simultaneously connected to the input end of the first operator, the first decoder and the input end of the second decoder;

[0052] The reference clock is connected to the clock input terminals of the first counter, the second counter, the first decoder, the second decoder, the adder and the first operator. The first counter, the second counter, the first decoder, the second decoder, the adder and the first operator operate synchronously according to the clock cycle of the reference clock.

[0053] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0054] 1. The monitored signal is regarded as a 1-bit quantized signal, and a simplified digital phase-locked loop is used to track the monitored signal. Only pure digital logic circuits are needed to obtain measurement performance close to that of digital analog hybrid circuits (for example, frequency measurement accuracy is better than 10mHz, and measurement delay is less than 0.3s), thereby achieving high-resolution measurement accuracy and small measurement delay while simplifying the circuit.

[0055] 2. Due to the simplification of the circuit, the present invention can be implemented using any one of a field programmable gate array (FPGA), a complex programmable logic device (CPLD), an application specific integrated circuit (ASIC), and a central processing unit (CPU), or any combination of several of them.

[0056] 3. The monitored clock is divided into m frequencies. On the one hand, the upper limit of the monitored frequency of the monitored clock can be expanded; on the other hand, the error range of the monitored frequency of the monitored clock can be expanded; on the third hand, the monitored signal is transferred from the clock domain to the data domain, which is convenient for integration inside the programmable logic device. The monitoring device of the present invention does not affect the clock domain of the monitored clock, thereby having better timing characteristics;

[0057] 4. Using a 2-stage D flip-flop for latching can reduce the probability of metastable state caused by clock asynchrony during the acquisition of the monitored signal. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0059] Figure 1 Flow chart of a digital clock frequency monitoring method in an embodiment of the present invention.

[0060] Figure 2 Schematic diagram of a conventional digital phase-locked loop.

[0061] Figure 3 Schematic diagram of a digital clock frequency monitoring device in an embodiment of the present invention.

[0062] Figure 4 Schematic diagram of a simplified digital phase-locked loop in a digital clock frequency monitoring device according to an embodiment of the present invention.

[0063] Icons: 100-frequency divider, 101-first D flip-flop, 102-second D flip-flop, 103-simplified digital phase-locked loop, 104-second operator, 201-monitored clock, 202 divided signal, 203-first clock signal, 204-second clock signal, 205-frequency error signal, 206-output value of the second operator 104, 301-reference clock, 1031-first XOR gate, 1032-second XOR gate, 1033-first counter, 1034-second counter, 1035-first decoder, 1036-second Decoder, 1037-adder, 1038-first operator, 210-output signal of the first XOR gate 1031, 211-output signal of the second XOR gate 1032, 212-output signal of the first decoder 1035, 213-output signal of the second decoder 1036, 214-output signal of the first counter 1033, 215-output signal of the second counter 1034, 216-output signal of the adder 1037, 217-first output signal of the first operator 1038, 218-second output signal of the first operator 1038. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0065] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0066] Example

[0067] Figure 1 , Figure 3 As shown, a digital clock frequency monitoring method provided in this embodiment includes the following steps:

[0068] Step S1: Perform frequency division processing on the monitored clock. Perform m-frequency division processing on the monitored clock 201 to obtain a divided signal 202, where m is an integer and the minimum is 2;

[0069] Step S2: Use a 2-stage D flip-flop to latch the divided signal 202. Use the first D flip-flop 101 to latch the divided signal 202 at the rising edge of the reference clock signal 301 to obtain the first clock signal 203; use the second D flip-flop 102 to latch the first clock signal 203 at the rising edge of the reference clock signal 301 to obtain the second clock signal 204;

[0070] Step S3: Use a simplified digital phase-locked loop to track the latched signal to obtain a frequency error estimate of the latched signal. The second clock signal 204 is regarded as a digitized sequence after quantization of 1 bit, and its sampling frequency is equal to the frequency of the reference clock signal 301. Use a simplified digital phase-locked loop 103 to track the second clock signal 204. After the digital phase-locked loop is locked, a high-resolution frequency error signal 205 can be obtained. The frequency resolution can be controlled by reasonably setting the number of phase accumulator bits of the digitally controlled oscillator (NCO) in the digital phase-locked loop.

[0071] Step S4: Calculate the frequency error of the monitored clock according to the frequency error estimate value output by the simplified digital phase-locked loop.

[0072] The simplified digital phase-locked loop in step S3 includes:

[0073] The tracked signal in the digital phase-locked loop and the orthogonal carrier output by the NCO are both quantized using 1 bit;

[0074] Convert the multiplication operation in the conventional digital phase-locked loop phase detector into an exclusive-OR operation;

[0075] Convert the cumulative sum operation into a counting circuit;

[0076] Convert the circuit that generates orthogonal carriers using NCO into a 1- to 2-bit decoding circuit.

[0077] Figure 3 The digital clock frequency monitoring device provided in the embodiment of the present invention is composed of a frequency divider 100 , a first D flip-flop 101 , a second D flip-flop 102 , a simplified digital phase-locked loop 103 and a second operator 104 .

[0078] like Figure 4 As shown, the simplified digital phase-locked loop 103 includes a first XOR gate 1031 , a second XOR gate 1032 , a first counter 1033 , a second counter 1034 , a first decoder 1035 , a second decoder 1036 , an adder 1037 and a first operator 1038 .

[0079] The second clock signal 204 is connected to the input terminal of the first XOR gate 1031 and the input terminal of the second XOR gate 1032, the output signal 212 of the first decoder 1035 is connected to the other input terminal of the first XOR gate 1031, the output signal 213 of the second decoder 1036 is connected to the other input terminal of the second XOR gate 1032, the output signal 210 of the first XOR gate 1031 is connected to the input terminal of the first counter 1033, the output signal 211 of the second XOR gate 1032 is connected to the input terminal of the second counter 1034, and the output signal 214 of the first counter 1033 and the output signal 215 of the second counter 1034 are connected to The first output signal 217 (reset signal) of the first operator 1038 controls the timing reset of the first counter 1033 and the second counter 1034. The second output signal 218 of the first operator 1038 is connected to the input end of the adder 1037. The output signal 216 of the adder 1037 is fed back to the other input end of the adder 1037 to realize the accumulation function of the second output signal 218 of the first operator 1038. The output signal 216 of the adder 1037 is simultaneously connected to the input end of the first operator 1038, the first decoder 1035 and the input end of the second decoder 1036.

[0080] The reference clock 301 is connected to the clock input ends of the first counter 1033, the second counter 1034, the first decoder 1035, the second decoder 1036, the adder 1037 and the first operator 1038. The first counter 1033, the second counter 1034, the first decoder 1035, the second decoder 1036, the adder 1037 and the first operator 1038 operate synchronously according to the clock cycle of the reference clock 301.

[0081] The counting method of the first counter 1033 is: when the first output signal 217 is invalid, the level state of the output signal 210 of the first XOR gate 1031 is collected at the rising edge of the reference clock 301. If it is a high level, the value of the output signal 214 of the first counter 1033 is increased by one, otherwise it remains unchanged; when the first output signal 217 is valid, the value of the output signal 214 of the first counter 1033 is cleared.

[0082] The counting method of the second counter 1034 is: when the first output signal 217 is invalid, the level state of the second XOR gate 1032 output signal 211 is collected at the rising edge of the reference clock 301. If it is a high level, the value of the output signal 215 of the second counter 1034 is increased by one, otherwise it remains unchanged; when the first output signal 217 is valid, the value of the output signal 215 of the second counter 1034 is cleared.

[0083] The decoding method of the first decoder 1035 is: directly outputting the highest bit of the input signal (the output signal 216 of the adder 1037) to obtain its output signal 212, which is a 1-bit sinusoidal wave signal with a phase shift of 180 degrees.

[0084] The decoding method of the second decoder 1036 is: XOR the highest bit and the second highest bit of the input signal (the output signal 216 of the adder 1037) to obtain its output signal 213, which is a 1-bit cosine wave signal with a phase shift of 180 degrees.

[0085] In this embodiment, the first counter 1033 clocks the first output signal 217 to the first counter 1033 and the second counter 1034 according to the digital phase-locked loop cumulative summing time T, so as to reset them to zero at a certain time, wherein T=N T ×Ts, Ts is the period of the reference clock 301, N T To accumulate the sum of points.

[0086] In this embodiment, the first counter 1033 needs to complete the phase error estimation, loop filter calculation, NCO frequency control word calculation and frequency error estimation functions of the digital phase-locked loop in step S3, and the calculation steps are as follows:

[0087] Step S31: Initialize variables at time 0, so that y[0]=0, p[0]=0;

[0088] Step S32: Starting from time T, the first digital phase-locked loop update calculation is performed, and then an update calculation is completed every time T. The update calculation formula and calculation sequence are as follows:

[0089]

[0090] y[n]=y[n-1]+K1×p[n]-K2×p[n-1](2)

[0091]

[0092] The variables in formulas (1) to (3) are defined as follows:

[0093] m is the frequency division ratio of the frequency divider, m≥2 and is an integer;

[0094] n is an integer greater than 0, representing the current update calculation times;

[0095] K1 and K2 are calculation factors selected to suit specific application scenarios;

[0096] M1[n] is the first count value 214 at time n×T;

[0097] M2[n] is the second count value 215 at time n×T;

[0098] N T is the number of cycles of the reference clock 301 corresponding to time T;

[0099] atan(x) is the inverse tangent function of the independent variable x;

[0100] round(x) is the rounding function of the independent variable x;

[0101] fc is the nominal frequency of the monitored clock 201, in Hz;

[0102] fo is the actual frequency of the reference clock 301 (which can be calibrated by a standard instrument), in Hz;

[0103] p[n] is the phase error at time n×T, in radians;

[0104] x[n] is the NCO frequency control word at time n×T, corresponding to the second output signal 218 of the first operator 1038;

[0105] y[n] is the frequency error estimate of the digital phase-locked loop at time n×T, corresponding to the output value 205 of the first operator 1038 .

[0106] In this embodiment, the second operator 104 needs to complete the calculation process of calculating the frequency error value of the monitored clock 201 according to the frequency error estimation value output by the digital phase-locked loop as described in step S4, and the output value 206 of the second operator 104 is calculated for the first time starting from time L×T, and then updated and calculated once every time L×T. The calculation formula is as follows:

[0107]

[0108] The variables in formula (4) are defined as follows:

[0109] k is an integer greater than 0, representing the number of update calculations to obtain the output value 206 of the second operator 104;

[0110] z[k] is the output value 206 of the second operator 104 at time k×L×T, and is also the frequency error monitoring value of the monitored clock 201 of the present invention, and the unit is Hz.

[0111] To further illustrate this embodiment, a 100 MHz reference clock is used to monitor four monitored clocks with a nominal frequency of 333 MHz and four monitored clocks with a nominal frequency of 151 MHz, and the corresponding frequency monitoring errors and measurement delays when the method and apparatus proposed in the present invention are used are recorded.

[0112] The parameters set based on this application scenario are as follows:

[0113] K1=232820, K2=-218270, m=2, N T =100000, T=0.001s, N=40, L=100.

[0114] The test results are shown in Table 1.

[0115] Table 1, test results:

[0116]

[0117]

[0118] It can be seen from the test results in the above table that the method and device proposed in the present invention can accurately measure the frequency of the monitored clock, and there is no special restriction on the frequency of the monitored clock relative to the reference clock. The measurement error is <10mHz and the measurement delay is <0.3s.

[0119] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A digital clock frequency monitoring method, characterized in that: The steps include: Step S1: frequency division processing of the monitored clock; Step S2: Use a 2-stage D flip-flop to latch the divided signal; Step S3: using a simplified digital phase-locked loop to track the latched signal to obtain a frequency error estimation value of the latched signal; Step S4: Calculate the frequency error of the monitored clock according to the frequency error estimate value output by the simplified digital phase-locked loop.

2. The digital clock frequency monitoring method according to claim 1, characterized in that: In step S1, the monitored clock is divided by m to obtain a divided clock, where m is an integer and the minimum is 2.

3. The digital clock frequency monitoring method according to claim 2, characterized in that: Step S2 includes: using a first D flip-flop to latch the divided clock at the rising edge of the reference clock signal to obtain a first clock signal; using a second D flip-flop to latch the first clock signal at the rising edge of the reference clock signal to obtain a second clock signal.

4. The digital clock frequency monitoring method according to claim 3, characterized in that: The second clock signal is regarded as a 1-bit quantized digital sequence, whose sampling frequency is equal to the frequency of the reference clock signal. A simplified digital phase-locked loop is used to track the second clock signal, and a high-resolution frequency error signal is obtained after the digital phase-locked loop is locked.

5. The digital clock frequency monitoring method according to claim 4, characterized in that: The simplified digital phase-locked loop includes a first XOR gate, a second XOR gate, a first counter, a second counter, a first decoder, a second decoder, an adder and a first operator; The second clock signal is connected to the input end of the first XOR gate and the input end of the second XOR gate, the output signal of the first decoder is connected to the other input end of the first XOR gate, the output signal of the second decoder is connected to the other input end of the second XOR gate, the output signal of the first XOR gate is connected to the input end of the first counter, the output signal of the second XOR gate is connected to the input end of the second counter, the output signal of the first counter and the output signal of the second counter are connected to the input end of the first operator, the first output signal of the first operator controls the timing reset of the first counter and the second counter, the second output signal of the first operator is connected to the input end of the adder, the output signal of the adder is fed back to the other input end of the adder to realize the accumulation function of the output signal of the first operator, and the output signal of the adder is simultaneously connected to the input end of the first operator, the first decoder and the input end of the second decoder; The reference clock is connected to the clock input terminals of the first counter, the second counter, the first decoder, the second decoder, the adder and the first operator. The first counter, the second counter, the first decoder, the second decoder, the adder and the first operator operate synchronously according to the clock cycle of the reference clock.

6. The digital clock frequency monitoring method according to claim 5, characterized in that: The counting method of the first counter is: when the reset signal is invalid, the level state of the output signal of the first XOR gate is collected at the rising edge of the reference clock. If it is a high level, the output signal value of the first counter is increased by one, otherwise it remains unchanged; when the reset signal is valid, the output signal value of the first counter is cleared; the counting method of the second counter is: when the reset signal is invalid, the level state of the output signal of the second XOR gate is collected at the rising edge of the reference clock. If it is a high level, the output signal value of the second counter is increased by one, otherwise it remains unchanged; when the reset signal is valid, the output signal value of the second counter is cleared.

7. The digital clock frequency monitoring method according to claim 5, characterized in that: The decoding method of the first decoder is: directly output the highest bit of its input signal to obtain its output signal, which is a 1-bit sine wave signal after phase shifting by 180 degrees; the decoding method of the second decoder is: XOR output the highest bit of its input signal with the second highest bit to obtain its output signal, which is a 1-bit cosine wave signal after phase shifting by 180 degrees.

8. The digital clock frequency monitoring method according to claim 5, characterized in that: The first counter needs to complete the phase error estimation, loop filter calculation, NCO frequency control word calculation and frequency error estimation functions of the digital phase-locked loop in step S3. The calculation steps are as follows: Step S31: Initialize variables at time 0, so that y[0]=0, p[0]=0; Step S32: Starting from time T, the first digital phase-locked loop update calculation is performed, and then an update calculation is completed every time T. The update calculation formula and calculation sequence are as follows: y[n]=y[n-1]+K1×p[n]-K2×p[n-1] (2) The variables in formulas (1) to (3) are defined as follows: m is the frequency division ratio of the frequency divider, m≥2 and is an integer; n is an integer greater than 0, representing the current update calculation times; K1 and K2 are calculation factors selected to suit specific application scenarios; M1[n] is the first count value at time n×T; M2[n] is the second count value at time n×T; N T is the number of cycles of the reference clock corresponding to time T; atan(x) is the inverse tangent function of the independent variable x; round(x) is the rounding function of the independent variable x; f c is the nominal frequency of the monitored clock; f o is the actual frequency of the reference clock; p[n] is the phase error at time n×T; x[n] is the NCO frequency control word at time n×T, corresponding to the second output signal of the first operator; y[n] is the frequency error estimate of the digital phase-locked loop at time n×T, corresponding to the output value of the first operator.

9. The digital clock frequency monitoring method according to claim 8, characterized in that: The second operator needs to complete the calculation process of calculating the frequency error value of the monitored clock according to the frequency error estimation value output by the digital phase-locked loop in step S4. The output value of the second operator is calculated for the first time from time L×T, and then updated and calculated once every time L×T. The calculation formula is as follows: The variables in formula (4) are defined as follows: k is an integer greater than 0, representing the number of update calculations to obtain the output value of the second operator; z[k] is the output value of the second operator at time k×L×T, and is also the frequency error monitoring value of the monitored clock.

10. A digital clock frequency monitoring device, characterized in that: It includes a frequency divider, a first D flip-flop, a second D flip-flop, a simplified digital phase-locked loop and a second operator connected in sequence; The simplified digital phase-locked loop includes a first XOR gate, a second XOR gate, a first counter, a second counter, a first decoder, a second decoder, an adder and a first operator; The second clock signal is connected to the input end of the first XOR gate and the input end of the second XOR gate, the output signal of the first decoder is connected to the other input end of the first XOR gate, the output signal of the second decoder is connected to the other input end of the second XOR gate, the output signal of the first XOR gate is connected to the input end of the first counter, the output signal of the second XOR gate is connected to the input end of the second counter, the output signal of the first counter and the output signal of the second counter are connected to the input end of the first operator, the first output signal of the first operator controls the timing reset of the first counter and the second counter, the second output signal of the first operator is connected to the input end of the adder, the output signal of the adder is fed back to the other input end of the adder to realize the accumulation function of the output signal of the first operator, and the output signal of the adder is simultaneously connected to the input end of the first operator, the first decoder and the input end of the second decoder; The reference clock is connected to the clock input terminals of the first counter, the second counter, the first decoder, the second decoder, the adder and the first operator. The first counter, the second counter, the first decoder, the second decoder, the adder and the first operator operate synchronously according to the clock cycle of the reference clock.

Citation Information

Patent Citations

  • A clock frequency monitoring method

    CN106597096B

Cited By

  • Distributed system, simulation system and method, and high-speed clock alignment system and method

    CN120654644A