Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

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

Address your IoT software testing needs – improve quality, security, safety, and compliance across the development lifecycle.

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.

Accelerate the delivery of high-quality software in the connected IoT era through an integrated analysis, testing, security, and analytics platform. Parasoft's comprehensive portfolio of testing toolsautomates time-consuming testing tasks and provides management with intelligent analytics and reporting so they can focus on what matters.

Topics:
adafruit ,boards ,microsd ,kinetis

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}