
I'm trying to use the SD.h or the SDfat.h lib with the second SPI on an STM32F103 - but I'm failing.
My Idea was to remap the Pins:
Code: Select all
#include <SPI.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while(!Serial)
{
}
SPI.setMISO(PB14);
SPI.setMOSI(PB15);
SPI.setSCLK(PB13);
SPI.setSSEL(PB12);
Serial.print("MISO is: ");
Serial.print(MISO);
Serial.print(" but should be: ");
Serial.println(PB14);
Serial.print("MOSI is: ");
Serial.print(MOSI);
Serial.print(" but should be: ");
Serial.println(PB15);
Serial.print("SCK is: ");
Serial.print(SCK);
Serial.print(" but should be: ");
Serial.println(PB13);
Serial.print("CSS is: ");
Serial.print(SS);
Serial.print(" but should be: ");
Serial.println(PB12);
}
void loop() {
// put your main code here, to run repeatedly:
}
Code: Select all
MISO is: 26 but should be: 14
MOSI is: 27 but should be: 13
SCK is: 25 but should be: 15
CSS is: 24 but should be: 16
Greetings, Jens