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

Thread: Teensy 4.0 BUILT_IN SD - SPI Drive strength

Threaded View

  1. #1
    Junior Member
    Join Date
    Dec 2021

    Teensy 4.0 BUILT_IN SD - SPI Drive strength

    Hi All,

    Redirected here by greiman of SDFat.

    I build a custom board of which allows for an SD card to be connected to the T 4.0. I am getting odd results when it comes to writing to the SD card.

    If I write to the SD once every 800ms, this works, but anything quicker than 800ms and the SD becomes unformatted.

    Quick example as code is massive:

    char newTextToAdd[500];
    String testCode = "This is a test";
    testCode.toCharArray(newTextToAdd, sizeof(newTextToAdd));, FILE_WRITE);
    file.write(newTextToAdd, tt.length());
    So I was thinking there was an issue with my code, however I ran the SDIO demo by greiman and I yield the following results:

    FIFO SDIO mode.
    16384,Error: write failed
    SD_CARD_ERROR_CMD12, ErrorData: 0X0
    Again, the SD becomes unformatted. Greiman suggest that I alter the drive strength and frequency in the teensy source code.

    I now suspect the SD is becoming unformatted because the card is too far away from the T4.0 on the PCB.

    Can anyone please advise what frequency/drive strength should be selected to (boost the signal)?

    NB: The SD either becomes unformatted or unresponsive, until power is cycled (or I call sd.begin(SD_CONFIG) again). I am using multiple SanDisk SDHC/SDXC (v30)s purchased from different sources and am confident they are all genuine.

    Many Thanks
    Last edited by el_Samiyel; 01-25-2023 at 07:04 PM.

Posting Permissions

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