cancel
Showing results for 
Search instead for 
Did you mean: 

How can I set the SPI pins manually (HIGH or LOW)? Do I need to use the alternate function of these pins and use pin stacking? Or can I access the SPI pins in another way?

TK.1
Associate
 
2 REPLIES 2

Which STM32?

Switch the pins to Output in respective GPIOx_MODER, and then manipulate them as outputs (through GPIOx_ODR or GPIOx_BSRR). When done, switch back to Alternate Function again in GPIOx_MODER.

I don't know what is pin stacking.

JW

TDK
Guru

A pin can't be GPIO and SPI at the same time, so changing between the two as JW suggests is the only way to do this.

It is not typical of SPI communication to need to control data lines separately from the clock.

If you feel a post has answered your question, please click "Accept as Solution".