Forum Discussion
Altera_Forum
Honored Contributor
13 years agoCreate two counters, counter_1 incremented by the recovered clock, and counter_2 incremented by the 148.5 clock. Once counter_2 reaches a specific value (say 100000), check counter_1. If the two counters differ by a margin of +/- 1.001, then you know that the recovered clock is 148.35. If not, it is 148.5. The higher the count value (100000), the more precise the ppm detector is, but the longer it takes to detect the ppm. You will have to create some min and max count to prevent false detection when the recovered clock the reference clock only differ by a few ppm. I believe SDI has a max tolerance of 100ppm. You will also have to deal with CDC issues since the counters are in two different domains and you have to compare them.