Over a million developers have joined DZone.

FatFS With Adafruit MicroSD Breakout Board and NXP FRDM-KL25Z

DZone's Guide to

FatFS With Adafruit MicroSD Breakout Board and NXP FRDM-KL25Z

See one particular configuration for a breakout board you can use for quick assistance on your projects.

· IoT Zone ·
Free Resource

Digi-Key Electronics’ Internet of Things (IoT) Resource Center Inspires the Future: Read More

Breakout boards are great. They allow me to explore functions quickly, without to build my custom board. All I need are some wires and, ideally, a bread board.

Adadfruit MicroSD Card Breakout Board

Adafruit MicroSD Card Breakout Board

Here is how I wire the Adafruit Micro SD card breakout board to the NXP FRDM-KL25Z board:

  • CD (Card detect) to PTD5.
  • CS (Chip select, slave select) to PTD0.
  • DI (Data In, MOSI) to PTD2.
  • DO (Data Out, MISO) to PTD3.
  • CLK (Clock) to PTD1.
  • GND (Ground) to GND.
  • 3V not connected, as this is the 3.3V regulator output of the breakout board.
  • 5V (power supply of the breakout board) to 5V.

The board includes a 3.3V level shifter as SD cards use 3.3V logic levels. With the level shifter and the onboard regulator that board can be used both with 3.3V and 5V microcontroller. With the FRDM-KL25Z which uses 3.3V logic levels, I power the board with 5V:

MicroSD Card Breakout Board Wiring Detail

MicroSD Card Breakout Board Wiring Detail

Below is a high-resolution image with the connections between the FRDM-KL25Z and breakout board:

MicroSD Card Breakout Board Wiring Detail

MicroSD Card Breakout Board Wiring Detail (Click to Enlarge)

An example project is available on GitHub here.

It uses the NXP Kinetis Design Studio V3.2.0 with Processor Expert, FreeRTOS, and FatFS:

FatFS Project

The above project can work with any other breakout board, considering the following:

  • MicroSD cards do not have a ‘write protection tab,’ so the write protection pin is not needed
  • Some cards have HIGH active card detection pin, some have LOW active levels. Tha Adafruit one is HIGH active:

Card Detection Pin

Card Detection Pin

This can easily be verified with the example project shell command:

Card Present status

Card Present status

Below is an example session with a terminal connected to the OpenSDA port with 38400 baud:

Example FatFS Session

Example FatFS Session

Breakout boards are great, and while there are many ones available on the market, I mostly use the ones from Adafruit. But if you are using a different SD or microSD card board, the project used in this article easily can be adapted to a different card. I hope this is useful for you too. Happy Breakouting.

Digi-Key’s IoT Component Selector is your one-stop-shop for the IoT

adafruit ,boards ,microsd ,kinetis

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}