From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB-8452 SPI Stream API

  I am using a CVI/LabWindows setup to access a DUT using a SPI serial interface.  I am using the NI USB-8452 controller to communicate over the serial interface.  Due to the inherent long delays between signal edges in the standard SPI communication, I have switched to SPI Stream API mode.  This has allowed me to configure the timing edges to desired values between the standard SPI I/O.  The 8452 is the master and is driving CS/SCLK/MOSI while getting MISO back from the DUT.

 

  I am using this mode successfully, but now I want to configure the data being sent to the slave in a particular manner, and I haven’t figured out a way to do this with the streaming commands available to me.  I have attached a timing diagram from the NI-845x Hardware and Software Manual, which shows the various signals and the timing parameters available.

 

I am trying to find a way to change the data that is contained in the first “nBits” packet to a different set of data for the second “nBits” packet.  I would like to alternate between the data sets, with just the definable T9 timing parameter (CS inactive) separating the packets.  If I drive these out as separate packets, I get a 3.5ms delay between packets, which is not allowing me to sample quickly enough.  I do, however, need an inactive CS between the alternating packets, so I can’t just lump them all into one “nBits” packet.

 

  I have set NumBits, NumSamples, and MosiData to values that I hoped would work.  I have tried different variations of them.  I can get the first 6 bytes of MosiData repeating over and over again, with an inactive CS between packets, but I can’t get the second set of 6 bytes to come out on alternating packets.  For this scenario, I set NumBits to 48 (8 bits * 6 bytes), NumSamples to 4 (just to see if the alternating pattern would repeat), and MosiData to a large array of data containing the same 12 bytes repeated multiple times.

 

  It seems I have to set up all parameters and then perform StreamStart, StreamRead, and StreamStop.  I haven’t been successful trying to change the parameters between StreamStart and SteamStop (e.g. doing a StreamRead, change parameters, then doing another StreamRead).

 

BTW, if there is another way to accomplish this, please let me know also.

 

Thanks!

0 Kudos
Message 1 of 3
(6,248 Views)

Hello JEatQualtre,

 

I have been searching a lot about something related to your specific case and haven't found much... however, I found this document below which I hope you can extract something useful from here:

 

"SPI Stream Configuration using the TI ADS833x Example"
http://www.ni.com/white-paper/14269/en/

 

Here are mentioned many important points about the timing and other parameters that hopefully you could approach.

 

 

 

Message 2 of 3
(6,099 Views)

Danubio,

   Thanks for the reply and the time spent searching for a solution.  Yes, that is a good paper and I came across that about a year ago when I first started using the NI 8452 streaming mode.  It was helpful at the time.  I think what I'm trying to do now is not supported by the existing parameters.  We have moved on to a different method to get our sampled data.

 

JE at Qualtre

0 Kudos
Message 3 of 3
(6,092 Views)