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.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using I2C on the FPGA of MYRIO

I made a real time program that talks the the PmodCLS; however, for my fpga program is must run under the fpga, and under communications there is some I2C functions however the documentation is just limited to the context help file. Attached you will find my working realtime code, and besides it are the fpga I2c functions that I don't quite understand, for it appears that you can only write one byte on the I2C bus, and I need to write more than that.  See I2C fpga myrio problem.png.

 

----------------------------------------------------------------------

Well in trying to run the following code in nibug06162015d.png on my rio I got an error shown in nibug06162015a.jpg, and when I click show error it pulls up IP SPI&I2C.lvlib:Write Data.vi which has a fifo which can change dynamically as shown in nibug06162015b.jpg and can be any of the following cases as shown in nibug06162015c.png I typically use fifos with one variable and I do know you can make a custom control to have multiple variables in one fifo. But, how do you make a custom control for something that changes like this fifo? I thought maybe a tab control with an enum ring in one of the tabs, but would that really work right? The files are in nibug06162015c.zip

--------------------------------------------------------------------------

This is some info about the I2C implementation that I am trying to use that does not have any documentation on.

 

I2C&SPI API v3.0.0.22 by National Instruments Released On: Mon, 07 Jan 2013 15:50:27 -0600 Author: National Instruments Copyright: Copyright (c) 2012, National Instruments Compatible LabVIEW Versions: >= 2010. Compatible OS Versions: ALL. Repository Name: NI LabVIEW Tools Network

---------------------------------------------------------------------------

I tried another approach by trying to use the I2C engine, as an subvi. However, that generated so many errors I do not know what to do. First I added the engine shown in nibug06172015a.jpg to nibug06172015c.png and saved it as a subvi which I called in nibug06172015b.png and trying to run it gave me the following errors in nibug06172015d.jpg These files are in nibug06172015.zip

 

0 Kudos
Message 1 of 6
(6,584 Views)

The SPI and I2C Driver API - National Instruments Communication Engine Based on NI LabVIEW Real-Time and FPGA That are provided by NI that does not work on the my rio is at http://sine.ni.com/nips/cds/view/p/lang/en/nid/210637

 

0 Kudos
Message 2 of 6
(6,567 Views)

I tracked down the creator of the problems to the Initialize Port (I2C).vi  for it has vi defined FIFOs shown in 06182015a.png that is routed to private data out. Perhaps if I somehow could create the FIFOs in the my rio to match these FIFOs & Registers in the MyRio and modify the function to accept them as input that might just fix this code.

0 Kudos
Message 3 of 6
(6,563 Views)

Attempting to create real fifos instead the software fifos defined in the vi introduced some different error messages, I wound up porting most of the code from the I2C lib into my project, the more I ported the more errors were introduced.  So I then though about approaching this problem as if I had a CRIO.  So I could use the I2C express vi's; however, that did not work.  The I2C express vi's seem to be mutually exclusive of the Open FPGA reference vi's.  Whichever one starts first is the one that is used, leave it to NI to screw something else up.  I am going to try talking to the serial ports next to see if I can sweak that code by and use the Open FGPA Reference vi. 

Download All
0 Kudos
Message 4 of 6
(6,544 Views)

First, I tried the i2c express vis which did not go well, but luckly the PMODCLS also supports serial coms.  So the UART express vis only configure the serial port and write/read to the serial port using standard visa calls.  Which turns out to work, so it is possible to run a rt program on the my rio and call a program loaded in the fpga and obtain output from it.  Here is my final working program.

 

 

Download All
0 Kudos
Message 5 of 6
(6,534 Views)

First, I tried the i2c express vis which did not go well, but luckly the PMODCLS also supports serial coms.  So the UART express vis only configure the serial port and write/read to the serial port using standard visa calls.  Which turns out to work, so it is possible to run a rt program on the my rio and call a program loaded in the fpga and obtain output from it.  Here is my final working program.

 

 

Download All
0 Kudos
Message 6 of 6
(6,534 Views)