Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Clock output to PFI pin PCI-6602

Hi,

I wonder if someone can help me. I am using a PCI-6602 card as a counter/timer. I would like access to the internal timebase signal via a PFI pin so that I can use that clock to sync another device.

I have just got off the phone with NI who were exceptionally helpful and said that it is possible to "route" a signal to the PFI pin.

However, I am using register level programming (as I am in linux) and cannot find any information in the register level programming manual. I originally posted in the forum for the PCI-6602 but it was kindly suggested to post here.

We are not using the NI software even under linux as we have a stand alone piece of software for controlling an x-ray diffractometer.

Does anyone know how to do this? Or the register that needs to be set?

Many thanks,
Stuart
0 Kudos
Message 1 of 6
(8,427 Views)

Hi Stuart-

The 80MHz timebase on the 6602 can be routed directly to the I/O connector via PFI2 or PFI6.  This means that you need to write values to the I/O config registers on the first TIO chip.

The 660x manual is a bit cryptic, but the I/O config registers are laid out like this:

PFI[n]-PFI[n+1] -> 0x77C + n*2 (since it is a series of 16-bit r/w registers)

So, PFI2 would be contained in the 16-bit register at 0x77E.  PFI6 would be at 0x782.

The actual layout of the register is the same as described in the 660x RLP manual.  The bits of interest for this case are the A_Output_Select and B_Output_Select. 

In order to select the 80 MHz timebase for PFI2 or PFI6 you should write 0x3 to the appropriate Output_Select field. 

FYI- the MHDDK ChipObjects provide bitfield accessors that make the whole process a lot less cryptic.  We don't have an example specific to this app, but you can look at the other examples for the method used to access the chipobject structures.

I haven't tested this, but it should work.  Let me know if you have any problems. 

Thanks-

Tom W
National Instruments
0 Kudos
Message 2 of 6
(8,421 Views)
Hi,

Thank you very much for the information and reply, it is much appreciated.

Is this the same for the other pins which contain the divided clock frequencies, The 20Hz and 100kHz also?
I would set the output select field to 0x3 for the corresponding PFI pins?

Best wishes,
Stuart
0 Kudos
Message 3 of 6
(8,382 Views)
Hi Stuart-

Yes, the 20MHz timebase can be directly routed to PFI4 and the 100kHz timebase can be routed directly to PFI3.  The method for connecting those routes is the same as the method I described in my previous post.
Tom W
National Instruments
0 Kudos
Message 4 of 6
(8,380 Views)
Thanks, your help is really appreciated!
0 Kudos
Message 5 of 6
(8,365 Views)

Dear Stuart,

 

i would like to ask you a favour. Right now I'm busying myself with the ni-6602 card using comedi and rtai. Unfortunately  comedi stuff is not very well documented. I'm trying to trigger several counters to generate some synchronous pwm signals. As I understand, you are programming on register level without using any NI-software. Does your programm run under rtai ? Can you send me a copy of your source code, so i could use it as a template ?

 

Your help would be really appreciated.

 

Thanks,

 

Nico 

0 Kudos
Message 6 of 6
(7,763 Views)