Jump to content
  • 0

Arty-Z7 frequency measurement application


brian rist

Question

1 answer to this question

Recommended Posts

There are a couple of ways to do this.

A standard approach is a dual slope or ratio-metric approach. Let's say you have a 100 MHz system clock and the signal that you want to measure is also a clock that is 15 MHz. You have one counter, clocked by the 15 MHz signal, count n cycles of the 15 MHz clock, say n=16384. While this clock is counting create a pulse. You can then use that pulse as a count enable for another counter clocked by the 100 MHz system clock, The ratio of the end count for this counter relative to 16384 allows you to calculate the frequency of the 15 MHz clock with relative accuracy. The longer the pulse the more accurate the calculation. The calculation could be done in logic but is easier in software. The assumption is that the 15 MHz frequency is stable for a period much greater than the pulse.

If the 15 MHz signal isn't a clock that's not a big impediment. You can create a registered version of the signal, clocked at the system clock, and use the signal and delayed version to create a leading edge pulse which would be used as a count enable for creating the pulse. In this case you only have one clock.

That's the basic idea. How you want to do this depends on how you need to use the calculated frequency.

This is a good beginner's simulation project. The first method is also a good beginner's project for timing constraints and multiple clock domains. In this case a few cycles of clocking error isn't a big deal, especially if you l repeat the measurement continually and average the results..

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...