I2C Master Slave problem

11 May 2011

Hi,

I am new with I2C and I need help. Using the provided libraries,i have not been able to get the I2C to work correclty. I use configuration as show on my pictures. When I want to send some data to slave some line can't be executed.

/media/uploads/elektronika1/i2c_configuration.png

/media/uploads/elektronika1/report.png

12 May 2011

Well, when I start my program, I watch SDA and SCL line on my scope and everything what is happening is that SDA and SCL line drop to logical 0 what is START condition for I2C, and after that there is no any changes in signal level (SDA and SCL line are flat).

Also I use terminal application for debugging my code, and I succeed to print out messages to PC (line 11 in my code, but not and line 19). That mean line 18 master.write(addr,master_data,3) can't be executed. Other word my program is stop in line 18 and he can't execute line below.

12 May 2011

If your diagram is correct, you have tx connected to tx and rx to rx rather than tx to rx.

12 May 2011

Oops, ignore that comment I should have looked at the I2C boxes not the serial.

17 May 2011

Hi, Clark.

I was offline for a while so I didn't see your reply.

You were right, if I do this on two separate processors there is no problem.

Thanks a lot. Branko