Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Divide External Clock by 2?

Solved!
Go to solution

I have an external clock 20 MHz connected to APFI1, that I want to use as the sampling clock for 16 digital inputs. Unfortunately I meant to divide this clock by 2 in hardware but forgot in the mad rush to get the board out. Now I am left with a problem! The NIDAQ card that I am using (NI-6289) cannot sample digital inputs faster than 10 MHz so just sampling and decimating in software isn't an option. Also, it looks like the counters cannot handle ticks being less than 2 so the lowest I can divide the external clock down by is 4. The only option that I see at this point is to use the external clock as a trigger for a free running counter off of the 80 MHz clock. The counter would then serve as the clock for the digital inputs. However, I'd like to retain the flexibility to change the external clock and not be constrained by the software.

 

I was initially encouraged by this thread, but unfortunately it doesn't seem possible with digital inputs.

 

http://forums.ni.com/t5/Multifunction-DAQ/Analog-Sample-Clock-Division/m-p/1201687/highlight/false#M...

 

Is there anyway to divide this clock by 2 and use it for digital inputs???

 

Thanks,

Drew

 

0 Kudos
Message 1 of 6
(4,404 Views)

Hi Drew,

 

You are correct in that you cannot use and divide down a 20MHz reference clock for digital I/O. You can, as you mentioned, create a sample clock from a counter and use that instead.

Best regards,
Rohan B
0 Kudos
Message 2 of 6
(4,377 Views)
Solution
Accepted by SuperSnake428

Hi Drew,

 

I think you can probably get this to work using a counter output task set to Pulse Mode instead of Toggle (the default).  Here is an example showing how to configure the counter in this manner.  I just posted the example so you may need to wait a few moments before the upload completes.

 

 

Best Regards,

John Passiak
Message 3 of 6
(4,366 Views)

John,

 

Wow, great example. Quick question though, it doesn't seem like a digital input can use a counter output as a clock? Is that right or am I missing something here? The clocking scheme for the digital inputs has left me quite underwhelmed, particularly when compared to the analog options.

 

Drew

0 Kudos
Message 4 of 6
(4,314 Views)

Nevermind! Temporary brain meltdown. You can use the CtrlOutput terminal to route it to a PFI which can be used.

 

Thanks again John.

 

Drew

 

0 Kudos
Message 5 of 6
(4,309 Views)

Hi Drew,

 

You should be able to right-click on the DAQmx Terminal constant or control and select I/O Name Filtering.  Then check the "Include Advanced Terminals" box.  This should now populate the list with many more options, including the Internal Outputs of the Counters. 

 

21515iF254553E6A9780DE

 

 

Of course, there's also not a problem with routing the signal back to the DAQ device with external wiring.

 

For a full list of available routes, you can check the Device Routes tab in MAX.

 

 

Also, you'll be happy to know that our latest DAQ line (X Series) have dedicated timing engines for digital lines, so they should be pretty much the same as the timing options for the analog lines.  However, in this particular case you would still want to use the counter as a sample clock (the fastest X Series boards also have a maximum DI rate of 10 MHz).

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 6
(4,273 Views)