Can propeller pins be shared for multiple SPI devices?
twm47099
Posts: 867
Simple question - maybe?
If I am using a number of SPI devices that will be polled sequentially (for example 4 DS1600 digital thermometers) can the data and clock lines for each device be attached to the same prop pins with only the chip select (RESET in the case of the DS1600) being on separate prop pins?
I think that the data and clock signals would go out from the Prop to all the devices, but only the one whose chip select was active would be affected. Is that correct, or does each device require all three lines be connected to its own prop pins (3 pins per device vs 1 pin per device + 2 pins shared by all)?
Thanks
Tom
If I am using a number of SPI devices that will be polled sequentially (for example 4 DS1600 digital thermometers) can the data and clock lines for each device be attached to the same prop pins with only the chip select (RESET in the case of the DS1600) being on separate prop pins?
I think that the data and clock signals would go out from the Prop to all the devices, but only the one whose chip select was active would be affected. Is that correct, or does each device require all three lines be connected to its own prop pins (3 pins per device vs 1 pin per device + 2 pins shared by all)?
Thanks
Tom
Comments
You can take it one step further and use 3pins to select up to eight devices.
3-to-8 decoder IC 74(A)HC138
http://www.mouser.com/Search/Refine.aspx?N=1323043&Keyword=HC138&Ns=Pricing%7c0&FS=True
2 to 4
http://www.mouser.com/Search/Refine.aspx?N=1323043&Keyword=74LVC1G139&Ns=Pricing%7c0&FS=True
However this scheme would not work with using I2C as the chip selects, you need separate buses for that but you can just use I/O lines as chip selects or feed them into a demux for more chip selects. So if you use the I2C lines for SPI then you still need MISO and three other lines to a demux which means only 4 extra I/O on top of I2C to select 7 SPI devices (one for deselect) rather than the 4 I/O that would be wasted just on one SPI.
In general I use I2C for most expect high-speed or high capacity memory etc.
Tom