Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20746 Discussions

Access I2C Bus Internally and Externally on DE0-Nano

Altera_Forum
Honored Contributor II
1,625 Views

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?
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
584 Views

How about using a second I2C master instance?

0 Kudos
Altera_Forum
Honored Contributor II
584 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
584 Views

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.

0 Kudos
Altera_Forum
Honored Contributor II
584 Views

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
0 Kudos
Reply