10-26-2022 12:24 PM
Hello,
I am trying to use LabVIEW to simulate 2 different SMBus slave devices simultaneously, but I am running into an issue.
I have 2 different NI USB-8452, one for each slave.
I set them up and configure each to a different address, and everything appears to be working at first, but I run into a strange issue
If I send a write messages work fine, but if I send a read message both devices stop working. Things also work normally if I don't attempt to have each device do a wait for message simultaneously.
I attached a paired down version of the VI, that still shows the issue.
Solved! Go to Solution.
10-27-2022 08:02 AM
What happens if you hook things up the same way, but run a slightly different program that writes and reads with only one 8452 connected to only one "servant"? (I learned this "gentler" terminology while learning about SPI from a U-Tube video.) Can you get two-way communication? Don't I recall that the Protocol was supposed to allow you to select the remote chip for two-way communication? Can't you use a single 8452 to talk to two remote SPI chips (sequentially, of course)?
Bob Schor
10-27-2022 11:54 AM
Please share the connection diagram and why are both slaves put together in the same loop, aren't both supposed to be asynchronous? who is the master?
From your description, the root cause could be that you tied both the loops into a single loop, now both must receive an event in order to iterate to the next loop and gives you a false impression of only one working.
Split these into two loops (one per device), things should work as expected.
10-27-2022 02:38 PM
This is an I2C application, which means no Chip Select.
But to answer the other question, the VI I shared has a disable for each device so that they can be tested individually, if only one device is enabled I can have 2 way communication.
10-27-2022 02:45 PM
The Master is a separate device that is not controlled by labVIEW. That is the device that provides the synchronous clock. Since that device can talk to either of the 2 servants at any time I wanted them to be in the same loop orginially so that no messages were missed.
The way that the 8452 interface is written is that you are supposed to check it, and if there is no message for their address then it will receive a NoEvent. I originally figured that if you did that then they are both recieving a valid event, and it does work when the master sends a write message, indicating that waiting on events is not the issue.
That said I will try it again with each device in its own loop to see if that solves it.
11-07-2022 02:14 PM - edited 11-07-2022 02:15 PM
So I did get it working, and this did help but was only half the solution. The other part of the solution was adding while loops to the data available and cmd events for the the communications. With both of these combined it started functioning correctly.
Ill attach the final version of the VI that works