Debugging I2C...

Hello everybody, I'm trying to connect Arduino to a I2C MCP23016 wth no results(http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1237731741/0).

Can any body give some tips to debug the connection and find the problem?

The electrical connection appears working, I have HIGH in SDA an SCL without Arduino and a pulse in both with Arduino connected.

Thanks.

Unfortunately it is very hard to debug i2c without a logic analyzer. You could do some diagnosis with an oscilloscope, but it is not easy.

Here is the information about the saleae device: http://www.nkcelectronics.com/usb-logic-analyzer.html

And the zeroplus device: http://www.nkcelectronics.com/zeroplus-lap16032u-logic-ana16032.html

And the PICKIT serial analyzer is a nice tool too... a little bit different from a LOGIC ANALYZER, but you can do some debugging. http://www.mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMsjLMBIknjmklLpezTf%252bS6lya9jZs%2f4WoA%3d

Just pointing you to some logic analyzers, so you can have more information.

If you are getting signals on the A4 & A5 lines then it must be your device address or the hardware not wired up correctly.

With all address lines connected to ground the address is 0x20. Make sure the RC oscillator is wired up and you have 4K7 pull ups on the I2C lines (it will work without this but the signals look awful)

Use the examples found in the Wire library, they treat it as a 16 bit register.