I get the adafruit max31855 working, next I have about 3 other SPI sensors I want to read from, and finally I want to use an lcd to display some of this information. I am out of pins. can anyone point me in the direction of a device or sample for handling a larger number of spi devices at once?
#1
Posted 30 August 2013 - 04:58 AM
#2
Posted 30 August 2013 - 05:45 AM
A single master SPI (e.g. Netduino) can be wired to several slave-SPI devices, in general. However, the actual feasibility is sensible to every device's features.
Let's say you can share (i.e. wire together) the SCK and the MOSI lines. Also you'd need a SS signal for every single slave device, in order to select only one at once.
The troubles could arise if you need to read data (by MISO pin) from more than a single device. Unless any of the involved devices has a kind of "output enable", or is a real pain. The "output enable", as the name suggests, is an input for the device, which activates its serial data output (going to the MISO). Without activation, the serial data out is in "high-Z" state, which is as it is left open.
A general approach for solving *any* kind of device SPI management, is by using a bidirectional multiplexer, such the 74HC4052.
Such a chip embeds a couple of 4-to-1 selectors, that simply act as a "short" from a pin and another one. The selection is made by a pair of inputs which map a binary position.
Let's say that using a 74HC4052, you may manage up to 4 SPI slave devices as follows:
- share the SCK and the MOSI between master and slaves altogether;
- use one selector for the MISO;
- use the other selector for the SS;
- use two more Netduino outputs for the selectors mapping.
I think that's the optimal way to manage such a context, that is just two pins more than a standard single-slave SPI.
Of course, you may use more 74HC4052's or even choose a different chip, but the mentioned chip looks as the best compromise for this kind of applications.
Finally, here is a concrete realization of a multiplexed slave devices management, with the only difference that the bus is I2C instead of SPI, but the sense is perfectly equivalent.
http://blogs.msdn.co...ing-better.aspx
Cheers
#3
Posted 30 August 2013 - 04:10 PM
Looks like this might work for me thanks. I think I may even to be able to use multiple to get more than 4 devices off of 3 pins, instead I can get use 4 pins and control a few more devices. by adding more of these 74HC4052's together.
Also tagged with one or more of these keywords: spi, serial
General →
Project Showcase →
Gameduino 2 For NetduinoStarted by giawa , 24 Jul 2015 gameduino, netduino, spi |
|
|
||
Hardware →
Netduino Plus 2 (and Netduino Plus 1) →
Issues with Serial CommunicationStarted by Cyclone_ZA , 22 Jul 2015 Serial |
|
|
||
General →
General Discussion →
UART ModulesStarted by tridy , 03 Jun 2015 UART, Module, RF, Serial, RX, TX |
|
|
||
Answered
Hardware →
Netduino Go →
Shield Base or Netduino 3Started by TechyStoo , 03 Jun 2015 shieldbase, serial, firmware |
|
|
||
Hardware →
Netduino 3 →
USB-Serial ModuleStarted by KenTi , 29 May 2015 GHI, Serial, USB |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users