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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI script

Hi All
I am using NI 8451 SPI card.
I have some question regarding SPI script enable spi.vi Help for this vi states that - This command switches the pins on the SPI port specified using NI 8451 SPI run script.vi
to master mode function.
All the chip select pins are switched from tristate to push pull output driven high.
 
Question1 - Since 8451 is having 8 chip select , so is this function makes all the Chip Select high simultaneously or not ??
 
Question 2 - In this function What is the meaning of Script.Why this word is used.
 
Question3 - In 8451 , there are one MISO pin & one MOSI pin. When we are writing (MOSI) some value to the SPI device then at that particular time MISO will be in which state .
                    (i think it will be in high impedence state , but i am not sure) Plz tell this also.
Question4- If we r reading one internal register of the SPI device then after how much time we can again access it ??
 
 
Please reply as soon as possible.
It is very important
 
Thanks  & Regards
J R
0 Kudos
Message 1 of 5
(4,439 Views)
Hi JR,

1) If the script is disabled, all chip select (CS) lines are in input mode floating. If the enable command is executed, all CS lines will be set to 3.3 volt high. This should be fine for connected devices, but you can set each device back to low with the NI-845x SPI Script CS Low.vi.
 
2) The term "script" corresponds to a set of repeatable commands. You would configure the script beforehand and run it when needed.
 
3) When the clock pulse occurs, you are both sampling on the MISO line and writing on the MOSI line. Because the MISO line is in input mode floating, it depends on what the connected device is sending. The 8451 is not driving this line, so whatever state the connected line is in is the state of the MISO pin.
 
4) This will be software-timed. You could expect approximately 2 to 3 milliseconds.
 
I hope this answered your questions!
 
Regards,
Missy S.
Project Engineer
RoviSys
Message 2 of 5
(4,396 Views)

Hi Missy D

Thanks for the reply.

1) What is the meaning of input mode floating ? What is the default value of CS in 8451 ( low or high ). When script is enabled it makes all the CS lines high simultaneously.Can we control all the chip select separetly not simultaneously.

2)

3) Please elaborate  this question again . If possible send any link regarding MISO & MOSI,  regarding When we are writing (MOSI) some value to the SPI device then at that particular time MISO will be in which state.

 In SPI , communication is always initiated by Master (here 8451 is master) So untill the master send an address & raw data the Slave device shall not send any output data.(Since SPI uses the shift regsister logic it means if you wants to read 8 bit data from a regsister then you have to write an 8 bit raw data on that particular register.)

In the answer you mentioned the status of MISO line depends on what the connected device is sending but actually it will not send any data untill & unless you write any raw data on the same register.

Please expalin this again.

4) can we achieve the repeateability i.e after every 2 or 3 ms we will acquire the data. ??

Regards

JR

0 Kudos
Message 3 of 5
(4,390 Views)

Hi:

I am trying to use SPI with 8451. could I use 3-wire SPI also with 8451?

 

 

 

0 Kudos
Message 4 of 5
(4,120 Views)

Divya S.

Based upon the user manual, the 4 wire setup is required.  Listed below is the user manual for the 845x, located on page 1-6 is the description of the 4 wire connection.  I have also included a Developer Zone Tutorial for the USB-8451.

845x User Manual
Using the National Instruments USB-8451 I2C and SPI Interface to Evaluate a Texas Instruments Analog

A_Ryan
AES
National Instruments
Message 5 of 5
(4,094 Views)