8 years, 9 months ago.

SPI_CS is not working

Hello?

I'm using NUCLEO-F446RE borad.

If I don't use SPI_CS like,

SPI device(SPI_MOSI, SPI_MISO, SPI_SCK);

it's working well but, if i use SPI_CS like,

SPI device(SPI_MOSI, SPI_MISO, SPI_SCK, SPI_CS);

SPI is not working.

Please teach me how to use SPI_CS pin.

Thank you. Tony Kwon

Question relating to:

Information on how to use the STM32 Nucleo board with mbed

1 Answer

8 years, 9 months ago.

https://developer.mbed.org/users/mbed_official/code/mbed/docs/c0f6e94411f5/classmbed_1_1SPI.html#a21d684ae9ab826c863c3d198fb761bad

it should work with and without passing SPI_CS. Which pin are you using for SPI_CS that is failing ?

I'm using PA_15 for SPI_CS pin. And I modified PinNames.h as following,,

... I2C_SDA = PB_9, SPI_MOSI = PA_7, SPI_MISO = PA_6, SPI_SCK = PA_5, SPI_CS = PA_15, /PB_6, PWM_OUT = PB_3, ...

posted by Tony Kwon 28 Mar 2016

Tony - try to toggle the PA_15 pin (you could use the simple BLINKY LED code). Does that toggle the PA_15 on your Nucleo board ok ?

Hi Tony. Fully understand the hardware CS requirement and the selected PA_15 (CS) pin is the correct choice for your MISO and MOSI pins. The simple test is to only confirm that the PA_15 is functional. From the datasheets, the PA_15 is the hardware SPI CS pin for this SPI port.

posted by Sanjiv Bhatia 28 Mar 2016

Thanks for your suggestion but, I need hardware CS functionality, not software CS.

posted by Tony Kwon 30 Mar 2016