Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Communication with NI-9401 or NI-9403 Modules

Solved!
Go to solution

I need to configure a component over I2C and the only DIO modules I have are the NI-9403 (slow, 32-channel) and NI-9401 (fast, 8 channel). I'm using the cRIO-9048. I have found this NI article about I2C communication. It says:

 

"I2C communication requires the device to tri-state the DIO lines on the fly. The 9401 is unable to do this without external hardware. NI thus recommends the 9402 for I2C communication."

 

So I can't use that package with my 9401, but can I use the 9403? I downloaded the package and dove into the subVIs a bit and found that the I/O is accessed inside a single-cycle timed loop. It seems the 9403 does not support use in a SCTL and changing it to a normal while loop doesn't seem to work (not surprising). 

 

I managed to find another package called I2C Implementation in LabVIEW FPGA by NI, which seemed promising. Looking at the VIs it doesn't seem to rely on an SCTL. However, I can't seem to make it work - there are all sorts of "not executable" errors. Maybe I just haven't installed it correctly, or it's for an older version of labVIEW or hardware.

 

Am I out of luck? Can anyone recommend another LabVIEW I2C package that will work for me?

0 Kudos
Message 1 of 3
(1,651 Views)
Solution
Accepted by topic author mtuell
  1. You already have an HW limitation that cannot implement the PHY of the I2C protocol.
  2. You have to work around your HW limitation by adding external tri-state buffers with direction switching capability
  3. None of the available packages or libraries would work with your HW limitation
  4. If you proceed with your present DIO HW without external circuits, you are going to risk damaging the external device you're trying to communicate with
  5. But, this does not mean that you cannot implement a working I2C solution with what you have
    • I have done SW timed I2C protocol implementation using USB-6509 and external circuitry for the bi-directional tri-state capability

Now, the question is, are you going to spend time to implement something or spend money to get an HW that works with readily available libraries. Either way, it is going to cost you money in terms of time or new purchase.

 

In my opinion, buying 9402 modules is the best way, because it costs only ~USD350 and if you consider the time you spent to just explore the options and implement, it will be a magnitude larger than this USD350

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 3
(1,639 Views)

Another option:

NXP has chips that can accept a UART (TTL or LVTTL) and do the I2C communications for you (I think you would want the SC18IM700IPW).  So you could use the RS-232 port on your cRIO, go through an adapter to get down to TTL voltages, and communicate with the I2C mater chip.


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 3 of 3
(1,634 Views)