Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

[FPGA] Trouble implementing I2C on myRIO

Hi all,

 

It's my first time posting on the forum. I am working on having a teensy 3.2 as a slave and myRIO as a master to transmit 24 bytes (6 float numbers) of data over. I got the labview real-time code to work and it is able to execute at 1000Hz rate which is attached as "I2C labview rt (working).vi". Now I am trying to implement the same code in FPGA but I am having a lot of trouble getting it to work. I kind of had it working but it's taking 3ms to execute and I think it's because of my wait function inbetween data transfer. However, if I take out the wait function my I2C bus line crashes. I have been trying to use an oscilloscope to observe what's happening but when I modify my "I2C read byte" it crashes my I2C bus and I had to power reset the myRIO to get it back to working. My working fpga code is attached below. Please let me know if I missed any details for my problem and thank you in advance. Here are the screenshots for both codes. 

Working I2C in RTWorking I2C in RTSemi-functional I2C in FPGASemi-functional I2C in FPGAI2C bit write subVII2C bit write subVII2C bit write ack subVII2C bit write ack subVII2C float read subVII2C float read subVII2C bit read subVII2C bit read subVII2C bit read ack subVII2C bit read ack subVI

Download All
0 Kudos
Message 1 of 2
(3,322 Views)

Hey hhsu24,

 

Do you have any updates on this? Could you give some more information about what's going on in your code?

 

 

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