cancel
Showing results for 
Search instead for 
Did you mean: 

Devices on SPI bus

artemis1992
Associate II
Posted on April 03, 2014 at 18:15

Hello guys, I have a problem! I need to connect 4 devices on the discovery STM32VLDISCOVERY using SPI BUS. The problem is the following: the discovery has got 2 SPI interface: for SPI1, CS is PA4 (SPI1_NSS), for SPI2, CS is PB12 (SPI2_NSS).

So am I allowed to connect only 2 devices on my board?

Is exsist a mode that allow me to connect 4 devices on the same SPI interface, ex. SPI1? Thank you very much,

Matteo

#spi #device #stm32f4 #discovery
1 REPLY 1
Posted on April 03, 2014 at 18:29

You'd need to determine if the devices can function co-cooperatively (ie Hi-Z their output when CS is high), or not

You'd then be able to use ONE SPI bus, and have individual GPIO CS to each, your code would them need to arbitrate access between them.

For example I could readily connect 3 SPI Serial Flash devices (

http://www.macronix.com/en-us/Product/Pages/ProductDetail.aspx?PartNo=MX25L12835F

16MB) to ONE SPI bus on an STM32. All the SCLK, MISO, MOSI would be common, and the 3 CS would connect to a unique GPIO, and you'd manage that GPIO in software.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..