FrontPanel API  5.2.12
Public Member Functions | List of all members
okCPLL22150 Class Reference

Container class which holds the appropriate configuration parameters for a Cypress 22150 PLL. More...

Public Member Functions

 okCPLL22150 ()
 Default constructor.
 
int GetDiv1Divider ()
 Get the divider value for divider #1.
 
int GetDiv2Divider ()
 Get the divider value for divider #2.
 
DividerSource GetDiv1Source ()
 Get the source for divider #1.
 
DividerSource GetDiv2Source ()
 Get the source for divider #2.
 
double GetOutputFrequency (int output)
 Gets the current output frequency for a particular output.
 
ClockSource GetOutputSource (int output)
 Gets the current output clock source for a particular output.
 
void GetProgrammingInfo (unsigned char *buf) const
 Loads 'buf' with alternating address/data for programming the PLL.
 
double GetReference ()
 Get the current reference crystal frequency.
 
double GetVCOFrequency ()
 Get the VCO output frequency.
 
int GetVCOP ()
 Get the VCO P(total) value.
 
int GetVCOQ ()
 Get the VCO Q(total) value.
 
void InitFromProgrammingInfo (unsigned char *buf)
 Generates the PLL data from I2C programming data.
 
bool IsOutputEnabled (int output)
 Returns true is the specified output is enabled.
 
void SetCrystalLoad (double capload)
 Set the crystal load capacitance.
 
void SetReference (double freq, bool extosc)
 Sets the reference crystal frequency for output frequency computations.
 
void SetDiv1 (DividerSource divsrc, int n)
 Set the values for divider #1.
 
void SetDiv2 (DividerSource divsrc, int n)
 Set the values for divider #2.
 
void SetOutputSource (int output, ClockSource clksrc)
 Set the source for a particular output.
 
void SetOutputEnable (int output, bool enable)
 Set the output enable for a particular output.
 
bool SetVCOParameters (int p, int q)
 Set the VCO P(total) and Q(total) values.
 

Detailed Description

This is a container class which holds the appropriate configuration parameters for a Cypress 22150 PLL. The PLL has a single VCO but mutliple outputs with frequencies derived from dividers and switching blocks.

Python Note: Under Python, this class is simply called PLL22150. Therefore, if you import the ok library, you would refer to this class as ok.PLL22150.

Note that this object does not communicate with the XEM. That is, it does not reflect the state of the actual PLL. It is simply a container class used to configure and query the on-board PLL.

Typically, PLL settings will be set with the FrontPanel application and stored in EEPROM. In some cases, however, you may want your code to configure the PLL. Refer to the Cypress documentation to see how the various settings affect the output. The following example configures the VCO to operate at 400 MHz and sets up two outputs at 100 MHz and 50 MHz.

pll->SetReference(48.0f, false);
pll->SetVCOParameters(400, 48);
pll->SetDiv1(okCPLL22150::DivSrc_VCO, 4);
pll->SetOutputSource(0, okCPLL22150::ClkSrc_Div1ByN);
pll->SetOutputEnable(0, true);
pll->SetDiv2(okCPLL22150::DivSrc_VCO, 8);
pll->SetOutputSource(1, okCPLL22150::ClkSrc_Div2ByN);
pll->SetOutputEnable(1, true);
Container class which holds the appropriate configuration parameters for a Cypress 22150 PLL.
Definition: okCPLL22150.h:57
void SetOutputSource(int output, ClockSource clksrc)
Set the source for a particular output.
void SetReference(double freq, bool extosc)
Sets the reference crystal frequency for output frequency computations.
void SetDiv2(DividerSource divsrc, int n)
Set the values for divider #2.
void SetDiv1(DividerSource divsrc, int n)
Set the values for divider #1.
bool SetVCOParameters(int p, int q)
Set the VCO P(total) and Q(total) values.
void SetOutputEnable(int output, bool enable)
Set the output enable for a particular output.

At this point, the pll instance may be passed to okCUsbFrontPanel::SetPLLConfiguration to configure the on-board PLL. You can also use okCPLL22150::GetOutputConfiguration to verify that the output frequency is set properly.


Copyright (c) 2005-2023 Opal Kelly Incorporated