06-17-2020 11:42 PM
Hello fellow programmers,
I'm testing a device that has an i2C bus with a master and 3 slave devices.
I've been exploring all example vi's I can find for my NI-4852 USB/i2C device, but all these examples either configure my device like a master or a slave. Neither of these options are good because I need to be in "invisible" mode only monitoring ALL communications that happen on the i2C bus. Here's a simplified example of what I would want a log to look like:
1. Master writes to device 0x19 {give me register 0x25}
2. Slave 0x19 answers with the value in register 0x25, and Master Reads it. (its a 0x00)
3. Master writes to device 0x5A {give me register 0x27}
4. Slave 0x5A answers with the value in register 0x27, and Master Reads it (its a 0x0B)
As you can see, I basically need to detect ANY communication happening in the bus, so I can't be a master or a slave in a fixed device address or register, I need to act more like a "sniffer". I'm already able to do this with a 3rd party device and it looks pretty simple (I attach a picture), I just need to do it inside labview so I use all this i2c activity to pass/fail the UUT.
I would appreciate any help or pointing in the right direction. Thanks!
06-17-2020 11:47 PM
I dont think the image attached on my initial post so here's what the log looks like in a Saleae Logic Analyzer
06-18-2020 09:37 AM - edited 06-18-2020 09:39 AM
I know you can do that with an Arduino.
But don't use LINX, use the native Arduino language and VISA to communicate with it just like any other device on a serial port.
06-18-2020 02:10 PM
Thanks for your input,
Would an Arduino UNO do it? do I need additional Hardware? I've researched some Arduino i2c modules but same as the NI 4852, they don't necessarily specify if they can be used in a "passive mode", the ones I've found have actual salve addresses so I imagine it would be the same case :S Any recommendations on specific Arduino Hardware?
Thanks a lot!
06-18-2020 04:20 PM - edited 06-18-2020 04:23 PM
As an alternative you can use the Saleae API
for your existing hardware to get the data into LabVIEW.
"Existing customers have also used the socket API with Python, Labview, C++, and other environments and programming languages" as stated on the web page. I haven't done this but it does look possible.