cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411CE Multiple SPI slaves, which CSs?

marcogaudina9
Associate II
Posted on October 01, 2015 at 10:58

Dear all,

I have the following situation:

STM32F411CE with  PB12,PB13,PB14 and PB15 configured as SPI2 to interface with an external slave sensor.

SPI1 (PA4,PA5,PA6,PA7) is used for an external IMU communicating in SPI.

Now the problem is that I need to connect another device in SPI mode.

I was thinking to connect to the same SPI2 bus,

I canot use the other SPI busses.

So (the real question...) which pin can I use as CS for the external new device?

Can I use a normal GPIO?

Thanks.

#stm32f4 #stm32f4 #spi #spi
4 REPLIES 4
Posted on October 01, 2015 at 11:09

Yes. You are already using the NSS pin as GPIO output anyway, don't you.

JW

marcogaudina9
Associate II
Posted on October 01, 2015 at 11:42

Thank you waclawek.jan,

now i'm using PA4/SPI1_SS as CS for SPI1 and PB12/SPI2_SS,

so i can connect more slaves let's say on SPI1 BUS and use PA4 for the first slave and PB10 for the second slave CS.

Correct?

Posted on October 01, 2015 at 11:58

Yes. You then need to manage the chip selects in software.

JW

marcogaudina9
Associate II
Posted on October 01, 2015 at 13:11

Thank you Man!