Forum Discussion

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

Cyclone 3 I2C

Hi,

I had a question about I2C on the Cyclone III. I have a design that uses some constants I would like to be able to change from a PC in real time. Is it possible to issue commands over the I2C bus that change internal RAM on the FPGA? Or is there a better way to do what I'm trying to do.

Thanks,

Andrew

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hi andrew,

    how will you be interfacing I2C to your PC?

    can you switch your design to use a UART rather than I2C? most computers have a serial port or can have one with a cheap USB interface. you could then issue commands from a serial terminal on your PC to your CIII.

    on the FPGA you could use a UART core or you could use NIOS and include a UART. if you use a UART core you'll need to write some HDL to interpret the incoming data, if you use NIOS you could write C to do the same thing.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Well, the interface to the PC is actually through a USB controller (separate IC) and the USB controller has an I2C master on it that could talk to the FPGA. The USB controller also has UART so I suppose I could try that. Seemed like overkill to change like 16 bits of data though. Would I2C not work for this?

    Thanks,

    Andrew
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    ok so you do have I2C access from a PC, cool. i've used both I2C and UART in the microcontroller world but only UART in FPGA. i haven't looked at the logic usage between the two protocols but i think that UART is simpler which is why i suggested it, along with most PCs being able to interface with it. you should be able to use I2C for your application.