Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

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,

Andrew

9 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

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

    Jake
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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.