Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Reduce USB-8452 SPI script frame delay

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.

spi--00000.png

Thanks

0 Kudos
Message 1 of 9
(1,348 Views)

Please share the code you used to get this scope capture.

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 2 of 9
(1,336 Views)

Sorry for the late response, NI mail went to spam.

Here is the USB-8452 part of a code

Main NI 8452.png

 

 

0 Kudos
Message 3 of 9
(1,311 Views)

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.

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 4 of 9
(1,306 Views)

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. 

Main NI 8452.png

0 Kudos
Message 5 of 9
(1,302 Views)

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?

santo_13_0-1644335701883.png

 

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 6 of 9
(1,299 Views)

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.

0 Kudos
Message 7 of 9
(1,295 Views)

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.

0 Kudos
Message 8 of 9
(1,292 Views)

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.

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 9 of 9
(1,282 Views)