SPI and I2C Communication Using a Compact RIO

Updated Oct 2, 2019

Reported In

Hardware

  • NI-9401
  • NI-9402
  • CompactRIO Single-Board Controller
  • CompactRIO Controller

Issue Details

Is is possible to implement SPI or I2C communication using a Compact RIO?

Solution

National Instruments provides a free SPI and I2C driver API which uses the FPGA digital I/O lines to communicate with SPI or I2C devices.

When selecting the digital hardware there are three options to consider:
  • NI Single-Board RIO hardware works with both SPI and I2C drivers.
  • NI 9401 C Series module works best with SPI drivers.
  • NI 9402 C Series module works best with I2C drivers.

Additional Information

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.

Note: Support for this product is provided on the NI Developer Forums at forums.ni.com

WAS THIS ARTICLE HELPFUL?

Not Helpful