FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP

I2C Controller

Altera_Forum
Honored Contributor II
1,277 Views

Hi, 

 

I have an FPGA design that relies on a couple "constants" in registers that I would like to make changeable over an I2C interface. Does anyone know if there is a standalone core I could use without having it be part of a processor or anything? 

 

Thanks, 

Andrew
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
486 Views

Hi Andrew, 

I don't know if this can help you, but on the 

http://www.opencores.org/?do=project&who=i2c 

there is a i2c controller core that use Wishbone interface! I used the core and it works fine.
0 Kudos
Altera_Forum
Honored Contributor II
486 Views

I have a simple I2C-Slave from an old design, mixing schematic and VHDL design Please check if it's of any use for you. It has been using a 8 MHz clock originally. The I2C connection is intended to use an external buffer for 5V capability, for a 3.3V bus, you can use internal IO of course.

0 Kudos
Altera_Forum
Honored Contributor II
486 Views

FYI. Don't know if you have the option but SPI is slightly easier to work with. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
486 Views

I'm using a USB controller (FX2LP) that is communicating with the FPGA, but from what I've read the FX2LP doesn't have a SPI interface. It has standard serial pins, but that's not the same, is it? I've never used SPI so I don't know what's involved. When you say easier do you mean more cores are available or is it just a simpler protocol? 

 

Meanwhile I'll take a look at the design FvM sent. Thanks for that. 

 

Andrew
0 Kudos
Altera_Forum
Honored Contributor II
486 Views

Oh, one other thing, I was checking out the opencore design but that seems like its a master only. Has anyone used any of the slave designs on opencores and do they work reliably?

0 Kudos
Altera_Forum
Honored Contributor II
486 Views

With FX2, an I2C controller is already present while SPI has to be emulated by I/O bit-banging. Thus I2C needs less resources at the uP side and can operate faster. If the FPGA is intended to be configured by the uP through passive serial, you need to create an SPI-like interface anyway and can use it for runtime communication as well. 

 

SPI at the FPGA side is actually somewhat more simple than I2C, basically a shift register only.
0 Kudos
Altera_Forum
Honored Contributor II
486 Views

Thanks for all the help everyone. I spent a little time playing around with a slave I2C core from opencores (http://www.opencores.org/?do=project&who=i2cslave) and much to my delight it worked on the first try! So if anyone needs to do a similar thing check out that core, its super easy to use. 

 

Andrew
0 Kudos
Altera_Forum
Honored Contributor II
486 Views

Sorry, a bit late coming to the party. 

 

However if anyone wants a 'dumb' I2C master that can be used to load up some registers I have a free download here, http://www.singmai.com/pt1.htm

 

Dan. 

http://www.singmai.com/index.htm
0 Kudos
Altera_Forum
Honored Contributor II
486 Views

try this: http://www.grigaitis.eu/?p=18 

 

there is I2C master and works very fine. There is an example for NIOS IDE.
0 Kudos
Reply