Altera_Forum
Honored Contributor
9 years agoopencores i2c master generates no output
Hi,
I'm new to FPGA's. I had used the altera IP's and evrything went well until I tried to use the opencores I2C master. With the DE0-nano board I want commucate via the GPIO_06 and GPIO_05 on an seperate board. But in every communication attempt the SCL and the SDA stay high. The problem is maybe the result of an incorrect implentation of the IP. When I look at system.h file there only these few lines in i2c_opencores configuration: /* * i2c_opencores_0 configuration * */ # define ALT_MODULE_CLASS_i2c_opencores_0 i2c_opencores# define I2C_OPENCORES_0_BASE 0x4001800# define I2C_OPENCORES_0_IRQ 5# define I2C_OPENCORES_0_IRQ_INTERRUPT_CONTROLLER_ID 0# define I2C_OPENCORES_0_NAME "/dev/i2c_opencores_0"# define I2C_OPENCORES_0_SPAN 32# define I2C_OPENCORES_0_TYPE "i2c_opencores" Are there missing some lines? I also had already checked if there is a driver for the i2c_bus. And there is a driver and it is enabled. When I debug my code on the Nios II the core get stuck in the following line of the i2c_start function: /* wait for the trnasaction to be over.*/ while( IORD_I2C_OPENCORES_SR(base) & I2C_OPENCORES_SR_TIP_MSK); The return of the function IORD_I2C_OPENCORES_SR(base) is always 0x02. Has anybody an idea what the problem might be? Excuse my english, I'm no native speeker.