01-12-2012 07:04 PM
I'm using NI8451 to read data from a linear technology ADC chip.
Using a scope, I found the clock signal only lasts for one byte (8-bit) during the read/write process,
ie. the clock signal is turned on for one byte period (8 clocks) and then is off for about 10-20us,
after that, the clock is on again for next byte.
Is there a way to change the length of the clock signal? In my case, I need about 96 clocks to flush out the ADC data.
But it looks like NI8451 only can generate 8 clocks one time.
Any suggestion will be appreciated.
01-13-2012 11:01 AM
Are you using SPI or I2C?
With SPI, essentially the clock stops toggling when there is no more data transmitted. You could try implementing a delay in your data transmission to ensure that the clock runs for time you require. However, to add a delay, you need to use the Advanced 845x SPI functions. In CVI, the command for adding a delay is
int32 ni845xSpiScriptDelay ( uInt32 ScriptHandle, uInt8 Delay );
More information on the SPI Advanced API can be found in the NI-845x Help or in this tutorial.
With I2C, I think you would just need to toggle the clock line (SCL) high. There is also a delay function in the Advanced I2C functions that may allow you to do this.
04-12-2012 10:01 PM
I'm working on SPI communication with NI8451 <--> ADS1198. I'm trying to increase the real data rate because there is a long delay (about 1.5ms) between each Run. Is this a hardware limitaion?
I've implemented a program in labview using SPI advanced API for NI8451. I have a main while loop just with SPI RUN script and SPI Extract script in there ( I settled SCLK = 4Mhz)
I know that NI8451 put a small delay (about 20us) every 8 SCLK's but 1.5ms delay between each iteration of while loop is too much.
How can i increase the real data rate?
Best regards from Portugal,
04-13-2012 03:16 PM
Can you clarify where you are experiencing the delay? Are you using a scope and seeing a 1.5ms delay between each byte of the clock signal, or are you experiencing a 1.5ms delay for every iteration of your while loop in your program? If it is the latter, please post your code or a screenshot of it. Thanks,
04-16-2012 10:07 AM
In your loop, you have array operations, arithmetic, and most importantly, you are writing to a graph indicator. These operations are likely adding to the loop time of your program. To resolve this, you could have an SPI loop and a processing loop, where you pass the data from the SPI loop to the processing loop using a producer-consumer architecture. For an template of a producer-consumer architecture, go to File -> New... In LabVIEW, then go to VI -> From Template -> Frameworks -> Design Patterns -> Producer/Consumer Design Pattern (Data). Using this program architecture may allow you to get a faster data acquisition rate. Hope this helps,
04-16-2012 10:16 AM
thanks for the help, i will try that. But running the program without array, arithmetic operations and writing to the graph indicator, the 1.5ms delay remains there.
04-16-2012 10:20 AM
You can also try running the shipping examples to see if you have an increase in performance. You can try the General SPI Read Script or General SPI Read (does not use scripting). Do either of these examples provide better performance? Sincerely,