Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

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

  1. #1

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

    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.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,558
    Those are SPI1 pins not SPI

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •