SPI communication bus

Hi,

I would like to know how many slaves (max) can I connect to SPI bus?

How far can I connect between master and slave for SPI bus?

Thanks.

I would like to know how many slaves (max) can I connect to SPI bus?

Theoretically as many as you have free pins for the CS signal. But in reality you get to long cabling with more than about half a dozen devices.

How far can I connect between master and slave for SPI bus?

That depends on the speed you drive the SPI bus with. For low speeds (< 1MHz) half a meter should work well if there is not to much electrical noise in the environment. The higher the clock frequency the shorter the bus length should be.

Thanks