Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect a locked/unlocked PLL

I am using a reference clock on RTSI7 to synchronize PLL's across multiple 6541 cards. Occasionally I receive a warning message that the PLL is not locked and my data may not be valid. Is there anyway to query the state of the PLL or otherwise wait until the PLL is known to be locked prior to calling Initiate ?
 
Thanks! - Gil
 
0 Kudos
Message 1 of 4
(5,277 Views)
Gil,

The niHSDIO Commit function will take all of the software setting you've setup and use them to configure the hardware appropriately.  The Initiate function does this as well but if you want to force your clocking changes before you call Initiate then use niHSDIO Commit.vi.  This vi will return an error if the clocking does not initialize correctly (ie PLL does not lock) and will return no error or warning if everything configured as expected.
0 Kudos
Message 2 of 4
(5,276 Views)
Hi Ryan -

This does not seem to be working for me. I Commit the sessions and the functions return with no error. Then I initiate and run, and everything seems fine. When I close the session, I occassionally get the warning about the unlocked PLL, although all the data collected seems just fine.

Hmmm... a thought just occurred to me. I wonder if perhaps I am closing the session responsible for exporting the reference RTSI clock clock prior to closing the session that is using this clock...

- Gil

0 Kudos
Message 3 of 4
(5,256 Views)


Hmmm... a thought just occurred to me. I wonder if perhaps I am closing the session responsible for exporting the reference RTSI clock clock prior to closing the session that is using this clock...

Gil,

If you are receiving a WARNING then this could very definitely be the cause. 

If you try to lock a PLL to a reference clock and it is either bad or not present such that the PLL cannot lock to it then you will receive an error.  If, however, the PLL is able to achieve lock and then during the generation/acquisition, the PLL comes unlocked (reference goes away or becomes too jittery) then you will only receive a warning.

Does this make sense?

As a quick test I ran a PCI 6541 with an external reference.  I try to run it with an external reference but no clock connected to the SMB.  When I run my code, I receive a hardware clocking error.  Next, I connect a 10MHz clock to the CLKIN SMB connector and rerun my code.  It runs fine.  Then, while its running I remove the 10MHz cable from the connector and notice that when I stop my code that I receive a warning.
0 Kudos
Message 4 of 4
(5,250 Views)