Difference between revisions of "Interfacing with a Secure Digital (SD) card"

From Mech
Jump to navigationJump to search
Line 6: Line 6:


[http://en.wikipedia.org/wiki/Secure_Digital_card Secure Digital Cards], or SD cards, are used to hold information in many common electronic devices from digital cameras to mobile phones and come in sizes as small as 16-32 MB and as large as 8 GB. In this lab, we will establish communication between a Microchip PIC 18F4520 and a 2GB SD card manufactured by [http://www.apacer.com Apacer].
[http://en.wikipedia.org/wiki/Secure_Digital_card Secure Digital Cards], or SD cards, are used to hold information in many common electronic devices from digital cameras to mobile phones and come in sizes as small as 16-32 MB and as large as 8 GB. In this lab, we will establish communication between a Microchip PIC 18F4520 and a 2GB SD card manufactured by [http://www.apacer.com Apacer].

SD cards can operate three different communication modes: One-bit SD mode, Four-bit SD mode, and [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus SPI] mode. SPI is a more basic protocol and it is widely supported by many microcontrollers, including the PIC 18F4520.




Most SD cards can only support clock rates up to 25 MHz, and voltage ranges from 2.0 – 3.6 v. It’s important to limit the clock signal from the PIC to the card to this range.
Most SD cards can only support clock rates up to 25 MHz, and voltage ranges from 2.0 – 3.6 v. It’s important to limit the clock signal from the PIC to the card to this range.
SD Cards can operate in two modes – SD and SPI, with the latter being appropriate for use with microcontrollers. To learn more about SPI protocol, go here. Only 7 of the 9 pins on the card are actually used in SPI mode – pins 8 and 9 are reserved and should be connected to a pull-up resistor.
To learn more about SPI protocol, go here. Only 7 of the 9 pins on the card are actually used in SPI mode – pins 8 and 9 are reserved and should be connected to a pull-up resistor.

Revision as of 14:47, 11 February 2009

Original Assignment

Establish SPI communication between your PIC and a Secure Digital (SD) card for data logging. Demonstrate the ability to store data on the card and to read it back later.

Overview

Secure Digital Cards, or SD cards, are used to hold information in many common electronic devices from digital cameras to mobile phones and come in sizes as small as 16-32 MB and as large as 8 GB. In this lab, we will establish communication between a Microchip PIC 18F4520 and a 2GB SD card manufactured by Apacer.

SD cards can operate three different communication modes: One-bit SD mode, Four-bit SD mode, and SPI mode. SPI is a more basic protocol and it is widely supported by many microcontrollers, including the PIC 18F4520.


Most SD cards can only support clock rates up to 25 MHz, and voltage ranges from 2.0 – 3.6 v. It’s important to limit the clock signal from the PIC to the card to this range. To learn more about SPI protocol, go here. Only 7 of the 9 pins on the card are actually used in SPI mode – pins 8 and 9 are reserved and should be connected to a pull-up resistor.