03-19-2015 10:10 AM
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?
03-22-2015 06:04 PM
which driver version are you using? as i understand the repeated start feature does not exist in the 2014.4 IICPS Driver 2.3.
03-23-2015 06:20 AM
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.
03-23-2015 05:08 PM
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.
03-24-2015 06:27 AM
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.