Frequency measuring device based on FPGA

Through the FPGA-based frequency measurement device, the combination of FPGA module, MCU module and TDC module is used to solve the problems of high cost, low precision and large volume of traditional frequency measurement equipment, and realize low-cost and high-precision frequency measurement, which is suitable for 1Hz-2.4G frequency test.

CN118655368APending Publication Date: 2024-09-17CHENGDU JINNUOXIN HIGH-TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410944298.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Traditional frequency measurement equipment has problems such as high cost, complex design, limited measurement range, low measurement accuracy, and bulky size, which limits its application scope and market competitiveness.

Method used

Design a frequency measurement device based on FPGA, including FPGA module, MCU module and TDC module. Through frequency divider, SPI bus communication and constant temperature crystal oscillator, it can divide and measure the input clock signal, calculate the frequency and output the measurement results.

Benefits of technology

It realizes a frequency measurement device with low cost, simple design, wide measurement range, high measurement accuracy and small size. It can meet the frequency test of 1Hz-2.4G, with an accuracy of up to 10ps, and is suitable for customized structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118655368A
    Figure CN118655368A
Patent Text Reader

Abstract

The invention discloses a frequency measuring device based on an FPGA, and belongs to the technical field of time frequency. Comprising an FPGA module, the FPGA module is connected with a frequency divider, an MCU module and a TDC module, and the MCU module is connected with the TDC module; the FPGA module is used for receiving a frequency division clock signal and a reference source signal output by the frequency divider, measuring the frequency division clock signal to obtain a first measurement result, outputting the first measurement result to the MCU module, performing frequency division on the reference source signal to obtain a frequency division reference signal, and outputting the frequency division reference signal to the TDC module; the frequency divider is used for dividing an input clock signal into a frequency-divided clock signal; the MCU module is used for controlling the FPGA module to output a first clock signal to the TDC module after receiving the first measurement result; the TDC module is used for performing measurement after receiving the frequency division reference signal and the first clock signal to obtain a measurement time difference and outputting the measurement time difference to the MCU module; and calculating the frequency of the input clock signal according to the measurement time difference. The cost of the instrument is reduced, the size is small, carrying is convenient, testing is convenient, the measuring range is wide, and precision is high.
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 and frequency, and in particular to a frequency measuring device based on FPGA. Background Art

[0002] In the current electronic technology field, frequency measurement devices are widely used in multiple industries such as communications, radar, and test and measurement. The stability and accuracy of their performance have a vital impact on the operation of the entire system. However, traditional frequency measurement equipment, which basically relies on general instruments for measurement, often has problems such as high cost, complex design, limited measurement range, low measurement accuracy, and large size. It is not easy to carry and test, which to a certain extent limits its application scope and market competitiveness. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a frequency measurement device based on FPGA.

[0004] The objective of the present invention is achieved through the following technical scheme: a frequency measurement device based on FPGA, comprising an FPGA module, wherein the FPGA module is connected to a frequency divider, an MCU module and a TDC module, and the MCU module is connected to the TDC module; the FPGA module is used to receive a divided clock signal and a reference source signal output by the frequency divider, and measure the divided clock signal to obtain a first measurement result and output it to the MCU module, and divide the reference source signal to obtain a divided reference signal and output it to the TDC module; the frequency divider is used to divide the input clock signal into divided clock signals; the MCU module is used to control the FPGA module to output the first clock signal to the TDC module after receiving the first measurement result; the TDC module is used to measure after receiving the divided reference signal and the first clock signal to obtain a measured time difference and output it to the MCU module; the frequency of the input clock signal is calculated according to the measured time difference.

[0005] Preferably, the MCU module, FPGA module and TDC module communicate with each other via an SPI bus.

[0006] Preferably, the MCU module is also connected to a human-computer interaction module, and the human-computer interaction module is used to display data of the FPGA-based frequency measurement device.

[0007] Preferably, the FPGA module is also connected to a constant temperature crystal oscillator. When there is an external reference signal, the external reference signal is used as the reference source signal. When there is no external reference signal, the signal generated by the constant temperature crystal oscillator is used as the reference source signal.

