Forum Discussion

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

Access I2C Bus Internally and Externally on DE0-Nano

I just started playing with my DE0-Nano and have ran into an unexpected problem. I have a fair amount of experience with I2C and no experience at all with SPI so I was planning on accessing the Accelerometer using I2C. The problem I'm running into is that I also wanted to use sensors externally using I2C.

As far as I can tell in the assignment editor you can't assign two pins to be equal, and in VHDL you can't connect 3 sets of inout ports without a multiplexer so it appears to not be possible.

Am I overlooking something?

4 Replies

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

    That would definitely work, it just seems like a little bit of a waste to add in another core though.

    I also looked into the ADC on the board yesterday and realized it runs off SPI, which means I need a SPI module anyway. Since I already need the module I might as well connect it up to accelerometer too. However I have already run into a problem here as well. It appears that the accelerometer was only connected in 3-Wire SPI mode. The SPI core I plan on using doesn't support 3-Wire SPI and I can't modify the circuit to bridge the connections with a resistor, so it looks like SPI might be out of the question too.

    Any other suggestions? A second I2C core would work, but I'm mostly interested in if it's possible to connect two busses in general, either through HDL or through connecting pins using the pin planner.

    Thank you for your help,

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

    You can't connect two pairs of I2C bus pins bidrectionally, but you can of course connect a multiplexer at a point, where you have access to the (FPGA internal) undirectional I2C signals.

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

    Thank you for the help. Seeing as I'm not tight on space I will just use the second I2C core now. If I run out of room later I will look deeper into the issue to see how I would control the multiplexer.

    Thank you,

    Chris