LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can the USB-8451 run both I2C & SPI Interfaces at the same time?

I have an 8451 on the way and initially will be developing a driver for our product using the SPI I/F.  I am also developing a test setup that will use the I2C I/F and need to know if 1 8451 will handle both at the same time or will I have to re-configure each I/F when I need to use it if I have only 1 8451 in the system? 

 

The SPI driver will communicate with our product & the I2C I/F will communicate with the test fixture...

 

Smiley Tongue

 

TIA

0 Kudos
Message 1 of 13
(3,065 Views)

I've used the 8451 with both SPI and I2C, but never at the same time.  I don't know.  Try it.  Just write a small program to write data.  Doesn't matter if there is a response or not.  The I2C will give an error about not receiving an ACK.  Just disregard it.  If it runs without other errors, I would say you are good to go.  If it could not do both at the same time, I would think you would get an error about resource not available or resource busy.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 13
(3,058 Views)

I will go ahead and give it a shot...  the 8451 doesnt ship til nex week  Smiley Mad  otherwise I'd do it now. 

 

 

0 Kudos
Message 3 of 13
(3,053 Views)

Hi - 

 

Unfortunately, the I2C and SPI interfaces cannot be used simultaneously. As tbob suspected, (and confirmed in this KnowledgeBase) you will get an error about the resource being reserved while the session is open, because you cannot have 2 sessions open to the same resource. You would need to close the session for one interface before attempting to open a session to the other.

 

John M

National Instruments
Applications Engineer
0 Kudos
Message 4 of 13
(3,025 Views)

Do you foresee a problem opening & closing the IF for each as needed?  Ultimately the plan will be to have 2 8451's, one for each IF...

0 Kudos
Message 5 of 13
(3,020 Views)

You can open and close as many times as you wish.  Of course it will result in slower code, having to initialize and close each time.  Your best bet is to use 2 8451s.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 13
(3,014 Views)

Well, you may be only able to open 1 VISA session to the 8451, but that doesn't mean you cant use both SPI and I2C at the same time.  I guess it depends on what your definition of "same time" is.

 

I have a project that uses 4 SPI channels and the I2C using a single OEM 8451 simultaneously without having to create a new session for each use.  Just create and store (I do it as class data) the visa session handle and create and store all your channel references.  Each channel you create does not need its own VISA session.   I access the 8451 from several different VIs asynchronously without any problem.  The VISA protocol will sort out coincident requests.

 

Buying a seperate 8451 should definitely not be required

 

Bill F

Message 7 of 13
(3,005 Views)

If you can run SPI and I2C at the same time (meaning on one VISA session), then the Knowledge Base article needs to be changed.

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 13
(2,991 Views)

I will look into this and let you all know what I find. If needed, we will definitely update the KnowledgeBase with new information.

 

John M

National Instruments
Applications Engineer
0 Kudos
Message 9 of 13
(2,930 Views)

To clarify this discussion, the difference in the KnowledgeBase and bfarley's suggestion is that the KnowledgeBase addresses whether or not it is possible to control both the SPI and I2C interfaces at exactly the same time. This is not possible, because this would require two sessions, but there can only be one session open to the device a time. However, as bfarley suggested, the same session could be used to control both interfaces at nearly the same time. In either case, both interfaces cannot be written to or read from at exactly the same time.

 

John M

National Instruments
Applications Engineer
0 Kudos
Message 10 of 13
(2,882 Views)