Author Topic: How to check I2C communication  (Read 1381 times)

0 Members and 1 Guest are viewing this topic.

Offline JaneTopic starter

  • Frequent Contributor
  • **
  • Posts: 400
How to check I2C communication
« on: March 15, 2019, 08:46:32 pm »
There are three I2C devices in an equipment and I would like to check if they communicate properly with the main CPU. Does anyone have any idea how to test  the communication?
 

Offline sambonator

  • Regular Contributor
  • *
  • !
  • Posts: 69
  • Country: us
Re: How to check I2C communication
« Reply #1 on: March 15, 2019, 09:05:03 pm »
Not sure if anyone can answer that without knowing what test equipment you have, what CPU you're using... but usually there's a command you can issue to see if your CPU sees the device address on the I2C bus.
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4108
  • Country: us
Re: How to check I2C communication
« Reply #2 on: March 15, 2019, 09:22:37 pm »
You can find out if they are talking by troubleshooting. See if they are responding to each other. You have to figure out under what circumstances the devices should talk to each other to produce some response, then create that condition and look for the response. You may have to read some datasheets, if the result is not obvious or if you suspect some error.

Or you can use a logic analyzer with I2C protocol to monitor the bus and see what communication is occurring by individual address.

Depending how much "verification" you need, you can use any logic analyzer or a digital scope to verify that there is at least some communication. But you'll have to work out the addresses and instructions yourself.

You should probably have listed what is the problem or suspected problem. Or w/e is your goal.
« Last Edit: March 15, 2019, 09:29:06 pm by KL27x »
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9933
  • Country: us
Re: How to check I2C communication
« Reply #3 on: March 15, 2019, 09:25:03 pm »
Any logic analyzer will be able to analyze the bus.  You will be able to see start condition followed by the address byte/command followed by 1 or more bytes of data followed by the stop condition.  That's the easy part.

Understanding the data transfer and what it means to the parties will take a lot more time.

One thing you might see is a NAK condition where there should be an ACK condition.  This is a real clue that the slave device didn't understand or didn't acknowledge what the master device was saying.  Or the device being addressed isn't on the bus...

But it will take some kind of logic analyzer or a scope that includes decoding.

 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2287
  • Country: ca
Re: How to check I2C communication
« Reply #4 on: March 15, 2019, 09:46:00 pm »
"Bus Pirate" can snoop on an I2C bus, and I have used it for a similar purpose.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf