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

Thread: What "pin" does BUILTIN_SDCARD control?

  1. #1
    Junior Member
    Join Date
    Aug 2019
    Posts
    5

    What "pin" does BUILTIN_SDCARD control?

    Maybe it's my unfamiliarity with how 4-bit SDIO works, but I'm curious as to how the SS pin for an SD card can be replaced with BUILTIN_SDCARD on the Teensy 3.5/6. Does SDIO also use a slave-select mechanism? The wikipedia page is unclear as to what the transfer protocol differences are between SPI, 1-wire SDIO and 4-wire SDIO.

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,129
    It's just a software trick -- a big number that's not a pin that the SD lib examines, and determines it's not a SPI pin, and branches to activate the SDHC interface/software for the the builtin uSD

  3. #3
    Quote Originally Posted by evictus View Post
    Maybe it's my unfamiliarity with how 4-bit SDIO works, but I'm curious as to how the SS pin for an SD card can be replaced with BUILTIN_SDCARD on the Teensy 3.5/6. Does SDIO also use a slave-select mechanism? The wikipedia page is unclear as to what the transfer protocol differences are between SPI, 1-wire SDIO and 4-wire SDIO.
    They start out identically. But in order to switch the card into SPI mode you assert the CS pin while transmitting CMD0. SD mode (SDIO is actually a variant of SD cards) starts as 1 wire but you can ask if the card supports other features (4 bit, higher speed, etc.) and enable them if desired and supported. All of this is covered in the specifications. Part 1 being the most useful.

    Table 3-1 shows the pins functions. Note that the pin used for CS in SPI mode is used for Card Detect/DAT3 in SD mode.

Posting Permissions

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