Debugging I2C...

Hello everybody, I'm trying to connect Arduino to a I2C MCP23016 wth no results(

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.


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:

And the zeroplus device:

And the PICKIT serial analyzer is a nice tool too... a little bit different from a LOGIC ANALYZER, but you can do some debugging.

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.