09-08-2009 08:41 AM
I am trying to use the pci 6224 in order to send SDA and SCL to an I2C. I have been able to control the Digital Output, but I have been unsuccessful with generating a clock source to satify the I2C. I am writing this code in C/C++. Any ideas or examples would surely be appreciated. I need a good starting point, but I have not been able to find any useful examples that have worked. I am using the SCB-68 and I am trying to use my digital multi-meter to verify my code.
I have looked at the examples provided, but is there a description of these functions that are being called using the NIDAQmx.h?
09-21-2009 04:41 PM
09-22-2009 07:11 AM
What about the frequency out? Can the freqout be used instead of the counters?
Will the freqout regulate the transmission of the digital output bits?
09-23-2009 11:45 AM
Hello VJohnson,
The counter will give you control of the clock frequency and duty cycle. However, this card also has correlated DIO, which means that you can clock your digital lines. Because of this, you can write a specific pattern (101010) to the buffer and just have it continuously output. However, you will have to write this in a way that you know what values you're writing based on the part of the clock you're at.
My I2C implemetation knowledge isn't the greatest, so I do not know how big each of your communication packets will be, but one implemetation would be to write your data in packets to regulate your SDA and SCL lines. The WriteDigChan-ExtClk is the best option that shows how to write a digital channel with a clock. You will just need to modify the DAQmxCfgSampClkTiming( function call. The second input should be changed from "/Dev1/PFI0" to OnboardClock or NULL. Hope this helps!