I have a USB-8452 with the latest software (2.1.2) installed. The host computer is a Core i7. I am trying to achieve the maximum SPI write speed possible with the device. I have tried the SPI Basic Read/Write block, SPI Scripting blocks, and SPI Streaming, but the first two have large delays between CS falling and data being written (along with while loop delays), and the last appears to be useful exclusively for read operations.
Can anyone tell me if there is either a way to a) reduce the setup times for SPI Basic / SPI Scripting or b) write different values within a single SPI Stream? Thanks in advance for any help on this issue, even if it's just confirmation that yes these are hard limitations that can't be overcome with the LabVIEW 8452 interface at this time.
Here is the best I'm able to currently do, as shown on my logic analyzer. Changing the SPI clock speed doesn't affect the setup and delay times that are the primary and secondary bottlenecks:
SPI Basic Read/Write -
Program: Basic setup followed by SPI Write/Read block by itself in a while loop
Primary bottleneck: ~450 us delay between while loop iterations (see capture 2)
Secondary bottleneck: ~6 us delay between falling edge of CS and first clock pulse (see capture 1)
Capture 1 - Highlighting delay between CS falling and first SCLK pulse
Capture 2 - Highlighting delay between while loop iterations
SPI Scripting -
Program: Basic setup followed by two Run Script blocks in a while loop (to check both block to block and loop iteration delays)
Primary bottleneck: ~450 us delay between while loop iterations (see capture 3, space between second and third captured frames)
Secondary bottleneck: ~250 us delay between consecutive Run Script blocks (see capture 3, space between first and second captured frames)
Capture 3 - Highlighting consecutive Run Script delays and delays between while loop iteration
SPI Streaming - This is the closest to achieving a reasonably fast write speed, but unfotunately it seems to be exclusively useful for read (e.g. ADC) operations, not write.
Program: Basic stream setup followed by Stream Start block
Primary bottleneck: Can't write anything other than single data value to 'Waveform 1 -> MOSI Data' property. I can write an array of bytes to this property, but it will simply put all of those bytes in one frame and repeat this frame (see capture 4) rather than cycling through each value.
Capture 4 - Two bytes sent repeatedly using SPI Stream. CS delay is finally good, but no ability to change MOSI data frame to frame.
Solved! Go to Solution.
This performance sounds like what we would expect for an 8452.
If you need higher performance, I would encourage you to look into using an R Series or FlexRIO FPGA card for your implementation.
We have some examples available if you download USB-8452 drivers. I haven't been able to find the exact example pictured though. You can find examples in the example finder, which you can access via "Help>>Example Finder". You can find SPI examples under "Hardware Input and Output>>I2C and SPI"
Drivers for USB 845x
I know that isn't exactly what you need, but let me know if that helps. It will at least get you started and get you the API for the USB-8452.
I'm using LabView 2017 and a NI USB-8452 and would also like to send SPI data via the 8452 as fast as possible to a SPI device.
Are the limitations discussed in this thread strictly for the USB-8452 hardware or could I expect any improvements with a newer version of LabView but still using the USB-8452?
Also, in LabView 2015 (and maybe prior versions) there were LV blocks under Instrument IO/NI-845x (also shown in the original post of this thread in SPI Scripting) but I can not find where these are or how to add these to LabView 2017.
Has this been replaced with the SPI Digital Waveform palette?
Will the SPI Digital Waveform blocks work with the USB-8452? If not, what LV blocks (functions/vi) can I use in LabView 2017 to work with my USB-8452?
I appreciate any help.
The NI-845x 17.0 driver should install functions in Instrument I/O >> NI-854x
Please try reinstalling the NI-845x 17.0 driver and restart your computer and look for these functions.