4-bit SD driver

4-bit SD mode SD card driver plug-in for Eric Smith's FlexProp/Flexspin

Share this object
<

Overview

Content

4-bit SD mode SD card driver plug-in to Flexspin's FAT filesystem layer.

Can be used with Spin2, Basic, C and any languages supported by the Flexspin compiler. Propeller 2 only.

Highest performance is typically when the buffer size matches the FAT cluster size. Writes can easily exceed 10 MB/s on fast cards, and reads 20 MB/s. There is also the option of disabling block read CRC processing to allow reads at sysclock/2. Default is sysclock/4.

Requires Flexspin compiler version 7.0.0 or later. The example tester uses the newly added _vfs_open_fat_handle() API, replacing the older preset list of vfs device open functions. The driver itself uses newly added features around "inline" assembly.

Requires a 4-bit wired SD slot. Main restriction is the four DAT pins have to be in-order on 4-bit pin boundary. Pull-ups are also recommended. Example can be found here - https://forums.parallax.com/discussion/174988/new-sd-mode-p2-accessory-board/p1
I made a basic 4-bit SD slot, without power switch nor LED, by hand wiring a pillaged SD slot - https://forums.parallax.com/discussion/comment/1563018/#Comment_1563018

Also included is two other drivers, using 1-bit SPI mode. One is just a copy of Flexspin's built-in sdmm.cc driver repackaged to be a plugin. The other is rehash of the same that plainly bit-bashes the SPI instead of using any smartpins.

There is two example programs that demonstrate mounting and use of the drivers as plugins. You'll need to dig around them to eke out the details. They are defaulted to using 1-bit SPI mode driver and the boot slot pin-out.

17 Feb 2025: v1.0 release
26 Feb 2025: v1.1, bug fix to support multi-card mounting - Convert DMA parameter structs to non-static
20 Apr 2025: v1.2, bug fix for sharing amongst cogs - Ensure DIR/OUT, of used pins, finish as set low


Downloads  
Zip archive download

Leave a Reply