[0008] Preferably, the FPGA module comprises a PLL module, a pulse generating module and a first frequency dividing module, the input ends of the PLL module, the pulse generating module and the first frequency dividing module receive reference source signals, the output end of the PLL module is connected to the input end of the measuring module, the output end of the pulse generating module is connected to the input end of the TDC module, and the output end of the first frequency dividing module is connected to the input end of the TDC module; the output end of the measuring module is connected to the input end of the SPI register module, and the input end of the measuring module is also connected to the output end of the second frequency dividing module; the input end of the second frequency dividing module is connected to the output end of the frequency divider; the output end of the frequency divider is also connected to the input end of the controllable coefficient frequency dividing module; the output end of the controllable coefficient frequency dividing module is connected to the input end of the TDC module, and the input end of the controllable coefficient frequency dividing module is also connected to the output end of the SPI register module; the input and output ends of the SPI register module are connected to the input and output ends of the MCU module; When performing frequency measurement, the frequency divider divides the input clock signal into a first divided clock signal and a second divided clock signal, and outputs them to the second frequency division module and the controllable coefficient frequency division module respectively; the second frequency division module divides the first divided clock signal to obtain a third divided clock signal and outputs it to the measurement module; the measurement module measures the third divided clock signal to obtain a first measurement result and outputs it to the SPI register module; the SPI register module outputs the first measurement result to the MCU module; the MCU module receives the first measurement result and outputs the frequency division coefficient to the SPI register module; the SPI register module outputs the frequency division coefficient to the controllable coefficient frequency division module; the controllable coefficient frequency division module measures the third divided clock signal to obtain a first measurement result and outputs it to the SPI register module; the SPI register module outputs the frequency division coefficient to the controllable coefficient frequency division module; the controllable coefficient frequency division module measures the third divided clock signal to obtain a first measurement result and outputs it to the SPI register module; the SPI register module outputs the first measurement result to the MCU module; after receiving the first measurement result, the MCU module outputs the frequency division coefficient to the SPI register module; the SPI register module outputs the frequency division coefficient to the controllable coefficient frequency division module; the controllable coefficient frequency division module measures the third divided clock signal to obtain a first measurement result and outputs it to the SPI register ... The first clock signal is obtained by dividing the second divided clock signal and outputting it to the TDC module; the PLL module multiplies the reference source signal to obtain a multiplied signal and outputs it to the measurement module, the multiplied signal is used to measure with the third divided signal in the measurement module to obtain a first measurement result, the first frequency division module divides the reference source signal to obtain a fourth divided clock signal and outputs it to the TDC module, the pulse generation module divides the reference source signal to obtain a divided reference signal and outputs it to the TDC module; the TDC module measures the measured time difference after receiving the divided reference signal and the first clock signal and outputs it to the MCU module; finally, the frequency of the input clock signal is calculated according to the measured time difference.

[0009] Preferably, the frequency of the input clock signal F=F1*x=F2*n*x, wherein F1 is the frequency of the second divided clock signal, x is the division coefficient of the divider, F2 is the frequency of the first clock signal, and n is the division coefficient of the controllable coefficient division module output by the MCU module.

[0010] Preferably, the frequency division coefficient of the frequency divider is 8; the frequency division coefficient of the first frequency division module is 2; and the frequency division coefficient of the second frequency division module is 8.

[0011] Preferably, the chip model of the frequency divider is HMC494, the MCU module uses an STM32F407 series single-chip microcomputer, and the chip model of the TDC module is MS1050NA.

[0012] The beneficial effects of the present invention are: 1) Low cost, the main chips are all commonly used mainstream chips; simple design, general FPGA and single-chip microcomputer can complete the function realization; wide measurement range, can meet 1Hz-2.4G frequency test; high measurement accuracy, when there is an external reference of 10MHz, the measurement accuracy can reach 10ps; small size, the integrated circuit size based on the chip design selected by the present invention is small, which is convenient for customized structure realization. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is the principle block diagram of the frequency measurement device based on FPGA; Figure 2 A schematic diagram of measuring a first clock signal for a TDC module; Figure 3 This is the principle block diagram of the FPGA module. DETAILED DESCRIPTION

