LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Module

Hello everyone,

National Instruments provides NI-USB 8451 - I2C/SPI Interface with driver for LabVIEW

Best regards
Nick_CH
0 Kudos
Message 11 of 16
(2,190 Views)

hi,

I have the PCI 6541 and do u think it can be program as a I2C master output.
As i have a system need I2C input.
If yes, anyone have code can share?

0 Kudos
Message 12 of 16
(2,121 Views)
Hi kawaiicat,

Since I2C is technically only 0's and 1's, you could theoretically do it with your board using digital outputs at the right clock frequency.  However, it would be quite difficult, since you would have to do everything by hand.  We don't have any code to do this here at NI, but you might think about getting a USB 8451, which is a pretty affordable I2C device.  Good luck!
Chad B. » National Instruments » ni.com
0 Kudos
Message 13 of 16
(2,085 Views)
yes.. it is one of my choice.
but i just wnat to clarify what's the limitation like I2C interface data bus need to be input and output at the same time.
I dont' know if one channel can be output and become input in next clock cycle which is fast mode ~ 400kHz
as the I2C need to be output and get an acknowledge signal from slave and then keep on output data.

i am very interest in 8451, however, it only support up to 250kHz, am i right?
that i can't have the fast mode I2C to test.
any suggestion?

thanks
0 Kudos
Message 14 of 16
(2,080 Views)
You're right--the 8451 can only do I2C at 250 kHz.  As far as using a digital board, I don't think you can switch the input/output state of a line that quickly.  In order to reconfigure a digital line with DAQmx, you'd have to stop the DAQmx task, change the line, and restart the task, which won't happen in 1 400 kHz clock cycle.  You might be able to work up a hardware solution where you split the wires and have dedicated input and output "ports," but you would have to synchronize the DAQmx tasks, and the programming would get very complicated pretty quickly.
Chad B. » National Instruments » ni.com
0 Kudos
Message 15 of 16
(2,045 Views)

I've written some of my own VIs to do I2C interfacing manually without any additional hardware besides a digital I/O board. The code was a bit cumbersome at first but it seems to work alright. The clock speed cannot be too fast I noticed though because Labview won't go through its iterations fast enough to keep up with the edges that I'm outputting. If anyone is interested I can email it to them and they can take a look, use it, or try to improve it. The way it's set up now is that there are three VIs. One is main.vi, which you can control the other two from and you never have to look at. The other is set up to transmit 8 bits via I2C and the other is set up to receive 16-bits back via I2C. I was using them to start a serial ADC and read back the output.

Email: mceleste <NO SPAM> @ <NO SPAM> kvh. <NO SPAM> com

 

Any ideas on how to do it better without buying hardware are much appreciated.

Message Edited by elecengineer on 07-31-2007 07:30 AM

0 Kudos
Message 16 of 16
(1,985 Views)