Teensy 4.1 SPI.h bug -- when using secondary SPI it disables GPIO

tomheralds36

New member
Code:
#include <SPI.h>

//SPI PROTOCOL
const int SDO = 39;
const int CS = 38;
const int CLOCK = 27;
const int CLOCKSPEED = 1000000;

const int PIN = 11;


void setup() {
  // put your setup code here, to run once:
    SPI.setSCK(CLOCK);
    SPI.setMISO(SDO);
    SPI.setCS(CS);

    SPI.begin();
}

void loop() {
  digitalWrite(PIN, LOW);
  delay(500);
  digitalWrite(PIN, HIGH);
  delay(500);
  // put your main code here, to run repeatedly:

}

For some reason, when I set the SPI on CLOCK, SDO, and CS it disables pin 11 which is one of the pins for the default SPI. For context, I'm trying to just read SPI data in while also writing to PIN. It might have to do with configuration of GPIO when changing the SPI from default to secondary pins.
 
Back
Top