FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6356 Discussions

Intel FPGA Avalon I2C (Master) Core F-RAM

Altera_Forum
Honored Contributor II
2,380 Views

Hello. 

I am trying to communicate with FM31278. 

Link: http://www.cypress.com/file/126916/download 

 

This device communicate via I2C. I Use Avalon I2C (Master) Core. I use altera example code found in datasheet.  

https://www.altera.com/content/dam/altera-www/global/en_us/pdfs/literature/ug/ug_embedded_ip.pdf 

 

 

This example doesnt work. I successfully wrote data to F-Ram. Then I call function "alt_avalon_i2c_master_tx_rx". This function returns status -2. I connected oscilloscope to the I2C and took a snapshot of the rx_tx message: 

 

https://alteraforum.com/forum/attachment.php?attachmentid=14570&stc=1 https://alteraforum.com/forum/attachment.php?attachmentid=14571&stc=1 It looks like it sends correctly tx message. Then it restarts and send write beside read message. I tryed to debug this example and cchecked whitch values It writes to the TFR_CMD register. It writes correct value (F-RAM address 83): 

 

IOWR_ALT_AVALON_I2C_TFR_CMD(i2c_dev->i2c_base,val | (issue_restart << ALT_AVALON_I2C_TFR_CMD_STA_OFST) | (issue_stop << ALT_AVALON_I2C_TFR_CMD_STO_OFST)); 

 

val: 167 

issue_restart: 1 

issue_stop: 0 

 

Please can you help me with this problem? I absolutely dont know why It doesnt work and how to fix this. 

 

Thank you.
0 Kudos
0 Replies
Reply