Altera_Forum
Honored Contributor
16 years agoI2C Master + BOA webserver (µClinux)
Hi guys,
After the successful implementation a Boa embedded webserver using µClinux on the baseboard DBM_3C40, my idea is to use an I2C bus (interfaced through CGI/HTML page on the BOA server) in order to control/observe registers of some external peripherals. So I decided to choose the "OpenCores I2C (Longshot)" in my design. I have some questions concerning this module : 1) In SOPCBuilder and Quartus, I simply connect the OpenCores I2C as following : http://img34.imageshack.us/img34/5669/sopci2c.jpg (http://img34.imageshack.us/img34/5669/sopci2c.jpg) http://img5.imageshack.us/img5/8771/quartusi2c.jpg (http://img5.imageshack.us/img5/8771/quartusi2c.jpg) + Do I must connect the I2C component to a tristate-bridge or can I simply connect it to the "instruction_master" and "data_master" of the cpu (like the first screenshot) ?? + There are warnings in SOPC console : "Signal chipselect appears 2 times (once only is allowed)" but I can't configure the I2C component...are they important warnings ?? 2) To send some commands to the I2C peripherals through a CGI script (linked to a HTML page), I think about using the following C functions included in the file "opencores_i2c.h" : //int I2C_init(alt_u32 base,alt_u32 clk, alt_u32 speed) //int I2C_start(alt_u32 base, alt_u32 add, alt_u32 write); //alt_u32 I2C_read(alt_u32 base); //int I2C_write(alt_u32 base, alt_u8 data); But in the source code "opencores_i2c.c" , I found Altera functions like "IOWR_OPENCORES_I2C_CTR(...)", which are not included with the µClinux system... are there any equivalents of iowr(..) and iord(..) in the uclinux environment?Thanks for your help. Regards, Papy