Is it possible to use the 4-pin mode of an SD card when designing an interface with a microcontroller, or must you always use SPI mode? I am particularly thinking of a microcontroller such as a PIC24. The SPI mode is slower, obviously, and I am trying to think of better ways to improve the device's throughput.
That's what I've found:
The SD 1-bit protocol is a synchronous serial protocol with one data line, used for bulk data transfers, one clock line for synchronization, and one command line, used for sending command frames. The SD 1-bit protocol explicitly supports bus sharing. A simple single-master arbitration scheme allows multiple SD cards to share a single clock and DAT0 line. The SD 4-bit protocol is nearly identical to the SD 1-bit protocol. The main dierence is the bus width bulk data transfers occur over a 4-bit parallel bus instead of a single wire. With proper design, this has the potential to quadruple the throughput for bulk data transfers. Both the SD 1-bit and 4-bit protocols by default require CRC protection of bulk data transfers. A CRC, or Cyclic Redundancy Check, is a simple method for detecting the presence of simple bit-inversion errors in a transmitted block of data. In SD 4-bit mode, the input data is multiplexed over the four bus (DAT) lines and the 16-bit CRC is calculated independently for each of the four lines. In an all-software implementation, calculating the CRC under these conditions can be so complex that the computational overhead may mitigate the benets of the wider 4-bit bus. A 4-bit parallel CRC is trivial to implement in hardware, however, so custom ASIC or programmable-logic solutions are more likely to benet from the wider bus.
I believe you wouldn't have enough power to calculate crc32 in 4-bit mode. But without CRC it might be possible.
improving throughput in 1-bit mode
There is a huge variation in performance from SD card to another.
(a) All cards give a "busy" response to one command until it is ready to handle the next. A card can still comply with the standards even if it takes a second to write a block of data. Perhaps you could try a few different cards and see which one works the best for you -- the best net throughput, the lowest latency, the least amount of energy to wake up and store the data and go back to sleep, or whatever is most important for your project. If throughput is the most important, then you'll want to pick the appropriate SD Card Speed Class Rating -- the highest speed you can afford, or at least the lowest class that gives adequate performance.
(b) While the standard requires all SD cards to handle communications at up to 25 Mbit/s in 1-bit mode, a few cards seem to work with much higher bit rates -- perhaps you could try a few different cards and bump up your bit rate to something faster that works with that particular card. (Is there something like "automatic baud rate detection" to automatically use the maximum speed supported by whatever card is currently plugged in?)
using 4-pin mode
A microcontroller can support using four-bit SDI transfer mode. The 2 options I know about are:
(a) Plug the card into a USB SD card adapter that uses four-bit SDI transfer mode. Plug the adapter into a USB host connector attached to a microcontroller that can act as a USB host, such as the PIC24FJ32GB002.
(b) Plug the card into a SD card slot directly attached to a microcontroller. Do I need to pay royalties to the SD card people if my device “just happens” to be compatible with SD cards? For a long time various patents and trade secrets required a person designing such a host controller interface to sign an NDA and buy a patent licence from the SD Card Association. But I hear that the SD interface standard is becoming more open since 2006.