LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA only I2C

Hi,

I am working to get accelerometer data onto an sbRIO 9636.
My accelerometer communicates over I2C, I have had success using it via the I2C

host API.

To improve performance I am trying to run "FPGA only", in the sense that I want FPGA to send I2C data requests to the sensor (without involving the RT computer) and have one way communication from FPGA to Real-Time by putting read data on a single DMA-FIFO along with values read from other sensors.

Also, my accelerometer requires enabling and setting on every reboot (this involves sending a particular sequence of bytes).

 

I have found "SPIandI2C FPGA Only.lvproj" example project but need help understanding how to use it.

The VI that contains the functionality I need should be "One I2C Port with One Command Sent" and/or "One I2C Port with Multiple Commands Sent".

  • One I2C Port with One Command Sent.vi
    What does "number of bytes to write" and "number of bytes to read "mean? These values are entered into the "Configure Port (I2C)" VI.
  • One I2C Port with Multiple Commands Sent
    How do I access the data read, and where do I put the commands to write?

Thank you
Sebastian

 

P.S.: In case it matters, I am on LabVIEW 2016.

0 Kudos
Message 1 of 3
(2,939 Views)

up

0 Kudos
Message 2 of 3
(2,877 Views)

When looking at the example, one the 'I2C Commication (Host).vi' open the diagram.

 

Inside the while loop is a "I2C Read Write' the top node of that is an Array of U8....this is the where you'd wire your data.

 

I2C is hex based, so you send data as an array of U8 values, there is a function in LabVIEW to convert 'Strings to Byte Array".

Regards

Jack Hamilton

0 Kudos
Message 3 of 3
(2,842 Views)