Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Interfacing a Spartan 3E xps_iic to an external peripheral through I2C bus.

Status
Not open for further replies.

Yosmany325

Member level 3
Joined
Oct 31, 2012
Messages
62
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
1,758
Hello everyone, I want to use the XPS I2C IP Module (v2.03a) to interface an external memory chip (24LC512) in an embedded system based on Microblaze Xilinx's processor. My question is about the external connections. From the IP module datasheet I read the signal names and descriptions but I'm not sure if is possible to directly use the signals Sda and Scl shown in the Ports section (see the highlighted names in the figure attached).

I want to know if internally the IP module has the open drain buffers required for I2C bus and I must provide external pull ups or if I must insert the buffers and connect them to the IP module. Thanks in advance. Yosmany325

Captura.PNG
 

The highlighted Sda and Scl are both shown as IO i.e. bi-directional lines. This means they are likely setup to behave as pseudo open-drain (basically connect the output signal to both the output and the tri-state control).

The documentation for the core itself does not show the core having a Sda-Scl lines only the Sxx_I/O/T lines, so I guess the XPS tool is being helpful and is adding a wrapper that has the bi-directional IO instantiated. I would assume that you need to make the Sda/Scl external connections to the pins of the device.
 
Thank you very much ads-ee for your fast reply. Indeed I think should be this way, the point is to know from someone who had used this in real hardware. Thank you one more time. Yosmany325.
 

I've never used it in an XPS design, the last time I used an I2C core it was a version from OpenCores instantiated in the design.

The last XPS design I worked on used an embedded PPC and was not the top level of the design.
 

Hello, finally I tested the IP module, automatically the XPS inserts the required buffers. The point is to use the signals named Sda and Scl. These signals should be connected to external ports. Below is a fragment of the MHS and UCF files.

UCF
-----------------

# I2C
NET xps_i2c_Sda_pin LOC=A6 | IOSTANDARD=LVCMOS33 | SLEW=SLOW | DRIVE=4 | PULLUP; # IO5
NET xps_i2c_Scl_pin LOC=B6 | IOSTANDARD=LVCMOS33 | SLEW=SLOW | DRIVE=4 | PULLUP; # IO6


------------------------

In this case I use PULLUP because there aren't external pull ups.

MHS
------------------

PORT ....

PORT xps_i2c_Sda_pin = xps_i2c_Sda, DIR = IO
PORT xps_i2c_Scl_pin = xps_i2c_Scl, DIR = IO

PORT ...

....

BEGIN xps_iic
PARAMETER INSTANCE = xps_i2c
PARAMETER HW_VER = 2.03.a
PARAMETER C_BASEADDR = 0xC0000000
PARAMETER C_HIGHADDR = 0xC000ffff
BUS_INTERFACE SPLB = mb_plb
PORT Sda = xps_i2c_Sda
PORT Scl = xps_i2c_Scl
END

Using this example I can work with I2C peripheral.

Thanks to all the people who also replied this thread. Yosmany325.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top