[sdiy] Multiple SPI devices on the same bus.
Brian Willoughby
brianw at audiobanshee.com
Wed Mar 24 20:10:08 CET 2021
An "almost" option is the TCA9548A from Texas Instruments. But now I realize I was thinking I2C switching, probably because of the pull-ups, not SPI.
Brian
On Mar 24, 2021, at 10:06, Brian Willoughby wrote:
> On Mar 24, 2021, at 07:43, Jean-Pierre Desrochers wrote:
>> In my quest for cheap SPI pressure sensors I found this tiny thing
>> based on Bosch BMP280 I2C/SPI sensor which is now obsolete but still available
>> (over 10,000 available) at aliexpress for $0.45CAD each !
>>
>> My question to the DIY forum is:
>> Since there will be around 90 of these boards used in my project
>> read by the same PIC micro there will be a need for buffering
>> on each MOSI (SDI) & SCK lines. That’s ok. CS lines will be managed by 8 multiplexers (74HC154).
>> That’s ok too.
>> The above schematic shows the board parts.
>> R1,2,3,4 will be removed on each board to avoid heavy loading using 90 devices
>> (down to 97 ohms if each internal 70k pull-up resistors are calculated).
>> Only one of the 90 PCB will keep these resistors (the last one of the row).
>> My concern is about the MISO (SDO) line.
>> Even tristated each BMP280 will show some kind of capacitance on the MISO bus
>> that will be multiplied by 90 in my case.
>> Should this be taken in account ?
>> The SPI clock will be around 1Mhz.
>> No other types of SPI devices will be used here.
>
> I have only designed systems with a few SPI devices on each bus, but I have thought about the challenge that you face, many times.
>
> Since you already have (six?) multiplexers which each have individual enables, perhaps you could use tri-state (octal?) bus drivers to isolate the 90 MISO lines so they're not always connected together. Even with the lowest part-count solution, there would only be 16 MISO lines feeding their own tri-state bus driver input, and then the outputs of the (twelve?) tri-state bus drivers would connect to the PIC. 12 is less than 90 !
>
> You might have to do some math to determine the best combination, or build some test circuits. With some extra circuitry, you could fine-tune the tri-state buffering so that fewer than 16 MISO lines are combined at a time.
>
> Technically, you should find an Open Collector or Open Drain bus driver, so long as it can be disabled, to mimic the pull-up design of the MISO data line.
>
> The nice thing about this is that you don't have to do anything extra to control the bus drivers. The same enables that control the multiplexers for CS will also control the drivers. It's fast, and it keeps the firmware simple.
>
> Brian Willoughby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20210324/fbb9f1e7/attachment.htm>
More information about the Synth-diy
mailing list