[0014] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0015] See also Figure 1-Figure 3 The present invention provides a technical solution: a frequency measurement device based on FPGA, comprising an FPGA module, wherein the FPGA module is connected to a frequency divider, an MCU module and a TDC module, and the MCU module is connected to the TDC module; the FPGA module is used to receive a divided clock signal and a reference source signal output by the frequency divider, and measure the divided clock signal to obtain a first measurement result and output it to the MCU module, and divide the reference source signal to obtain a divided reference signal and output it to the TDC module; the frequency divider is used to divide the input clock signal into divided clock signals; the MCU module is used to control the FPGA module to output the first clock signal to the TDC module after receiving the first measurement result; the TDC module is used to measure the measured time difference after receiving the divided reference signal and the first clock signal and output it to the MCU module; and the frequency of the input clock signal is calculated according to the measured time difference.

[0016] In this embodiment, the frequency divider chip can be selected from the 8-frequency HMC494, the FPGA module resource requirements are not high, and a mainstream low-cost chip is selected, and the MCU module can be selected from the mainstream STM32F407 series microcontroller or other similar models; the TDC module uses the MS1050NA, and the measurement accuracy can reach 10ps.

[0017] In some embodiments, the MCU module, FPGA module and TDC module communicate with each other via an SPI bus.

[0018] In some embodiments, the MCU module is also connected to a human-computer interaction module, and the human-computer interaction module is used to display data of the FPGA-based frequency measurement device.

[0019] In some embodiments, the FPGA module is also connected to a constant temperature crystal oscillator. When there is an external reference signal, the external reference signal is used as the reference source signal. When there is no external reference signal, the signal generated by the constant temperature crystal oscillator is used as the reference source signal.

[0020] In this embodiment, the external reference signal or the signal generated by the constant temperature crystal oscillator is 10 M.

[0021] In some embodiments, the FPGA module includes a PLL module, a pulse generation module and a first frequency division module, the input ends of the PLL module, the pulse generation module and the first frequency division module receive reference source signals, the output end of the PLL module is connected to the input end of the measurement module, the output end of the pulse generation module is connected to the input end of the TDC module, and the output end of the first frequency division module is connected to the input end of the TDC module; the output end of the measurement module is connected to the input end of the SPI register module, and the input end of the measurement module is also connected to the output end of the second frequency division module; the input end of the second frequency division module is connected to the output end of the frequency divider; the output end of the frequency divider is also connected to the input end of the controllable coefficient frequency division module; the output end of the controllable coefficient frequency division module is connected to the input end of the TDC module, and the input end of the controllable coefficient frequency division module is also connected to the output end of the SPI register module; the input and output ends of the SPI register module are connected to the input and output ends of the MCU module; When performing frequency measurement, the frequency divider divides the input clock signal into a first divided clock signal and a second divided clock signal, and outputs them to the second frequency division module and the controllable coefficient frequency division module respectively; the second frequency division module divides the first divided clock signal to obtain a third divided clock signal and outputs it to the measurement module; the measurement module measures the third divided clock signal to obtain a first measurement result and outputs it to the SPI register module; the SPI register module outputs the first measurement result to the MCU module; the MCU module receives the first measurement result and outputs the frequency division coefficient to the SPI register module; the SPI register module outputs the frequency division coefficient to the controllable coefficient frequency division module; the controllable coefficient frequency division module measures the third divided clock signal to obtain a first measurement result and outputs it to the SPI register module; the SPI register module outputs the frequency division coefficient to the controllable coefficient frequency division module; the controllable coefficient frequency division module measures the third divided clock signal to obtain a first measurement result and outputs it to the SPI register module; the SPI register module outputs the first measurement result to the MCU module; after receiving the first measurement result, the MCU module outputs the frequency division coefficient to the SPI register module; the SPI register module outputs the frequency division coefficient to the controllable coefficient frequency division module; the controllable coefficient frequency division module measures the third divided clock signal to obtain a first measurement result and outputs it to the SPI register ... The first clock signal is obtained by dividing the second divided clock signal and outputting it to the TDC module; the PLL module multiplies the reference source signal to obtain a multiplied signal and outputs it to the measurement module, the multiplied signal is used to measure with the third divided signal in the measurement module to obtain a first measurement result, the first frequency division module divides the reference source signal to obtain a fourth divided clock signal and outputs it to the TDC module, the pulse generation module divides the reference source signal to obtain a divided reference signal and outputs it to the TDC module; the TDC module measures the measured time difference after receiving the divided reference signal and the first clock signal and outputs it to the MCU module; finally, the frequency of the input clock signal is calculated according to the measured time difference.

