07-09-2010 10:45 AM
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...
TIA
07-09-2010 11:00 AM
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.
07-09-2010 11:11 AM
I will go ahead and give it a shot... the 8451 doesnt ship til nex week otherwise I'd do it now.
07-12-2010 12:45 PM
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
07-12-2010 12:57 PM
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...
07-12-2010 01:00 PM
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.
07-12-2010 02:16 PM
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
07-12-2010 02:42 PM
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.
07-14-2010 04:31 PM
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
07-21-2010 02:21 PM
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