I am using an NI USB-8452 controller in SPI mode, controlled by a C program compiled in LabWindows/CVI 2013. In order to talk to the chip we've designed, I need to control the delay between the final deassertion of SPC and the deassertion of CS (timing parameter T11) to keep it very small. Therefore, I'm using streaming mode.
I've read the NI-845x Hardware and Software Manual and looked at the two projects that use SPI streaming mode in the NI-845x examples dir. The examples are both using SPI to talk to A/D converters. In other words, the time-varying data is coming from the SPI slave (ADC) to the SPI master (NI 8452 controller) via the SPI_MISO line.
Is it possible to use the USB-8452 to generate time-varying data that goes the other direction, from the SPI master to the SPI slave via the SPI_MOSI line? Can I do a burst write of arbitrary length using streaming mode?
For example, let's say I have 8 bytes of data to transmit:
WriteData[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
If I try to send this as 4 16-bit samples:
ni845xSpiStreamConfigurationSetNumBits(StreamHandle, 16); ni845xSpiStreamConfigurationSetNumSamples(StreamHandle, 4); ni845xSpiStreamConfigurationWave1SetMosiData(StreamHandle, WriteData, 8); ni845xSpiStreamStart(DeviceHandle, StreamHandle);
I would expect to see transmitted:
0x0102 0x0304 0x0506 0x0708
Instead, what I actually see is the first word repeated NumSamples times:
0x0102 0x0102 0x0102 0x0102
Is there any way to generate the first (non-repeating) pattern? Or is streaming mode really only capable of capturing input data?
I thank you for any help you can provide.
-jskroch