cancel
Showing results for 
Search instead for 
Did you mean: 

SPI1 hardware NSS output ?

antonius
Senior
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
5 REPLIES 5
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 Up vote any posts that you find helpful, it shows what's working..
antonius
Senior
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

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 Up vote any posts that you find helpful, it shows what's working..
antonius
Senior
Posted on October 05, 2015 at 16:35

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

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 Up vote any posts that you find helpful, it shows what's working..