01-24-2022 08:17 AM
Hi,
When creating SPI script I observe ~16us delay between frames, independent from set communication frequency. Is there a way to reduce or negate this delay? I use 20.0.0 driver.
Thanks
01-24-2022 10:15 AM
Please share the code you used to get this scope capture.
02-08-2022 02:35 AM
Sorry for the late response, NI mail went to spam.
Here is the USB-8452 part of a code
02-08-2022 09:05 AM
That 16us delay is due to the software execution time required to move from one iteration to the next along with any driver overhead.
If you would like to eliminate that 16us, you would have to make all the data transactions in a single run.
02-08-2022 09:43 AM
In this case, only data are loaded in for loop, generation starts after NI-845x SPI Run Script.vi begin.
At first, I also started with general read/write (not scripting) and saw 300-600us delays, depending on how busy my pc was.
02-08-2022 09:55 AM
I will take that back, I did not realize you used scripting.
Now, why would you need to have a 2D array and not a single 1D array?
02-08-2022 10:10 AM - edited 02-08-2022 10:12 AM
For me It doesn't matter, I just removed a few internal VIs that were actually preparing data, going from "read address x3C" to real bit data with keys, crc, etc. Here it's just a constant to simplify the question.
I tested with a 1D array and got the same results, NI-845x SPI Script Write Read.vi takes U8 bytes and concatenates it to "num bits per sample" length frames (in my case 64), and between these frames, I see a delay. Delay is quite consistent.
02-08-2022 10:18 AM
I suppose this can be a hardware limitation, if the device could output to 64bits frames together without delay, then it would basically be one 128bit frame, and in specification max bits per sample is 64. But I wanted to be sure.
02-08-2022 11:09 AM
I don't have USB-8452 to try out, but my interpretation of the 64-bit frame length aligns with yours.
It could be the case that you cannot put more than 64-bits in a single stretch.