Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

Choosing appropriate parameters to dynamically reconfigure the PLL in Cyclone IV

$
0
0
Hello!
I am using ALTPLLRECONFIG megafunction (Quartus II 13.0 Web Edition) to dynamically change clock signal. This megafunction requires input data such as: M, N and c0. The combination of these numbers affects multiplication and division factors and, therefore, output frequency.
My goal is to change PLLs output frequency using my own user interface. I enter frequency in my GUI and it calculates M, N and c0 parameters using brute matching. Then I send these parameters via USB to my Altera device and reconfigure the PLL using ALTPLLRECONFIG megafunction. It should be noted that everything works fine and output frequency is changing like I want during I am using M, N and c0 parameters like in Quartus II software


In my GUI M, N and c0 parameters are calculated with a simple formula: F_in/F_out = divfactor/multiplicationfactor = c0*n/M. But not every calculated numbers work.

When I am setting ALT_PLL's output frequency in MegaWizard, the ALT_PLL generates her own special numbers automatically: M, N and c0.
The question is - how these numbers are generated by ALT_PLL? Are there any restrictions except (1 < M, N, c0 < 512) and (600 MHz < Fvco < 1300 MHz)? It seems that there are some other restrictions, because when I want to set output frequency at 5.875 MHz, my GUI calculates following parameters, and they are not working:
params.jpg
N = 1, M = 47, c0 = 216, vco = 1269 MHz.

When I send them to ALTPLLRECONFIG, it seems that these parameters are not appropriate, because instead of 5.875MHz i see approximately 5.4 Mhz at my oscilloscope. But when using parameters that were choosen by Quartus everything is fine:
N = 2, M = 47, c0 = 108, vco = 634.5 MHz.
It seems strange, because both mine and Quartus parameters match all restrictions. My algorithm can calculate such parameters as Quartus calculates, but it meets my parameters first, because algorithm starts with N = 1. As my parameters seems appropriate and they are found first, it chooses them. So I need another criteria to choose appropriate parameters.
Compairing my parameters with Quartus parameters is not a choice for me, my GUI should calculate them automatically based on PLL specifications and restrictions.

Hope you will help. Thanks in advance!

Alexander
Attached Images

Viewing all articles
Browse latest Browse all 19390


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>