cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f103rb NSS

wwtzh2013
Associate II
Posted on November 15, 2013 at 02:58

hello,I have a problem about the stm32f103rb. According to the RM0008  reference manual downloaded in your website, I find the description of  slave select(NSS) pin management. So the NSS signal can be driven high if the SPI is disabled as described in the manual. However,when the SPI is disabled, the NSS signal is still low not high. Could you help me and whether the description of slave select(NSS) pin management in the reference is right or not? I'm looking forward to your reply. Thank you! 

3 REPLIES 3
Amel NASRI
ST Employee
Posted on November 15, 2013 at 11:02

Hi Wang,

What do you mean by ''SPI disabled'' in your case?

Here an explanation of NSS behavior with STM32F1:

NSS pin is driven low by the master to inform that all the other connected SPIs are potentially slave. This signal remains active and forced by the master until the master is becoming slave or is disactivated (switched-off, SPE=0 in SPI_CR register).

It means if a master sends a data and stops for a moment before sending another data, NSS pin will stay low.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

florianaugustin9
Associate II
Posted on November 15, 2013 at 14:27

Hello Malya,

I have a similiar problem with NSS Pin. If I'm using SPI AF function pin for NSS and NSS_hard, the pin won't go high level after transfer. Tested with 'SPI_I2S_SendData16' on STM32F3 and corresponding Command on F4 and with DMA! When using NSS_soft and setting pin low before transfer and high after it, everything is fine (not tested with DMA).

Thanks for your help!

Florian

wwtzh2013
Associate II
Posted on November 16, 2013 at 05:50

SPI_SSOutputCmd(SPI2,ENABLE);//NSS OUTPUT ENABLED

SPI_Cmd(SPI2, ENABLE);//SPI2 ENABLED

SPI_I2S_SendData(SPI2, udat);//SEDN DATA

SPI_Cmd(SPI2, DISABLE);//SPI2 DISABLED

this is a part of my code which is referred to the following content in the RM0008 manual as the picture. Iwantto realize thatafter16bits data are sent, the NSS signalcan be driven to ahigh level automaticallyuntil the next data need to be sent. But, unfortunately, the NSS signal is still low after data have been sent. Could you help me and explain it? Thank you.

http://www.openedv.com/upload/2013/11/15/ea907ce27fc97e04f18235c1060a508a_7jpg