Altera_Forum
Honored Contributor
21 years agoIntegrate the Opencores's I2C ip into SOPC
Hello:
I gathered 2 messages about how to integrate Opencores's I2C IP into SOPC. And I just have got it work by following these instructions below. But one note is that you can not just include the header file "oc_i2c_master.h" directly. Please refer to Altera's application note "AN333" to wirte your own header file. ================================================= you can easily connect the I2C Wishbone core to the NIOS processor 1. Within SOPC builder, generate interface to user logic. 2. Select bus interface type: avalon register slave. 3. Add "i2c_master_top.v" design file. 4. Read port list from file. 5. Connect the signals as follow: wb_adr_i <=> address wb_dat_i <=> writedata wb_dat_o <=> readdata wb_we_i <=> write wb_stb_i <=> chipselect wb_cyc_i <=> chipselect wb_inta_o <=> irq wb_clk_i <=> clk wb_ack_o <=> waitrequest_n wb_rst_i <=> always0 arst_i <=> reset_n scl_pad_i <=> export scl_pad_o <=> export scl_padoen_o <=> export sda_pad_i <=> export sda_pad_o <=> export sda_padoen_o <=> export 6. Under timing tab, leave the setup, wait and hold settings at 0 cycles. You can now access the I2C core via included "oc_i2c_master.h". ======================================================== Original message is written by "Guido Kuhlmann" from the Opencores forum. reference from: (http://www.opencores.org/forums.cgi/cores/2004/04/000609) ======================================================== If you have integrated the I2C IP from Opencores into your system correctly there are only some more steps to bring it to work. 1. Insert -> Symbol ... 2. 2x primitives -> buffer -> tri 3. 2x primitives -> logic -> not 4. 2x primitives -> pin -> bidir 5. connect "scl_padoen_o" and "sda_padoen_o" to the input of the "not"-logics 6. connect "scl_pad_o" and "sda_pad_o" to the input of the "tri"-buffers 7. connect the output of the "not"-logics to the corresponding output-enables of the "tri"-buffers 8. name the output of the "tri"-buffers "i2c_scl" and "i2c_sda" 9. connect "i2c_scl" and "i2c_sda" to the corresponding inputs of the I2C IP 10. connect "i2c_scl" and "i2c_sda" to "bidir"-pins That's it! ======================================================== Original message is written by "niosIIuser" from the Nios forum. reference from : (here (http://www.niosforum.com/forum/index.php?act=st&f=2&t=590&hl=opencore)) ========================================================