05-10-2011 11:39 AM
Hi.
I need to generate two complementary signals of 200KHz and 45% dduty cycle 180° out of phase from each other.
I currently have CTR6 and CTR7 as outputs, with PF3 one connected to CTR6. I then configured CTR7 to be triggered off of PFI3, but I cannot get them to be 180° out of phase from each other. Any help is appreciated.
Thanks,
Joemar
Solved! Go to Solution.
05-11-2011 04:52 PM
Joemar-
I think it may help to know what device you are using. What is your physical setup?
Thanks,
Sean N
05-11-2011 05:45 PM
You need to pre-load one of the counters with an initial value, corresponding to the difference in phase, prior to starting the counter. You might be able to find sample code for this by searching the NI site for "pulse train delay."
06-06-2011 12:03 PM
I am using a PXI-6602 and using CTR6 and CTR7 as outputs. Thanks
06-06-2011 12:14 PM
Thanks for the delay suggestion. Tried it unfortunately the problem looks like both counters do not start at the same time. If I press RUN and STOP repeatedly, the counter the difference between the two pulses change.
I am running them in series in a single task, so I assume it is using the same clock.
Thanks
06-06-2011 02:26 PM
You could feed that output of a single counter to a tansistor or TTL inverter gate (7404) to obtain and inverted signal.
-AK2DM
06-06-2011 02:52 PM
Thanks, unfortunately I need some deadtime in between the two signals.
06-12-2011 05:43 PM
It sounds like you may need to try a master-slave setup so that one task is waiting for the other to begin. Once they are both started at the same time, then you can implement a delay.
Thanks,
Sean
06-16-2011 10:39 AM
Here, try this. The error routing isn't pretty but it'll do the job to help with sequencing. The keys are to
use "arm start triggering" to sync their start times and to specify 1/2 period difference in their initial delay
times.
You'll need to adjust the device names for your board and may need to use a different DO / PFI pair
to do the arm start triggering.
-Kevin P
06-16-2011 12:56 PM
Thank you guys for the suggestions. Special thanks to Kevin for creating the VI. Solution looks elegant but it a little bit more complicated than I would like, considering the PCB is already assembled and would not like to make changes if not absolutely necessary.
Initially I had CTR7 triggered on PFI3 (which is physically connected to CTR6) but that did not work for some reason, dont know why because that to me seems exactly the same as what I have below. Then I read somewhere that when you right-click on the I/O constant, there is an advanced option that allows you to pick CTR Internal Outputs. Now even if the two counters are on a different task (different clocks), they are in sync every time.
FYI, this is not the exact implementation I have since I needed to turn the counters ON/OFF at different times in the software, but this is essentially how I did it. I also changed the duty cycle to less than the original 45% spec.
Thanks again.
-Joemar