An Algorithm To Help Calculate P & Q Values

Question: How can optimal P and Q values for the CY22393, CY22394, and CY22395 be calculated without using CyberClocks?



If the application requires on-the-fly frequency changes and there is no access to CyberClocks, an algorithm can be used to to find the best P and Q values.

The PLL frequency or VCO frequency is calculated by the following equation:
VCO = Ref * P / Q

The output frequency is calculated by:
CLKOUT = VCO / Divider

Therefore the final equation is:
CLKOUT = (Ref * P / Q) / Divider
Keep the VCO running as fast as possible and use a low Q value

Here is an example of how to find the P and Q values:

1. Multiply the desired CLKOUT value as high as possible before the VCO maximum frequency is violated. The Divider value cannot be above 31 for VCO frequencies of 333MHz and above.
VCO = CLKOUT*Divider
VCO < VCOMAX (VCOMAX is 400MHz for commercial devices, 375MHz for industrial)

2. Once the desired VCO frequency is achieved, start a loop.
First loop on the Q value (Q is between 2 and 257). Check the phase detector frequency. Ref / Q must be larger than or equal to 250kHz.

Create a second loop on the P value (P is between 16 and 1600). Calculate Ref * P / Q. Calculate the ppm error between the desired VCO frequency and Ref * P / Q. If the ppm error is 0 exit the loop. Otherwise compare current ppm error to previously saved ppm error. If the current ppm is less than the saved ppm, save current ppm value

If there are no combinations that give an acceptable ppm value, go back to Step 1 and change the desired VCO frequency.

3. Once P and Q values are established, convert them to the base values used by the device.
P = (2 * (Pbase+3)) + Po (Po can be 0 or 1 and is used for odd numbers of P)
Q = Qbase + 2

Pbase and Qbase are used in the JEDEC file.

4. Compare the P value to the table in the datasheet for the charge pump setting.