Main Page | Data Structures | File List | Data Fields | Globals

MMC/SD Card Example Code

sd_breakout2_s.jpg

Introduction

This code example show how to intialize and readout sector data from a MMC or SD card. These cards can use SPI to communicate with a host, thereby making it pretty simple to interface with a microprocessor.

Prerequisites

The code is written for an AVR microprocessor, but can relatively easy be modified to run on other microprocessors, if you really really want to. The tools used to write the code is the AVR Studio IDE * with the AVR-GCC C compiler. These tools are FREE, and you can find them at AVR Freaks

You obviously also need a MMC or SD card that can be interfaced to your processor. A sugestion is to use the SD Breakout card (shown above) from the JELU Web-shop.
You can also use the Mega8 Mini-Devboard, also from the JELU Web-shop.
The code has been written for and tested on both these platforms.

Installation

Step 1: Installing the files

Extract the files to any subdirectory on your machine.

Step 2: Configuring for your hardware

Assuming you're using AVR Studio, open the sd_breakout_demo.aps project file. Set the Frequency on the Project Option Tab to suit your target system. If you're using the Mega8 Mini-Devboard, set the Device to atmega8.

Step 3: Making the project

Simply hit F7, or click the Build Active Project button.

Step 4: Downloading to target.

Download the HEX file to your target, using your regular download tool.

Step 5: Running the code

Connect a terminal to the UART of your dev-board, set the speed to 115200 bps Insert a MMC or SD card and reset your target. You should now be able to browse the sectors of your MMC/SD card.

/Jesper


Generated on Mon Mar 6 20:15:10 2006 by  doxygen 1.4.1