06-04-2009 07:11 AM
I want to use I2C core in my project , but I do not know how to connect it to the outside pins . Also , I read in the I2C doc that I need I/O bidirectional buffer in my design , how can I add this buffer , Is it already implemented or not ?
I am using virtex 4 FX12 FPGA with power pc processor.
I look forward for your help.
06-05-2009 01:07 AM
i_i2c_scl_iobuf : IOBUF generic map ( DRIVE => 12, IBUF_DELAY_VALUE => "0", IFD_DELAY_VALUE => "AUTO", IOSTANDARD => "DEFAULT", SLEW => "SLOW" ) port map ( O => SCL_I_I2C, IO => SCL_I2C, I => SCL_O_I2C, T => SCL_T_I2C ); i_i2c_sda_iobuf : IOBUF generic map ( DRIVE => 12, IBUF_DELAY_VALUE => "0", IFD_DELAY_VALUE => "AUTO", IOSTANDARD => "DEFAULT", SLEW => "SLOW" ) port map ( O => SDA_I_I2C, IO => SDA_I2C, I => SDA_O_I2C, T => SDA_T_I2C );
Just create two instances of the IOBUFFER macro and connect them like this to your processor core and toplevel ports.
06-05-2009 02:27 AM
Thank you for response , but could you tell me how to add this code to my project and where ?
I would be grateful , if you could provide some examples or application notes.
06-05-2009 05:02 AM
One thing can you please let me know. Are you using PPC with EDK suit or just calling PPC instance in your design and synthesis in ISE?
If you are EDK then the flow of instance instantiation is different.
06-05-2009 09:10 AM
I am using EDK only to implement my project. I have virtex 4 FX12 with power PC.
I hope this is the information that you are asking.
06-06-2009 03:32 AM
You need to import XPS IIC from IP catagory window ans drag it to system assembly window into the EDK.
The EDK will automatically attached the IIC to bus. If you want to use XPS IIC which is attached to PLB bus.
You can see the peripherals which are using in your system into the MHS files.
Hope this helps you. If you need anything on the same.
06-07-2009 12:12 PM
Thanks for your reply , I have done what you suggested ,but in the document of the XPS IIC , It is written "The module expects the design to
include bi-directional I/O buffers which implement open collector drivers for the SDA and SCL signals" , page2, so my question is how to add this buffer to the design.
and how to attach the XPS_IIC SDA and SCL to the external pins of the FPGA ,Is it enough only to modify the UCF constrains file.
Thank in advance .
06-07-2009 10:46 PM
What did I understand from your reply is, you want these SCL and SDA pins out of the FPGA..??
If so then you need to just go to the "Ports" window in system assembly and then expand the "xps_iic _0" and then select SCL and SDA pin to external connections. EDK will automatically added these pins to MHS and UCF. After you done with this changes do generate netlist and bitstream flow for complete synthesis flow. (Check once if your ucf is reflecting both the pins constraints before synthesis)
Hope this helps you,
06-08-2009 04:54 AM
I can get form your reply that by doing the steps you have mentioned ,the IIC will be ready to use ,and no need to worry about the I/O bidirectional buffer that is mention in the data sheet of the IIC.
I am confused because of what I have read in the data sheet , please could you have a look in data sheet of the XPS_IIC page 2 .
06-08-2009 05:21 AM
You don't have to worry about the iobufs. It will be handled by XPS automatically.
06-09-2009 02:40 AM
As I mentioned in my previous reply. You need not worry about the IOBUFs in your system.
XPS will do all this automatically. Just check your ucf once you add XPS IIC.
06-09-2009 08:19 AM
you only need to drag XPS_IIC core to your system assembly and in the ports window connect "Scl" and "Sda" IO pins, thats all you have to do
03-12-2012 03:52 PM
I am facing the similar problem here. In my EDK project, I have imported the iic core and routed its SCL and SDA signals to external IO pins in the VHDCI connector on a Spartan 6 FPGA. I also had to supply master clock (50Mhz), Vdd enable and reset signals to the other pins of the VHDCI connector as it is required for the VMODCAM that I am trying to communicate with, through I2C. But when I try to use the lower level or Upper level APIs of I2C core to communicate it can't write/read (send/receive) any databytes to the camera module using the I2C bus. The camera's device address on the I2C bus is 0x78.
For example if I try the following:
ByteCount = XIic_Send(IicBaseAddress, TempSensorAddress,
TemperaturePtr, 2, XIIC_REPEATED_START);
The ByteCount returns with 0.
Any idea what might have gone wrong ?