UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
8,913 Views
Registered: ‎03-19-2015

I2C on ZC706 - How to Read ADV7511 Regs w/o IsRepeatedStart?

Hi,

 

In writing code for a Zynq on the ZC706 board in a polled (i.e., not interrupt-driven), baremetal environment using Vivado 2014.3, the "IsRepeatedStart" flag was available in the XIicPs data structure which effectively prevented the I2C transaction from being terminated. This was handy for splicing a I2C "write" operation followed by a "read" operation like the case where an internal register address needs to be written to the device (in this case, the Analog Devices ADV7511) and then the value subsequently read back from that device. The code was working fine using this technique and it was an unjoyful surprise to find out that that flag was removed in the 2014.4 version of the BSP! I didn't see any explanation as to why it was removed or any suggestion of what technique to use instead.

 

The Analog Devices' ADV7511 Hardware User's Guide describes a read from a single control register as being:

-> Start signal -> Slave address byte (R/W* bit low (i.e., write)) -> Base address byte -> Start signal -> Slave address byte (R/W* bit high (i.e., read)) -> Data byte from base address -> Stop signal -|

 

"Slave address" above is the address of the ADV7511 (0x39) and the "base address" is the internal register address (e.g., 0x00).

 

The code which worked previously was:

...

IicInstance.IsRepeatedStart = 0x01;  // Set flag to not issue Stop condition

Status = XIicPs_MasterSendPolled(&IiCInstance, RegAddr, 1, ADV7511_ADDR);

... (Check Status)

IicInstance.IsRepeatedStart = 0x00; // Clear the flag to end the I2C xaction after this read

Status = XIicPs_MasterRecvPolled(&IicInstance, RegValue, 1, ADV7511_ADDR);

...

 

The same situation exists for the Silicon Labs' Si570 device which is also used on the ZC706.

 

One approach would be to copy the old XIicPs_MasterSend / Recv routines into my module but that seems pretty desperate, isn't there another way?

 

Thanks!

Tags (4)
4 Replies
Xilinx Employee
Xilinx Employee
8,849 Views
Registered: ‎08-02-2007

Re: I2C on ZC706 - How to Read ADV7511 Regs w/o IsRepeatedStart?

hi,

 

which driver version are you using? as i understand the repeated start feature does not exist in the 2014.4 IICPS Driver 2.3. 

 

--hem

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
8,843 Views
Registered: ‎03-19-2015

Re: I2C on ZC706 - How to Read ADV7511 Regs w/o IsRepeatedStart?

hem,

 

Thanks. Yes, that is correct, the 2014.4 IICPS driver v2.3 removed the "IsRepeatedStart" flag and so my question is how to accomplish the repeated start without it. The previous code was developed in the 2014.3 environment with v2.2 of the IICPS driver and had the flag.

 

sr

0 Kudos
Xilinx Employee
Xilinx Employee
8,830 Views
Registered: ‎08-02-2007

Re: I2C on ZC706 - How to Read ADV7511 Regs w/o IsRepeatedStart?

hi,

 

We should copy the drivers from a previous installation and make them available for the newer build. Once you copy the driver source code from a previous installation, it will be made available for BSP generation. this will help you make the repeatedstart function available in the newer release.

 

refer to this AR to make the drivers of previous version made available in the current release.

http://www.xilinx.com/support/answers/35443.html

 

--hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
8,821 Views
Registered: ‎03-19-2015

Re: I2C on ZC706 - How to Read ADV7511 Regs w/o IsRepeatedStart?

hem,

 

Thank you. Yes, a "minimized" version of the old drivers and associated data structures could be incorporated as second or alternate routines that are only called by my routines with modified function and data type names provided. That would allow both the old and new forms of the drivers to coexist without conflict.

 

However, that doesn't seem to provide the best answer to the question of how to implement a "repeated start" I2C read access using only the newer version of the drivers. I'm feeling surprised that it was decided to remove this support from the drivers when there is clearly a need for this kind of operation. I know that other issues were discovered (see http://www.xilinx.com/support/answers/60695.html) but it seems like a bit of an overreaction to remove this support when a warning to potential users about that issue would have been sufficient. I now descend from this soapbox... :)

 

I had enough faith in my ignorance that there was / is a cleaner answer using the existing drivers.

 

sr

0 Kudos