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: 
Adventurer
Adventurer
11,056 Views
Registered: ‎04-24-2009

I2C (XPS IIC Bus Interface) how to connect ?

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.

 

Ahmed,

0 Kudos
12 Replies
Highlighted
Explorer
Explorer
11,039 Views
Registered: ‎07-14-2008

Re: I2C (XPS IIC Bus Interface) how to connect ?

library UNISIM;
use UNISIM.VComponents.all;

 

 

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.

0 Kudos
Adventurer
Adventurer
11,036 Views
Registered: ‎04-24-2009

Re: I2C (XPS IIC Bus Interface) how to connect ?

Hallo ,

 

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.

 

Ahmed ,

 

0 Kudos
Visitor sachingorkhe
Visitor
11,027 Views
Registered: ‎11-18-2007

Re: I2C (XPS IIC Bus Interface) how to connect ?

Hi,

 

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.

 

 

Regards,

Sachin 

0 Kudos
Adventurer
Adventurer
11,022 Views
Registered: ‎04-24-2009

Re: I2C (XPS IIC Bus Interface) how to connect ?

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. 

 

 

Ahmed ,

0 Kudos
Visitor sachingorkhe
Visitor
11,011 Views
Registered: ‎11-18-2007

Re: I2C (XPS IIC Bus Interface) how to connect ?

Ahmed,

 

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.

 

Regards,

Sachin 

 

0 Kudos
Adventurer
Adventurer
10,996 Views
Registered: ‎04-24-2009

Re: I2C (XPS IIC Bus Interface) how to connect ?

Sachin ,

 

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 .

 

Ahmed , 

0 Kudos
Visitor sachingorkhe
Visitor
10,989 Views
Registered: ‎11-18-2007

Re: I2C (XPS IIC Bus Interface) how to connect ?

Ahmed,

 

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,

 

Regards,

 

Sachin 

0 Kudos
Adventurer
Adventurer
10,982 Views
Registered: ‎04-24-2009

Re: I2C (XPS IIC Bus Interface) how to connect ?

Sachin ,

 

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 .

 

Ahmed,

0 Kudos
Xilinx Employee
Xilinx Employee
10,979 Views
Registered: ‎08-07-2007

Re: I2C (XPS IIC Bus Interface) how to connect ?

Hi Ahmed,

 

You don't have to worry about the iobufs. It will be handled by XPS automatically. 

 

-XF

0 Kudos
Visitor sachingorkhe
Visitor
5,058 Views
Registered: ‎11-18-2007

Re: I2C (XPS IIC Bus Interface) how to connect ?

Ahmed,

 

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.

 

Sachin 

0 Kudos
Scholar pumaju1808
Scholar
5,051 Views
Registered: ‎08-14-2007

Re: I2C (XPS IIC Bus Interface) how to connect ?

hi,

 

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

 

Regards

0 Kudos
Observer pritom
Observer
3,739 Views
Registered: ‎08-06-2010

Re: I2C (XPS IIC Bus Interface) how to connect ?

Hi,

 

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 ?

Tags (1)
0 Kudos