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

Thread: Teensy LC SD Card SCK mapping broken

  1. #1
    Member capricorn one's Avatar
    Join Date
    Oct 2014
    Location
    Los Angeles
    Posts
    51

    Teensy LC SD Card SCK mapping broken

    I've found a few posts that point to similar issues, but they look like they were addressed years ago and fixed.

    The problem I'm having is trying to re-assign the SCK0 pin to 14 (default is 13). I've done this in the past without any issues, calling SPI.setSCK(14) before SD.begin(CS_PIN), however on the Teensy LC, no matter what I try, I always see the LED (pin 13) blinking trying to start the SD card.

    Surprised this hasn't come up before, haven't been able to find it in the forum posts.

    Thanks in advance!
    Last edited by capricorn one; 02-12-2019 at 12:25 AM.

  2. #2
    Member capricorn one's Avatar
    Join Date
    Oct 2014
    Location
    Los Angeles
    Posts
    51
    Should include some more info I realized, I'm using the standard <SD.h> library with Teensyduino 1.45, Arduino 1.8.8.

    I've read that the <SD.h> library doesn't work with SPI1, although that may be outdated now, either way, I'm trying to use SPI0, just change SCK to pin 14. I've used this same code and hardware with a Teensy 3.2 without issue.

    If I run the CardInfo.ino example sketch, adding the line:
    Code:
    SPI.setSCK(14);         //Re-assign SPI SCK pin from default value
    Before initializing the SD card, I see the led blinking every time I restart, meaning, the SD.h library is using pin 13 (default) not 14.
    Last edited by capricorn one; 02-12-2019 at 12:27 AM.

Posting Permissions

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