Skip to main content
wwtzh2013
Associate
November 15, 2013
Question

stm32f103rb NSS

  • November 15, 2013
  • 3 replies
  • 992 views
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! 

    This topic has been closed for replies.

    3 replies

    Amel NASRI
    ST Technical Moderator
    November 15, 2013
    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 "Best Answer" on the reply which solved your issue or answered your question.
    florianaugustin9
    Associate III
    November 15, 2013
    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
    wwtzh2013Author
    Associate
    November 16, 2013
    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