Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem: the code generated by rocket-chip with i2c #154

Open
zhvn100 opened this issue Jul 9, 2020 · 3 comments
Open

problem: the code generated by rocket-chip with i2c #154

zhvn100 opened this issue Jul 9, 2020 · 3 comments

Comments

@zhvn100
Copy link

zhvn100 commented Jul 9, 2020

i use the latest rocket-chip and i2c in sifive-blocks to generate SOC,but i2c's output is directly deasserted in the verilog code generated by rocket-chip,as follows :
image
i can't use i2c driver program to output. so , i wonder whether i make some mistakes or i2c in sifive-blocks can't be used.

@mwachs5
Copy link
Collaborator

mwachs5 commented Jul 9, 2020

Which method are you using to instantiate the i2c?

@zhvn100
Copy link
Author

zhvn100 commented Jul 9, 2020

i add traits like this and add params as follows:
image
image
gpio、uart、spi can be used when i run program ,but i2c's output is deasserted in verilog

@tamood
Copy link

tamood commented Dec 10, 2020

Well, the implementation of I2C comes from opencores implementation of I2C, which is not the best but it works with proper electronics. The short answer is as follows.

  1. Plug I2C scl and sda ports into IOBUF, if implementing in Xilinx, followed by pulling up the pins with 1kohm resistances.
  2. If you are interfacing with a standard I2C bus like one in Arduino, an external pull-up is not required.

Hope it may help, for further reference, see the code at

https://github.com/tamood/freedom/tree/u1-tamood

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants