LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LIFA with multiple SPI devices(chip selects)

Hi

Im brand new to both Labview and Arduino, and I've been given the task to make the Arduino Uno communicate with 2-4 SPI devices. The SPI send/recieve.vi has a Chip Select DIO pin, but can I actually use this, when there is only one physical CS pin on the Arduino Uno?

Best regards

Jens

0 Kudos
Message 1 of 4
(5,356 Views)

If you are using multiple shields with a SPI device on each shield the solution is complicated.  See:

<http://www.circuitsathome.com/mcu/running-multiple-slave-devices-on-arduino-spi-bus>

If you are not using shields than you could use a 2 bit decoder to select one of four SPI devices. 

Both approaches listed above are not compatible with LIFA. 

hrh1818

0 Kudos
Message 2 of 4
(3,280 Views)

The way that I understand it is that you can use any pin for chip select (CS) when the Arduino is used as the master.  The hard coded pin to which you refer (denoted by 'SS' in the Arduino documentation) is specifically for the Arduino acting as a slave device to an external master SPI bus, afaik.

The article that hrh1818 linked to exists because multiple shield creators use the 'SS' pin as the CS for the slave device.  This causes issues when more than one shield is expecting to use that same pin as CS when they share the same SPI bus.

So, the moral of the story, to my knowledge, is that you can use as many SPI slave devices with the Arduino as long as you have a unique pin for each device's CS line and that you only activate one at a time.  This is why LIFA has the CS pin as an input to the SPI write/read VIs.

Message 3 of 4
(3,280 Views)

What Nathan said above is correct.  You should be able to use any DIO pin as CS when using LIFA.

-Sam K

LIFA Developer

0 Kudos
Message 4 of 4
(3,280 Views)