cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
503 Views
Registered: ‎02-11-2020

Finding the aligned edge of two clock

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,

0 Kudos
11 Replies
Highlighted
Moderator
Moderator
451 Views
Registered: ‎04-18-2011

Re: Alignment of edge with two clock sources

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

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Highlighted
Explorer
Explorer
447 Views
Registered: ‎04-19-2018

Re: Alignment of edge with two clock sources

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?

 

Highlighted
Explorer
Explorer
439 Views
Registered: ‎04-19-2018

Re: Alignment of edge with two clock sources

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.

0 Kudos
Visitor
Visitor
416 Views
Registered: ‎02-11-2020

Re: Alignment of edge with two clock sources

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.

0 Kudos
Highlighted
Visitor
Visitor
411 Views
Registered: ‎02-11-2020

Re: Alignment of edge with two clock sources

In this case, two clocks will align every 2000 period. And you may see the reason of doing this in my earlier reply.

Thanks!

0 Kudos
Highlighted
Explorer
Explorer
407 Views
Registered: ‎04-19-2018

Re: Alignment of edge with two clock sources

??????

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.

0 Kudos
Highlighted
Teacher
Teacher
399 Views
Registered: ‎07-09-2009

Re: Alignment of edge with two clock sources

What do you mean by
"how do I align the edge of the two clocks at some point"

as you say, they will do so anyway on a regular basis.

Can you draw a diagram of what you want as its not at all clear to me .
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Highlighted
Visitor
Visitor
379 Views
Registered: ‎02-11-2020

Re: Alignment of edge with two clock sources

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.

0 Kudos
Highlighted
Teacher
Teacher
376 Views
Registered: ‎07-09-2009

Re: Alignment of edge with two clock sources

By editing your original post, you have nullified all the following answers !!!!
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Highlighted
Teacher
Teacher
368 Views
Registered: ‎07-09-2009

Re: Finding the aligned edge of two clock

would a phase detector give you the answer your after,
The output would be proportional to the phase difference, so it will have a signal on it the zero point you have zero off set.
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Highlighted
Visitor
Visitor
303 Views
Registered: ‎02-11-2020

Re: Finding the aligned edge of two clock

Thanks, I will look into it

0 Kudos