FrontPanel API 5.3.5
Loading...
Searching...
No Matches
okCPLL22150 Class Reference

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

Public Member Functions

 okCPLL22150 ()
 Default constructor.
 
double GetCrystalLoad () const
 Get the crystal load capacitance.
 
int GetDiv1Divider () const
 Get the divider value for divider #1.
 
int GetDiv2Divider () const
 Get the divider value for divider #2.
 
DividerSource GetDiv1Source () const
 Get the source for divider #1.
 
DividerSource GetDiv2Source () const
 Get the source for divider #2.
 
double GetOutputFrequency (int output) const
 Gets the current output frequency for a particular output.
 
ClockSource GetOutputSource (int output) const
 Gets the current output clock source for a particular output.
 
void GetProgrammingInfo (okTPLL22150ProgramInfo buf) const
 Loads 'buf' with alternating address/data for programming the PLL.
 
double GetReference () const
 Get the current reference crystal frequency.
 
double GetVCOFrequency () const
 Get the VCO output frequency.
 
int GetVCOP () const
 Get the VCO P(total) value.
 
int GetVCOQ () const
 Get the VCO Q(total) value.
 
void InitFromProgrammingInfo (const okTPLL22150ProgramInfo buf)
 Generates the PLL data from I2C programming data.
 
bool IsExternalOscillatorEnabled () const
 Returns true if external oscillator is enabled.
 
bool IsOutputEnabled (int output) const
 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:59
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-2024 Opal Kelly Incorporated