06-01-2022 04:31 AM
Hi ,
I am wondering if someone can suggest a method to monitor an I2C bus with Labview (just monitoring , don't want to be the master or the slave )
Basically i got a system with a master and few I2C temperature sensors and i would like to read the temperature for each sensor and display on a monitor
Hardware Available
NI 8452
cRio 9045
High speed DI cards
06-01-2022 11:26 AM
You basically need to sample the data and clock lines fast enough and then decode the protocol. I guess implementing this from scratch would be fun, but a cheap logic analyzer will get the task done out of the box. Maybe your oscilloscope (I guess you have one nearby) has a decoder built in?
06-01-2022 11:31 AM
If you're looking for an off the shelf oscilloscope based solution, please contact me through private message.
In general, as @LLindenbauer suggested, you have to sample the SDA and SCL lines fast enough and decode the edges & levels into protocol packets at the software layer.
06-01-2022 11:38 AM
Since you have an active i2c bus you really only need to sample the data line when clock goes high. If you know the clock frequency, trigger a two sample acquisition at 4x clock frequency and use the second reading to get the data value right between the clock rising and falling edges. If you don't know clock frequency, stick a scope on it and find out.