02-11-2020 05:52 PM - edited 02-12-2020 01:59 PM
Hi all,
I am trying to use two different clocks on kintex-7 FPGA KC705 board. 200Mhz (system clock) and 199.9Mhz (sma external clock).
With two clock domains like this, how do I detect the aligned edge of these two clocks?
Thanks,
02-12-2020 12:03 PM
Short Answer = Not easily
199.9Mhz period differs from 200mhz clock period be something like 2.5ps, so you will struggle to get this to work in an fpga. Even if you used the mmcm and phase shift one versus the other the best you can do with the mmcm fine phase shift is 1/56 of the VCO period, even with the highest supported VCO frequency this would still only equate to ~11ps
Another thing is what are you planning to do here? Let's say you could align them the edges would only line up very infrequently only once every couple of thousand clocks
02-12-2020 12:07 PM
If the frequencies are different, the edges will align sometime periodically... a stopped watch tells the right time twice a day
Even if you were able to delay one clock respect to the other, it's going to be for a single period then gone, so why?
02-12-2020 12:10 PM
Unless someone proves me wrong, with time I'm more and more convinced there are lots of people thinking FPGAs, just because they are big and expensive, can do whatever one can ask. I'll try tomorrow asking a Virtex-7 to fill a glass with water.
02-12-2020 12:58 PM
The reason for having two clocks close to each other is for an RF system we had we need to generate some baseband signal that has small clock offset, so we can use correlation to obtain a delay profile.
All I need to do is as I reset the board(as a signal generator), the two outputs will reset and wait for the next time instant where two clocks have aligned edge with each other and start output on its own clock.
02-12-2020 01:01 PM
In this case, two clocks will align every 2000 period. And you may see the reason of doing this in my earlier reply.
Thanks!
02-12-2020 01:08 PM
??????
Okay, you may have two base signals with a small delta, but your sampling frequency can be the same.
anyways, according to
"reset the board(as a signal generator), the two outputs will reset and wait for the next time instant where two clocks have aligned edge"
your problem is not that of manipulating clocks (as I understood) but detecting clock coincidence. That's going to be tricky with an FPGA.
02-12-2020 01:10 PM
02-12-2020 02:01 PM
Yes, I think I express my need inaccurately, and I have edited the original post. Thanks for pointing it out. I am trying to find where the two clocks edge align.
02-12-2020 02:07 PM
02-12-2020 02:10 PM
02-12-2020 04:05 PM
Thanks, I will look into it