Which SD is Best for Audio Projects?

FWIW, I noticed Adafruit just added a bunch of micro SD cards that specifically aren't SD-HC or SD-XC based,

I have lots of small cards like that. They are SD2 cards and work fine.

The problem involves SD1 cards produced with the April 15, 2001 V1.01 or October 15, 2004 V1.10 command structure. I have the V1.10 cards working and understand the V1.01 problem. V1.01 cards only support 25 MHz SDIO and both Teensy 3.6 and Teensy 4.1 need a reset when CMD6 fails.

Here is the 1.1.0 spec for the new CMD6.
This is a new feature, introduced in SD physical Layer Specification Version 1.10. Therefore, cards that are compatible with earlier versions of the spec do not support it. The host shall check the "SD_SPEC" field in the SCR register to recognize what version of the spec the card complies with before using CMD6. It is mandatory for SD memory card of Ver1.10 to support CMD6.

So I must read the SCR register. Just have not had time to finish this.

Edit: CMD8 is a nasty problem. You can't read the SCR register until you init the card so you must issue CMD8 and determine how to init the card by success or failure of CMD8. CMD6 is issued after the card is initialize so you can avoid it for V1.01 cards.

Edit: I may not allow for V1.01. I don't think any microSD cards were produced with V1.01. I have full size V1.01 16 MB cards that I use in Teensy with an adapter.
 
Last edited:
Here are key milestone SD specs that apply to Teensy. The uSDHC controller only supports features up to the V3.01 May 18, 2010 Spec. The current spec is V8.0 September 2020.

Version 1.01 Card Requirements (SD_SPEC is set to 0)
(1) The card does not support CMD6
(2) The card does not support CMD8
(3) User area capacity shall be up to 2GB

• Version 1.10 Card Requirements (SD_SPEC is set to 1)
(1) The card shall support CMD6
(2) The card does not support CMD8
(3) User area capacity shall be up to 2GB

• Version 2.00 Card Requirements (SD_SPEC is set to 2)
(1) The card shall support CMD6
(2) The card shall support CMD8
(3) The card shall support CMD42
(4) In case of SDHC, the card shall support Speed Class
(5) User area capacity shall be up to 32GB.

• Version 3.00 Card Requirements (SD_SPEC is set to 3)
(1) The card shall support CMD6
(2) The card shall support CMD8
(3) The card shall support CMD42
(4) In case of SDHC or SDXC, the card shall support Speed Class
(5) User area capacity shall be up to 2TB.
 
I have been testing mods for old small V1.XX cards. I can get almost all to init with sd.begin(). Several require a power cycle before a second call to sd.begin().

Several cards will fail with FIFO_SDIO but will work with DMA_SDIO. The problem seems to be no support for read wait in SDIO mode:
The uSDHC module supports the stop at block gap request for write transfers, but for read transfers it requires that the SD card support read wait.

This makes these cards extremely slow in DMA mode. FIFO mode for SDIO is like dedicated SPI mode. DMA mode is like shared SPI mode.

Card fail in different ways depending on if the board is Tennsy 3.5/3.6 or 4.1. The uSDHC controllers are not friendly to old cards, here is an example with no work-around.

If commands with data transfer do not receive the response in 64 clock cycles, that is, if response time-out happens, uSDHC treats the external device, does not accept the command, and aborts the data transfer.

This means a card has only about 1.2 usec to respond at 50 Mhz.

I am reluctant to encourage use of old cards that will be flaky in many cases.
 
New SdFat-beta

I posted a new version of SdFat here as 2.1.4-beta.3.

It allows more old cards to be used with SDIO. More cards work on Teensy 3.x than Teensy 4.1. Often a card that fails with FIFO_SDIO will work with DMA_SDIO. FIFO_SDIO depends on a card being able to pause read at sector boundaries like dedicated SPI. Some cards don't support this feature in SDIO mode or don't respond with data fast enough and the uSDHC controller has a fixed 64 clock timeout.

Some cards require a power cycle to init a second time. A total reset of the uSDHC does not work, even reloading the program fails.

I added three new fields to the SdInfo example to provide more info on cards. Here is an example for my oldest card:

Card type: SD1
sdSpecVer: 1.01 <<--- Version of SD Spec. April 15, 2001 1.01 Initial release version.
HighSpeedMode: false <<--- No support for "High Speed" 50MHz mode. Only 25MHz "Default Speed" mode.

Manufacturer ID: 0X3
OEM ID: SD
Product: SD016
Revision: 3.1
Serial number: 0XA30FA0
Manufacturing date: 8/2003

cardSize: 14.75 MB (MB = 1,000,000 bytes)
flashEraseSize: 32 blocks
eraseSingleBlock: true
dataAfterErase: zeros <<--- This card erases to all zeros. Some erase to all ones.
 
Question about this RTOS discussion at the beginning of this thread:

I unfortunately only have a very basic understanding of things.
I am using the threads library together with audio and SD-card access. As far as I understand, threads is pre-emptive and driven by interrupts. So I assume, that it can squeeze other threads into polling of SD-card-busy?
 
Hi Paul,

Would you be able to expand on where you got "415 to 550 microseconds latency" and "For audio, our max timing budget is 2902 microseconds" from? Thanks!
 
Back
Top