Hi, I am trying to measure an input signal that will be a square wave of a certain unknown frequency in the range 1MHz to 4 MHz using an FPGA. I have no control over that input signal. The FPGA should be able to track the signal as it changes. Usually there is a +-5% max shift in frequency from time to time. There is no reference clock for this signal.
I am not sure a simple counter will be an effective solution in this case. I am afraid of setup time issues since the internal FPGA clock will not be synchronized with the external signal. Can one phase lock two signals easily in an FPGA? I would probably need a counter running at 400 MHz to effectively to measure a 1% change in a 4MHz signal accurately.
I am wondering if there is an asynchronous solution to this issue that might be more effective. Any ideas would be highly appreciated. Thanks a lot, Amish