Altera_Forum
Honored Contributor
13 years agoHow to create a programmable clock in RTL(Verilog)
Hello,
I'd like to be able to program a clock signal to be used internally for clocking other RTL blocks inside a Stratix FPGA. I have a 500 MHz system clock generated by an internal PLL and would like to use this clock to generate a slower clock based on the user-input value (32 bit). I have tried using an accumulator with the formula Fout = (Fsys x increment)/2^32. Fout = generated clock, Fsys = 500 MHz, increment = user-input data to generate Fout. The accumulator is 33 bits, the register to hold the increment data is 32 bits for high frequency step resolution. The math is accumulator[32:0] = acumulator[31:0] + increment[31:0]. Fout = accumulator[31]. My target Fout = xx Hz - 200 MHz. But as I tried to generate Fout around 100 MHz, the output waveform was no longer 50% duty cycle and the frequency step resolution got worse. Can someone provides some pointers on this or a new way of generating a programmable clock with high resolution on frequency step (1 Hz step would be great). Thank you, DN