STM32L4 Alternate SPI function for PA15
Posted: Sun Jun 04, 2023 8:09 pm
Hello,
I want to use PA15 as chip select, but can't get it to even change state to high by using:
I can't find any information why the below would not work on STM32L4? SPI data and clock are ok, but the chip select remains low. Is there some other function I should be using?
I did notice an earlier post suggesting:
https://github.com/stm32duino/Arduino_C ... .h#L68-L85
But it doesn't seem to do anything differently on L4's.
I want to use PA15 as chip select, but can't get it to even change state to high by using:
Code: Select all
pinMode(PA15, OUTPUT);
digitalWrite(PA15, HIGH);
Code: Select all
#include <SPI.h>
void setup() {
LL_GPIO_SetAFPin_8_15(GPIOA,LL_GPIO_PIN_15,LL_GPIO_AF_5);
LL_GPIO_SetPinMode(GPIOA,LL_GPIO_PIN_15,LL_GPIO_MODE_OUTPUT);
Serial.begin(57600);
SPI.setMISO(PA6);
SPI.setMOSI(PA7);
SPI.setSCLK(PA5);
SPI.setSSEL(PA15);
//pinMode(PA15, OUTPUT);
//digitalWrite(PA15, HIGH);
SPI.begin();
delay(100);
}
void loop() {
SPI.transfer(0x7E);
delay(1000);
}
https://github.com/stm32duino/Arduino_C ... .h#L68-L85
But it doesn't seem to do anything differently on L4's.