Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Emulation with DIO

Hi,

I have the USB-6343 and will make a I2C Emulation with 2 DIO, I2C-Emulation should control a Digital Potentiometer.

Has anyone an idea or a example to this topic?

Regards

0 Kudos
Message 1 of 3
(7,229 Views)

Hi Pgamp,

 

I don't think it is possible to do what you wish to do with the card you have.

 

See this document, it explains what you can do with the I2C Two Wire Bus Interface with LabVIEW.

 

Regards,

 

Sarah

0 Kudos
Message 2 of 3
(7,206 Views)

Pgamp,

 

What Sarah said is correct, to an extent, but you might be able to do what you need with the USB-6343. The USB-6343 is not idea because of the half-duplex (bi-directional) communication. With I2C you typically get a Serial Data and Serial Clock line and on that serial data line you would expect both the master (control device) and the slave (sensor) to be able to drive that line. With the NI DAQ cards (DAQmx devices) there isn't a way to quickly (hardware timed) switch from having a digital line be in generation mode and then switch over to acquire mode. In DAQmx you have to stop your generation task and then start an acquisition task. Sometimes for I2C this is too slow and the time it takes to switch causes the command coming back to the device to be missed. Some NI-HSDIO devices have a feature called Per Cycle Tristate. With the circuitry on those boards you can essentially write on one clock edge and read on the next clock signal. This makes I2C communication feasible for those devices.

 

With that said, there is nothing stopping you from sending I2C commands or receiving I2C commands, the problem comes when trying to quickly switch between the two.

 

There area  couple of documents that I would point you to that will help out.

 

First: Serial Protocol Communication Reference Design, this talks about I2C, SPI and JTAG. It gives you some more background on doing these protocols with NI hardware, it does include a section on DAQmx devices as well.

 

Second: I2C Digital Waveform Reference Library, a reference design that can be used to format waveforms for I2C generation. There is also a discussion forum linked that has many discussions on using DAQmx devices for I2C communication.

 

Hope this helps!

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 3 of 3
(7,201 Views)