Page 1 of 1

Multiple devices on a single SPI bus

Posted: Thu Feb 27, 2014 9:17 pm
by part1zan_
What's the most common and convenient way of using two or more SPI devices on a single SPI bus? The point is that I can use the same MISO/MOSI/SCK pins, and the only thing that really differs is the CS (ChibSelect) pin.
I see only one: reconfigure SPI (spiStart) with the appropriate ChipSelect pin every time I use another device. That sounds kludgy, doesn't that? Are there other ways of doing that? Maybe, some statements in spiConfig?

Re: Multiple devices on a single SPI bus

Posted: Thu Feb 27, 2014 9:23 pm
by Giovanni
The mode is to do spiStart() each time you need to address a different device. The internal code path is quite simple.

If all devices have the same settings (CPOL, CPHA, speed etc) then you can simply use PAL functions to control CS lines without need to reconfigure.

Giovanni