Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Toggle digital output on external trigger, synchronized with internal clock

Hi

 

I am using a PCIe-6251 width Daqmx in C#. The board has two timers and 24 digital IO where 8 of them can be hardwaretimed.

I have a digital output which should continously toggle on the rising edge of an external trigger. My digital output however, has to be in phase with an internally generated 5MHz clock, so that the toggle of the digital output is simultaneous with the rising edge of the 5MHz clock (within 10ns according to the specifications of the circuit i am interfacing with).

 

I have tried to generate a waveform with two samples, 1 and 0, and configure the sampleclock on the digital task to read the external trigger, but then I can't seem to synchronize the signal with the 5MHz clock. I know that the three signals cannot be in sync, since the external signal is nondeterministic, so my digital output should toggle on the _next_ rising edge of the clock, directly after the trigger has occured.

The external trigger is about 500Hz with a duty cycle of roughly 50% (generated by an optical sensor).

 

The application is interfacing with an AD converter, where the digital output is used for timing the integration period, so precision of the signal is all-important.

 

Hope there is a solution out there.

Regards Mikkel Engbo.

0 Kudos
Message 1 of 1
(5,102 Views)