[0022] In this embodiment, the second frequency division module is a fixed 8-frequency division, and the frequency division coefficient of the controllable coefficient frequency division module is controlled by the MCU module; the PLL module is used to multiply the 10M reference source signal into a 100M multiplied signal, and the multiplied signal is used to measure with the third frequency division signal in the measurement module to obtain a first measurement result; the measurement module measures the third frequency division clock signal and the multiplied signal to obtain a first measurement result and outputs it to the SPI register module, and the SPI register module outputs the first measurement result to the MCU module. After receiving the first measurement result, the MCU module controls the controllable coefficient frequency division module to output a 1Hz first clock signal to the STOP2 pin of the TDC module, and the pulse generation module divides the reference source signal to obtain a divided reference signal of 1Hz, which is output to the STOP1 pin of the TDC module; the period of the first clock signal = the period of the multiplied signal * the number of multiplied signals collected within the period of the first clock signal; Figure 2As shown, the period of the frequency division reference signal is T. If the period of the first clock signal to be measured is greater than T, then △t2-△t1>0, otherwise <0. The period of the first clock signal to be measured is T1=T+(△t2-△t1), where △t1 is the time difference between the rising edge of the first selected frequency division reference signal and the nearest rising edge of the first clock signal to be measured; △t2: the time difference between the rising edge of the second selected frequency division reference signal and the nearest rising edge of the first clock signal to be measured; in order to improve the measurement accuracy, multiple data can be collected continuously to calculate the average value. The frequency of the first clock signal to be measured F2=1 / T1 In some embodiments, the frequency of the input clock signal F=F1*x=F2*n*x, where F1 is the frequency of the second divided clock signal, x is the division coefficient of the divider, F2 is the frequency of the first clock signal, and n is the division coefficient of the controllable coefficient division module output by the MCU module.

[0023] In some embodiments, the frequency division coefficient of the frequency divider is 8; the frequency division coefficient of the first frequency division module is 2; and the frequency division coefficient of the second frequency division module is 8.

[0024] In some embodiments, the chip model of the frequency divider is HMC494, the MCU module uses the STM32F407 series microcontroller, and the chip model of the TDC module is MS1050NA.

[0025] In this embodiment, the input clock that a conventional low-cost FPGA can receive is within 300M. Combined with the 8-division chip HMC494, the maximum clock that the present invention can measure is 2.4G; when there is an external 10MHz reference, high-precision measurement can be provided, and the measurement accuracy is better than 10ps. When there is no external reference 10MHz, the internal crystal oscillator is used as a reference; in order to facilitate measurement in an environment without an external reference 10MHz, a constant temperature crystal oscillator can be used as the internal crystal oscillator, and the frequency accuracy can reach 1E-8, and the measurement accuracy is better than 10ns.

[0026] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.

Claims

1. A frequency measurement device based on FPGA, characterized in that: It includes an FPGA module, the FPGA module is connected to a frequency divider, an MCU module and a TDC module, and the MCU module is connected to the TDC module; the FPGA module is used to receive a divided clock signal and a reference source signal output by the frequency divider, measure the divided clock signal to obtain a first measurement result and output it to the MCU module, and divide the reference source signal to obtain a divided reference signal and output it to the TDC module; The frequency divider is used to divide the input clock signal into a divided clock signal; The MCU module is used to control the FPGA module to output a first clock signal to the TDC module after receiving the first measurement result; The TDC module is used to measure the measured time difference after receiving the frequency-divided reference signal and the first clock signal and output it to the MCU module; The frequency of the input clock signal is calculated based on the measured time difference.

