I'm stuck with a sampling issue. I'm trying to sample a serial data line coming from a sensor. Basically, I send clk (max. 5Mhz) from the FPGA to the sensor, and then I receive the data bits from the sensor (1 bit per clock cycle).
I have written (in Verilog) a module to send a 5Mhz clk to the sensor, but I don't know how to sample a 5Mhz serial data line with a 50Mhz FPGA.
Any ideas?
-
\$\begingroup\$ What kind of FPGA? Different ones have different input capabilities. \$\endgroup\$crj11– crj112018年03月17日 00:48:07 +00:00Commented Mar 17, 2018 at 0:48
1 Answer 1
One simple way is to create a clock enable signal, which pulses high once every 10 clock cycles (of your 50 MHz system clock).
Register your incoming serial data as an input to a DFF, clocked with your system clock, and clock-enabled with the signal created above.
This keeps your registers clocked properly, and prevents cross-domain clocking issues.