sdcardio is an SPI interface SD card library in CircuitPython 6.0 that is optimized in C to be much faster than the original adafruit_sdcard library. Some much smaller/older boards don't have enough memory for this module, in which case you will have to use adafruit_sdcard

Ready to do a little wiring?  Almost any Adafruit CircuitPython board will connect to the MicroSD Breakout Board using SPI. The following is an example using the Itsy BItsy M4 express.

  • Board 3V to breakout 3V via supply rail
  • Board GND to breakout GND via supply rail
  • Board MI (or MISO) to breakout SO
  • Board MO (or MOSI) to breakout SI
  • Board SCK to breakout CLK
  • Board D10 to breakout CS

The example below uses D10, but you can use any available digital pin instead. Change the mount_sd.py code below to use the pin you selected instead of board.D10.

The ItsyBitsy and the MicroSD breakout are a great way to have SD card storage in a small footprint, but these instructions will work with just about any Adafruit Feather too. Just follow the fritzing diagram and then put the following in mount_sd.py:

import board
import busio
import sdcardio
import storage

spi = board.SPI()
cs = board.D10     # Use the pin you wired to the breakout CS

sdcard = sdcardio.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
Micro SD cards and microcontrollers go together like micro-peanutbutter-and-jelly: SD cards are inexpensive, durable, easy to find at any shop, come in many sizes and can plug into any...
$2.95
In Stock
What's smaller than a Feather but larger than a Trinket? It's an Adafruit ItsyBitsy M4 Express featuring the Microchip ATSAMD51! Small,...
$14.95
In Stock
Add mega-storage in a jiffy using this 8 GB class 4 micro-SD card. It comes with a SD adapter so you can use it with any of our shields or adapters. Preformatted to FAT so it works out...
$9.95
In Stock

This guide was first published on Jul 31, 2020. It was last updated on Jul 31, 2020.

This page (ItsyBitsy M4 Express + Breakout) was last updated on Oct 23, 2021.

Text editor powered by tinymce.