Forum Discussion

PedroJServian's avatar
PedroJServian
Icon for New Contributor rankNew Contributor
8 months ago
Solved

Doubts about the implementation of I2C in my FPGA

Good morning,

I am designing a communication between my FPGA MAX10 and my microcontroller. The FPGA detects some hardware faults from different sources and then it communicates to the microcontroller with a decoding communications (5 data lines with read enable from FPGA to uC, there can be 20 faults, if it is active the fault nº5 it sends 00101 and so on). So I use 7 pins to communicate wit hte uC. I am increasing my project and I am having problems with the numbers of pins that are routed to the FPGA. So I thought to send those faults with another communication and I thought about the I2C (only 2 pins).

I saw in the IP Catalog the I2C Slave To Avalon-MM Master Bridge Intel FPGA IP. What I would like to know is if this IP can be used to communicate with I2C with an external microcontroller (texas family) and not having problems. I am new designing FPGAs and I get usually lost with comms.

I will wait for your answer. Have a nice week.

BR,

Pedro

  • Hi,
    does your FPGA design an embedded processor (Nios or HPS)? If not, Avalon ST I2C master is most likely not the appropriate solution due the large amount of registers that must serviced by your FPGA code. I'd rather think about importing an open source I2C master design or possibly extracting the controller core from Avalon ST master IP.

    In terms of resource overhead, a SPI like interface (simple shift register) would be usually preferred.

5 Replies

  • FvM's avatar
    FvM
    Icon for Super Contributor rankSuper Contributor
    Hi,
    does your FPGA design an embedded processor (Nios or HPS)? If not, Avalon ST I2C master is most likely not the appropriate solution due the large amount of registers that must serviced by your FPGA code. I'd rather think about importing an open source I2C master design or possibly extracting the controller core from Avalon ST master IP.

    In terms of resource overhead, a SPI like interface (simple shift register) would be usually preferred.
    • PedroJServian's avatar
      PedroJServian
      Icon for New Contributor rankNew Contributor

      Yes, it seems not to be appropiate with a C28x microcontroller of Texas. Finally I'm going to use the SPI interface or if it gives me problems, the UART solution.

      Thank you!!

      Pedro

  • ShengN_altera's avatar
    ShengN_altera
    Icon for Super Contributor rankSuper Contributor

    Hi,


    You may use that and there's key to take note as mentioned.

    Or you may use uart (2 pins also) for that.


    Thanks,

    Regards,

    Sheng


    • PedroJServian's avatar
      PedroJServian
      Icon for New Contributor rankNew Contributor

      No!! Thank you.

      Im going to try the SPI solution to communicate with the C28x microcontroller and if it gives me problems, the UART solution you mentioned.

      Thank you very much Sheng!