Electronics > Beginners

How to check I2C communication

(1/1)

Jane:
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?

sambonator:
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.

KL27x:
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.

rstofer:
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.

macboy:
"Bus Pirate" can snoop on an I2C bus, and I have used it for a similar purpose.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod