12-03-2021 03:24 AM
Hi,
we'd like to emulate an I²C-Master with DAQmx-Hardware. Hardware used may be mainly NI PXI-6225, PXI-6229, USB-6008 and similar. I know that while emulating the interface in "bit-bang mode", we need to face some tradeoffs campared to the full I²C-specification, like lacking the capabilities of clock stretching or multimaster-mode. That's not an issue for us.
I tested my code successfully on an USB-6255. Now I tried to port it to an USB-6001. The device specification says, that this device has a built-in counter. Unfortunatelly, I can't use it for clocking the data on the device's GPIOs.
1. DAQmx Timing (Sample Clock).vi throws a pretty cryptic error:
DAQmx Create Channel (DO-Digital Output).vi:6970001<append>
<B>Device Specified: </B>Dev1
<B>Task Name: </B>_unnamedTask<13>
2. DAQmx Creat Channel (Co-Pulse Generation-Frequency).vi can't input anything at the input "counter" (drop-down menu is empty)
Can anyone give me a hint, why the code doesn't work with NI USB-6001? Does the device lack any functionality used in the code?
I attached a screenshot of the code and my low-level vi. The whole project is a lot bigger but all VIs are branded. If necessary, I can provide the complete source code to NI under NDA.
12-03-2021 10:49 AM
It might be worth trying to define your clocking parameters in NI MAX for the 6001 to see if it will run. If you get it to go in NI MAX you can save the DAQmx task and use it in the LV code. I have had to make specific cases and tasks for various hardware because not all hardware supports all DAQmx tasks.
12-03-2021 03:51 PM
The single counter in a USB-6001 is very limited. It can't be used for outputting pulses or for most measurement tasks (such as frequency, pulse width, semiperiod, and more). It can only count edges in software-timed mode. See the spec sheet for more info.
-Kevin P
12-03-2021 04:28 PM
An easier alternative is to use USB-845x in I2C mode.