Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
2,085 Views

I2C interafce on DE1 board

Hi, 

I'm trying to use the I2C opencore provided by the alterawiki with an Altera DE1 board. 

 

I am using Quartus 11 and SOPC builder and I am able to create a SOC system with a NIOS II processor and an I2C module. But I have a big problem: after that I assigned the SCKL and SDA signals of the I2C Core to two pins of the expansion header of the DE1 Board, I am not able to see data or clock on these pins with a Logic Analyzer. I tried to assign the SCKL and SDA signal both to GPIO_0 and GPIO_1 pins, but the problem remains. 

 

In the image, the created system are reported. 

 

https://www.alteraforum.com/forum/attachment.php?attachmentid=6824  

 

What can I do? 

Thanks in advance.
0 Kudos
7 Replies
Altera_Forum
Honored Contributor I
70 Views

After some testing I noticed that the I2C core works well only if I assign, in quartus, the pins of I2C clock and data on PINA3 and PINB3 that are connected on the audio codec device installed on the DE1 board. Is there a way to redirect the signals on two pins of the board expansion header? If in quartus I put them on GPIO pin the result don't change.

Altera_Forum
Honored Contributor I
70 Views

An I2C controller only ever drives low. The I/O pins require pull-ups. In your case, just enable the weak pull-ups on the GPIO pins you assigned the I2C signals to, and you should be able to see the signals driven low by the controller, and then slowly go back to being high when the controller tri-states them. Depending on your application, you will probably require stronger pull-ups, eg., 4k7 resistors. However, using the weak pull-ups will at least help you realize it is working. 

 

Cheers, 

Dave
Altera_Forum
Honored Contributor I
70 Views

I will try with a pull-up resistors. But I have a question: why Quartus doesn't redirect the signals on the new pins that I select? The clock is always generated on the pin of audio codec of the board also if I select a pin of the board expansion header.

Altera_Forum
Honored Contributor I
70 Views

 

--- Quote Start ---  

But I have a question: why Quartus doesn't redirect the signals on the new pins that I select? The clock is always generated on the pin of audio codec of the board also if I select a pin of the board expansion header. 

--- Quote End ---  

 

 

That must be your error. Check the .pin file and see if Quartus P&R used the pins you thought it should. 

 

Cheers, 

Dave
Altera_Forum
Honored Contributor I
70 Views

Thanks to both of you! I have been looking for a way to use I2C on both my DE0-NANO and my DE2-70 boards. Your comments have been very helpful in getting me going on that project once again. 

Regards, 

Geof
Altera_Forum
Honored Contributor I
70 Views

Thanks. I redirected the I2C_SCLK and I2C_SDAT signals on two GPIO pins and with two external pullup resistors, now, it works fine.

Altera_Forum
Honored Contributor I
70 Views

 

--- Quote Start ---  

Thanks. I redirected the I2C_SCLK and I2C_SDAT signals on two GPIO pins and with two external pullup resistors, now, it works fine. 

--- Quote End ---  

 

 

Great! Thanks for letting us know you got it working :) 

 

Cheers, 

Dave
Reply