FPGA frequency measurement principle and FPGA code

Source: Internet
Author: User

In general, there are two FPGA measurement frequency algorithms: frequency measurement and measurement Week. I used the electronic measurement textbook to find the definition. The frequency measurement is to count the input signal period within a certain period of time, while the measurement week is opposite. It is within the input signal period, count the standard signal period. It can be understood that the frequency measurement uses a slow clock to measure the high frequency, and the weekly measurement uses a fast clock to measure the low frequency cycle. This understanding is also in line with the "High Frequency frequency measurement, low frequency measurement Week" statement.


Take the frequency measurement algorithm as an example to write a program. The difficulty is to capture the gate start and end signs. Then we can use the time between the two rising edges of the low-frequency signal clock as the gate to count the input signal periods in the rising edges. Therefore, it is converted into capturing the clock signal edge. Generally, the capturing edge depends on the concatenation operator. Use {} and use & in VHDL &.


If posedge dataIn is used as a sensitive signal (because it is fast), when the rising edge of CLK is detected, the rising edge of dataIn is counted. When the next rising edge is reached, the output count is cleared.


Implementation Code:



Simulation results:


From the output result, there will be two count values (when division is not allowed). The difference between the two values is 1, which is acceptable. This Count value is sufficient in scenarios such as ask and PSK decoding. You only need to determine that the Count value is in the value range of + 1 or-1. If you want to test the actual frequency value, it is said that you have to calculate the Division using the formula fo = N/t. I have not tried it yet.

FPGA frequency measurement principle and FPGA code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.