No affect on PLL


#1

OK, now that we can see signals (see my last thread) we have discovered that my LabVIEW code is not changing the clocks like it should.

I have built an interface in LabVIEW that is very similar to the FrontPanel design that is used to control the PLL and here are the steps that I take to set the clocks. (sorry about the length, but it is complete :wink: )

*Construct - to get a handle to the PLL

Set Ref Freq
*void okPLL22393_SetReference(unsigned long Handle, double Freq) - sending the handle and 48 for the freq - returns nothing

Set PLL0
*unsigned long okPLL22393_SetPLLParameters(unsigned long Handle, unsigned short int n, unsigned short int P, unsigned short int Q, unsigned short int Enable); - sending the handle, 0 for PLL0, P = 100, Q = 80 and Enable = 1 - return is 1
*unsigned long okPLL22393_GetReference(unsigned long Handle) - send the handle - returns 60

Set PLL1
*unsigned long okPLL22393_SetPLLParameters(unsigned long Handle, unsigned short int n, unsigned short int P, unsigned short int Q, unsigned short int Enable); - sending the handle, 0 for PLL0, P = 126, Q = 54 and Enable = 1 - return is 1
*unsigned long okPLL22393_GetReference(unsigned long Handle) - send the handle - returns 112

Set PLL2
*unsigned long okPLL22393_SetPLLParameters(unsigned long Handle, unsigned short int n, unsigned short int P, unsigned short int Q, unsigned short int Enable); - sending the handle, 0 for PLL0, P = 128, Q = 78 and Enable = 1 - return is 1
*unsigned long okPLL22393_GetReference(unsigned long Handle) - send the handle - returns 78.7692

Set up output A
*unsigned long okPLL22393_SetOutputSource(unsigned long Handle, unsigned short int n, unsigned short int Source); - send handle, n = 0 for CLKA, Source = 2 for PLL0-0 - Return is 52252344
*unsigned long okPLL22393_SetOutputDivider(unsigned long Handle,
unsigned short int n, unsigned short int Div); - send handle, n = 0 for CLKA, Div = 2 - return is 1
*void okPLL22393_SetOutputEnable(unsigned long Handle, unsigned short int n, unsigned short int Enable); - send handle, n = 0 for CLKA, Enable =1
*unsigned long okPLL22393_GetOutputFrequency(unsigned long Handle,
unsigned short int n); - send handle, n = 0 for CLKA - Return is 30

Setup output B
*unsigned long okPLL22393_SetOutputSource(unsigned long Handle, unsigned short int n, unsigned short int Source); - send handle, n = 1 for CLKB, Source = 4 for PLL1-0 - Return is 52252344
*unsigned long okPLL22393_SetOutputDivider(unsigned long Handle,
unsigned short int n, unsigned short int Div); - send handle, n = 1 for CLKb, Div = 8 - return is 1
*void okPLL22393_SetOutputEnable(unsigned long Handle, unsigned short int n, unsigned short int Enable); - send handle, n = 1 for CLKb, Enable =1
*unsigned long okPLL22393_GetOutputFrequency(unsigned long Handle,
unsigned short int n); - send handle, n = 1 for CLKb - Return is 14

Setup output C
*unsigned long okPLL22393_SetOutputSource(unsigned long Handle, unsigned short int n, unsigned short int Source); - send handle, n = 2 for CLKC, Source = 6 for PLL2-0 - Return is 52252344
*unsigned long okPLL22393_SetOutputDivider(unsigned long Handle,
unsigned short int n, unsigned short int Div); - send handle, n = 2 for CLKC, Div = 16 - return is 1
*void okPLL22393_SetOutputEnable(unsigned long Handle, unsigned short int n, unsigned short int Enable); - send handle, n = 2 for CLKC, Enable =1
*unsigned long okPLL22393_GetOutputFrequency(unsigned long Handle,
unsigned short int n); - send handle, n = 2 for CLKC - Return is 4.92308

Setup output D
*unsigned long okPLL22393_SetOutputSource(unsigned long Handle, unsigned short int n, unsigned short int Source); - send handle, n = 3 for CLKD, Source = 0 for REF - Return is 52252344
*unsigned long okPLL22393_SetOutputDivider(unsigned long Handle,
unsigned short int n, unsigned short int Div); - send handle, n = 3 for CLKD, Div = 1 - return is 1
*void okPLL22393_SetOutputEnable(unsigned long Handle, unsigned short int n, unsigned short int Enable); - send handle, n = 3 for CLKD, Enable =0
*unsigned long okPLL22393_GetOutputFrequency(unsigned long Handle,
unsigned short int n); - send handle, n = 3 for CLKD - Return is 0

Setup output E
*unsigned long okPLL22393_SetOutputSource(unsigned long Handle, unsigned short int n, unsigned short int Source); - send handle, n = 5 for CLKE, Source = 2 for PLL0-0 - Return is 52252344
*unsigned long okPLL22393_SetOutputDivider(unsigned long Handle,
unsigned short int n, unsigned short int Div); - send handle, n = 5 for CLKE, Div = 2 - return is 1
*void okPLL22393_SetOutputEnable(unsigned long Handle, unsigned short int n, unsigned short int Enable); - send handle, n = 5 for CLKD, Enable =0
*unsigned long okPLL22393_GetOutputFrequency(unsigned long Handle,
unsigned short int n); - send handle, n = 5 for CLKE - Return is 0

Then Destruct
void okPLL22393_Destruct(unsigned long Handle)

Now, I believe that the only difference between the way the FrontPanel and my code operates is that after you have all the settings the way you need, then the operator “Applies” those changes. In my code, you set the parameters and then run the code from beginning to end to program the PLL.

Did I miss a general PLL enable somewhere?

Thanks


#2

— Begin quote from ddmussel;1053

Did I miss a general PLL enable somewhere?

Thanks

— End quote

I’m not sure what you mean by this last statement. Can you clarify?

Remember that the PLL22393 object is just a container object for the parameters. You still need to call XEM3010::SetPLLConfiguration.


#3

Yes, that is what I was looking for. In the back of my mind I knew there was another function to call in order to get the PLL to program.

Now more questions;

The usage on the SetPLLConfiguration is:

unsigned long okUsbFrontPanel_SetPLLConfiguration(unsigned long Handle);

But is the handle that I send in the handle that I have used for the PLL calls, or the one for the Opal Kelly card?

And do I perform that function after all of the other proceeding steps, or do I have to set the configuration after every change?

I think I know the answers to the above, but…

Thanks


#4

First, the SetPLLConfiguration requires TWO handles. The first is the okUSBFRONTPANEL_HANDLE and the second is the okPLL22150_HANDLE. Where did you find the usage you mention? If it is in our materials, we need to fix them.

You make the call as soon as you have a consistent PLL setup that addresses all the changes you want to make in a single go. You could call it between each change, but that probably isn’t what you want to accomplish.

Each call to SetPLLConfiguration reprograms the PLL with the current configuration in the PLL object.