05-14-2007 03:01 PM
I need some help on USB-8451 SPI programming using LabVIEW. On the USB-8451 device, there are 8 physical chip select (CS) lines. I will need to program or use all of these CS lines to select one of the 13 SPI slave chips on the circuit board. I know I will have to use the SPI Configuration Property Node to program CS state. What value should I use to set the CS property if need the following CS line states to select one of our chips?
CS0 = 1; CS1 = 0; CS2 = 0; CS3 = 1; CS4 = 1; CS5 = 0; CS6 = 1; CS7 = 0
Thanks, Min.
05-15-2007 11:52 AM
Hi Min,
The SPI API only allows to set a specific CS line at a time. Each value of CS0, CS1, etc will have to be set individually. You can use the advanced API to set multiple lines or a better method would be to use the DIO lines to write a 8 bit pattern to correctly set the chip select lines.
I hope this helps you get started!
05-22-2007 02:51 PM
Hi Chris,
I tried your example of set each CS line individually via a script from the advance API. But after I ran the script, all the CS pins are in their tristates. I then read the function help for SPI Script Disable SPI.vi. This function call stristates all CS pins. Do I really need to call the "SPI Script Diable SPI.vi" before calling the "SPI Script Run Script.vi"?What can I do to make all CS pins to function like those DIO pins in the push-pull states.
Thanks,
Min.
05-23-2007 03:17 PM
05-31-2007 06:07 PM
06-01-2007 07:33 AM
Hi Chris,
I have got everything working on the device. Thanks for your help. To resolve the tristate issue, I simply remove the "SPI Script Diable SPI.vi" call and I run a script with the disable SPI call just before I exit the program.
Regards, Min.