LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Multiple USB-8452 as I2C Slaves at the same time

Solved!
Go to solution

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.

0 Kudos
Message 1 of 6
(1,923 Views)

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

0 Kudos
Message 2 of 6
(1,882 Views)

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.

 

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 3 of 6
(1,871 Views)

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.

0 Kudos
Message 4 of 6
(1,856 Views)
Solution
Accepted by topic author jaredgold527

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.

0 Kudos
Message 5 of 6
(1,855 Views)

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

0 Kudos
Message 6 of 6
(1,670 Views)