Forum Discussion
I2C Controller
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, Andrew9 Replies
- Altera_Forum
Honored Contributor
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. - Altera_Forum
Honored Contributor
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.
- Altera_Forum
Honored Contributor
FYI. Don't know if you have the option but SPI is slightly easier to work with.
Jake - Altera_Forum
Honored Contributor
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 - Altera_Forum
Honored Contributor
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?
- Altera_Forum
Honored Contributor
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. - Altera_Forum
Honored Contributor
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 - Altera_Forum
Honored Contributor
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 - Altera_Forum
Honored Contributor
try this: http://www.grigaitis.eu/?p=18
there is I2C master and works very fine. There is an example for NIOS IDE.