2. The FPGA-based frequency measurement device according to claim 1, characterized in that: The MCU module, FPGA module and TDC module communicate with each other via the SPI bus.

3. The frequency measurement device based on FPGA according to claim 1, characterized in that: The MCU module is also connected to a human-computer interaction module, and the human-computer interaction module is used to display data of the frequency measurement device based on FPGA.

4. The FPGA-based frequency measurement device according to claim 1, characterized in that: The FPGA module is also connected to a constant temperature crystal oscillator. When there is an external reference signal, the external reference signal is used as a reference source signal. When there is no external reference signal, the signal generated by the constant temperature crystal oscillator is used as the reference source signal.

5. The FPGA-based frequency measurement device according to claim 1, characterized in that: The FPGA module includes a PLL module, a pulse generation module and a first frequency division module, the input ends of the PLL module, the pulse generation module and the first frequency division module receive reference source signals, the output end of the PLL module is connected to the input end of the measurement module, the output end of the pulse generation module is connected to the input end of the TDC module, and the output end of the first frequency division module is connected to the input end of the TDC module; the output end of the measurement module is connected to the input end of the SPI register module, and the input end of the measurement module is also connected to the output end of the second frequency division module; the input end of the second frequency division module is connected to the output end of the frequency divider; the output end of the frequency divider is also connected to the input end of the controllable coefficient frequency division module; the output end of the controllable coefficient frequency division module is connected to the input end of the TDC module, and the input end of the controllable coefficient frequency division module is also connected to the output end of the SPI register module; the input and output ends of the SPI register module are connected to the input and output ends of the MCU module; When performing frequency measurement, the frequency divider divides the input clock signal into a first divided clock signal and a second divided clock signal, and outputs them to the second frequency division module and the controllable coefficient frequency division module respectively; the second frequency division module divides the first divided clock signal to obtain a third divided clock signal and outputs it to the measurement module; the measurement module measures the third divided clock signal to obtain a first measurement result and outputs it to the SPI register module; the SPI register module outputs the first measurement result to the MCU module; the MCU module outputs the frequency division coefficient to the SPI register module after receiving the first measurement result; the SPI register module outputs the frequency division coefficient to the controllable coefficient frequency division module; the controllable coefficient frequency division module divides the second divided clock signal according to the frequency division coefficient to obtain the first clock signal and outputs it to the TDC module; the PLL module multiplies the reference source signal to obtain a multiplied signal and outputs it to the measurement module; the multiplied signal is used to measure with the third divided signal in the measurement module to obtain the first measurement result; the first frequency division module divides the reference source signal to obtain a fourth divided clock signal and outputs it to the TDC module; the pulse generation module divides the reference source signal to obtain a divided reference signal and outputs it to the TDC module; After receiving the frequency-divided reference signal and the first clock signal, the TDC module measures to obtain a measured time difference and outputs the measured time difference to the MCU module; Finally, the frequency of the input clock signal is calculated based on the measured time difference.

6. The frequency measurement device based on FPGA according to claim 5, characterized in that: The frequency of the input clock signal F=F1*x=F2*n*x, where F1 is the frequency of the second divided clock signal, x is the division coefficient of the divider, F2 is the frequency of the first clock signal, and n is the division coefficient of the controllable coefficient division module output by the MCU module.

7. The frequency measurement device based on FPGA according to claim 5, characterized in that: The frequency division coefficient of the frequency divider is 8; the frequency division coefficient of the first frequency division module is 2; and the frequency division coefficient of the second frequency division module is 8.

8. The FPGA-based frequency measurement device according to any one of claims 1 to 7, characterized in that: The chip model of the frequency divider is HMC494, the MCU module uses the STM32F407 series single-chip microcomputer, and the chip model of the TDC module is MS1050NA.