NI Home > Community > NI Discussion Forums

LabWindows/CVI

Showing results for 
Search instead for 
Do you mean 
Reply
Member
JHXU
Posts: 1
0 Kudos

How to increase the length of the clock signals on NI8451

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.

 

ni8451.jpg

Trusted Enthusiast
Wolfgang
Posts: 2,626
0 Kudos

Re: How to increase the length of the clock signals on NI8451

Hi,

 

I am not sure but I would expect better reponse if posted in the appropriate hardware forum...

Member
Julianne_K
Posts: 111
0 Kudos

Re: How to increase the length of the clock signals on NI8451

Hi JHXU, 

 

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. 

Julianne K
Systems Engineer, Embedded Systems
Certified LabVIEW Architect, Certified LabVIEW Embedded Systems Developer
National Instruments
Member
teop87
Posts: 5
0 Kudos

Re: How to increase the length of the clock signals on NI8451

Hi,

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,

 

Tiago Pereira.

Member
Julianne_K
Posts: 111
0 Kudos

Re: How to increase the length of the clock signals on NI8451

Hi Tiago, 

 

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, 

Julianne K
Systems Engineer, Embedded Systems
Certified LabVIEW Architect, Certified LabVIEW Embedded Systems Developer
National Instruments
Member
teop87
Posts: 5
0 Kudos

Re: How to increase the length of the clock signals on NI8451

Hi,

yes is the latter, 1.5ms delay for every iteraction.

 

a screenshot of my VI is in attachment.

 

Thanks, 

Tiago Pereira

Member
teop87
Posts: 5
0 Kudos

Re: How to increase the length of the clock signals on NI8451

Hi Julianne,

 

Any suggestions for my problem?

 

Thanks 

Tiago

Member
Julianne_K
Posts: 111
0 Kudos

Re: How to increase the length of the clock signals on NI8451

Hi Tiago, 

 

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, 

 

Julianne K
Applications Engineer
National Instruments

Julianne K
Systems Engineer, Embedded Systems
Certified LabVIEW Architect, Certified LabVIEW Embedded Systems Developer
National Instruments
Member
teop87
Posts: 5
0 Kudos

Re: How to increase the length of the clock signals on NI8451

Ok, 

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.

 

Anyway thanks,

 

Tiago Pereira

Member
Julianne_K
Posts: 111
0 Kudos

Re: How to increase the length of the clock signals on NI8451

Hi Tiago, 

 

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, 

Julianne K
Systems Engineer, Embedded Systems
Certified LabVIEW Architect, Certified LabVIEW Embedded Systems Developer
National Instruments