2014-04-03 09:15 AM
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 #discovery2014-04-03 09:29 AM
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.