From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C with USB-6002

Solved!
Go to solution

Hi everyone,

I am trying to use the USB-6002 DAQ to send data to two digital potentiometers using I2C.

I have used this DAQ to control an SPI potentiometer but I don't know how to even start the I2C communication.

Any help will be really appreciated.

Thanks.

 

PS. These poetentiometers are working fine using arduino but I want to control them with the USB-6002 DAQ.

0 Kudos
Message 1 of 8
(4,846 Views)
Solution
Accepted by topic author MamadouD

Due to the bi-directional signals of an I2C, I do not see this happening with a DAQ.  I recommend you just use an USB-8451 or USB-8452, which are devices specifically made for I2C and SPI testing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(4,835 Views)

Thank you 

0 Kudos
Message 3 of 8
(4,780 Views)

Glad you found a solution, but if you are ever looking to do SPI, or I2C on the cheap in LabVIEW, look into the Arduino boards using the LIFA or LINX toolkits.  (LINX being the newer one)  Both have a base firmware that gets put on the Arduino, and then on the palette there is functions for performing SPI or I2C functions on any of the digital lines.  This solution likely won't have all the functions of the 8451, and you won't get much support out of NI, but for <$20 it is worth trying out.  We had a setup using 8451's talking to a bunch of devices and was working well.  For the heck of it I threw in an Arduino Uno and changed out the called to use LIFA and the rest of the application ran just the same allowing us to save the hardware for another project.

0 Kudos
Message 4 of 8
(4,762 Views)

As another alternative, I am looking to use a SC18IM700 for my I2C testing.  Initial testing looks promising.  It just requires a serial port and possibly an RS-232 to TTL adapter.  It is also a chip, so it requires building a board.

 

The Arduino seems like it might be a better route if other circuitry is not required.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 8
(4,755 Views)

Hi there. I just came across your post. I too am going to try and use the USB-6002 to communicate with an SPI device, (a pressure sensor).

 

I haven't a clue where to start, can you suggest any pointers, example applications etc?

 

Best regards

Andrew

 

0 Kudos
Message 6 of 8
(4,309 Views)

@ASH2020 wrote:

Hi there. I just came across your post. I too am going to try and use the USB-6002 to communicate with an SPI device, (a pressure sensor). 


As already discussed here, the USB-6002 is not good for I2C, and either won't work, or after spending lots and lots of time, won't work well.  It really looks like a device made for doing buffered AIO/DIO, and not really for doing I2C communication.  But NI would recommend (as Crossrulz has already mentioned) one of these devices.

 

http://www.ni.com/en-us/shop/select/i2c-spi-interface-device

 

If you did purchase one of those they came with nice sets of drivers, and example code for doing I2C and SPI.  After looking at the examples I would suggest reading up on the manufacturer of the pressure sensor, they have details on how to read data and interpret it.

 

And as I have already mentioned a cheap alternative is an Arduino with LIFA or LINX.  This might not be a good solution for a rugged production system, but for testing, and understanding how to read data from a sensor, it is a great start.

0 Kudos
Message 7 of 8
(4,303 Views)

Thanks for the advice. I don't think I'll go there. There are some easy alternatives in the USB to SPI field. I just thought, as I already have the USB-6002 it might be an option. Cheers.

0 Kudos
Message 8 of 8
(4,299 Views)