Skip to main content
antonius
Associate III
October 4, 2015
Question

SPI1 hardware NSS output ?

  • October 4, 2015
  • 5 replies
  • 744 views
Posted on October 04, 2015 at 12:58

Guys,

How can I control SPI1 hardware NSS output (PA4) ? I tried to give a signal to it, but nothing on my logic analyzer...

#define Mp3SelectControl() { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4 , 0 ); }
#define Mp3DeselectControl() { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4 , 1 ); }
.
.
.
Mp3SelectControl();
HAL_Delay(10);
Mp3DeselectControl();
HAL_Delay(10);

Any clues ? thanks
    This topic has been closed for replies.

    5 replies

    Tesla DeLorean
    Guru
    October 4, 2015
    Posted on October 04, 2015 at 15:46

    The most obvious places to look would be how the pin is configured, and if there's anything externally that's impacting it.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    antonius
    antoniusAuthor
    Associate III
    October 4, 2015
    Posted on October 04, 2015 at 16:35

    It worked after I was not using NSS as hardware, but use it as a GPIO....

    Is it possible as CS pin with this configuration? thanks

    Logic analyzer capture :

    http://i129.photobucket.com/albums/p231/picture_77/logic%20analyzer%20VS1053%204_zps82ptkcm1.jpg

    Tesla DeLorean
    Guru
    October 4, 2015
    Posted on October 04, 2015 at 17:02

    Not sure I understand what the question is.

    The HW NSS is problematic because it never quite does what the attached device wants.

    With GPIO you should be able to explicitly control it, just not very tightly to the SPI peripheral.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    antonius
    antoniusAuthor
    Associate III
    October 5, 2015
    Posted on October 05, 2015 at 16:35

    So better use PA4 as GPIO output for CS, don't you think ?

    Tesla DeLorean
    Guru
    October 5, 2015
    Posted on October 05, 2015 at 17:03

    I think it's the easiest route to get the waveform you want, doesn't have to be that specific GPIO

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..