cancel
Showing results for 
Search instead for 
Did you mean: 

SPI NSS?

Dick Lin
Senior
Posted on July 13, 2018 at 18:36

Hi,

I am working on Nucleo-144 SPI. The NSS GPIO ios PA4. The only way I can have the NSS high is use 

__HAL_SPI_DISABLE() function. The HAL_GPIO_WritePin() just never work.

I can see from the scope to verify it. Doesn't seems to be the right way to turn off the SPI for set NSS high.

Anyone has experience turn NSS high/low?

/**SPI1 GPIO Configuration

PA4 ------> SPI1_NSS

PA5 ------> SPI1_SCK

PA6 ------> SPI1_MISO

PA7 ------> SPI1_MOSI

*/

HAL_GPIO_WritePin( GPIOA, GPIO_PIN_4, GPIO_PIN_SET ); // NSS1 high

__HAL_SPI_DISABLE(m_spi);

Thx

10 REPLIES 10
Posted on July 16, 2018 at 04:28

Hi,

I just saw this example. Need to leave the PA4 pin to be a generic GPIO pin.

Thx

https://visualgdb.com/tutorials/arm/stm32/spi/

We will leave the PA4 pin to be a generic GPIO pin to demonstrate how to

control the NSS signal manually:

GPIO_InitStruct.Pin = GPIO_PIN_4;

GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;

HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

On Sun, Jul 15, 2018 at 7:08 PM, Clive Two.Zero <