I'm in the process of designing a project with a Cyclone IVE. Part of this requires creating an adjustable clock to put out. I've so far settled on using the ALTPLL from the Altera IP Catalog to achieve this ( in reconfigurable mode). However, I still need to calculate the values for M, N and C in the PLL for a given frequency, where
Fout = (Fin * M)/(N*C)
Fin = input freq
Fout = output freq
M = counter (multiplier) part of clk feedback
N = counter (divider) part of clk feedback
C = post-scale counter (divider)
But I am at a loss as to how I could calculate these three values. I also have a nios ii processor running on this device, so an implementation could easily be done in C rather than a HDL. How could I arrive at these three values to give an accurate, given Fout when I have a fixed Fin?
Many thanks in advance.