01-24-2011 07:53 AM - edited 01-24-2011 07:54 AM
Hi,
I am quite new to Labview and been working on a testing platform using the 7813R as a 3*SPI driver.
Using the the example http://zone.ni.com/devzone/cda/tut/p/id/9117 I have made 3 SPI channels within the FPGA. However I have 2 main issues I need to figure out.
The example only allows diasy chain (Slave select) addressing of 8 slaves per Bus and I need 32. How can I expand this? Is it even possible seeing the fpga's I/0 is ony 8-bits.
The example also uses 1 port for the SPI full duplex signals and 1 port for the slave selects. When I try to combine these I get an error. I really need all the signals on the same port.
I really hope someone can help. Tried to contact NI directly and our company is an NI partner but had no help so far.
Thanks in advance for any assitance.
04-05-2011 02:17 AM
Hi Eletrostatic. Basically you have to make some changes to the VI to be able to adress 32 slaves instead of 8. There are 3 options changing the CS Global Variable to u32 instead of u8, or add 3 more u8 variables, or add a portselect variable.
The first is change regardless of the option is the cluster with the reference for the DIOs, basically add 3 more for the extra slaves that you need.
If you decided to add the 3 more U8 Variables. You will need to modify the following:
On the TOPFPGA VI Just modify de case:
On the SPI_SPIPORT.vi you will need:
Probably one of the easiest ones would be just add the variable to handle the CS variable. Add the extra ports to the IO reference cluster. And in the SetCS, And ResetCS add a case structure to just write to the port that was selected, with this you can handle the 32 slaves with the same Vi.
Best Regards