Analog Devices EE264v01 Application Notes

Engineer-to-Engineer Note EE-264
a
Technical notes on using Analog Devices DSPs, processors and development tools
Contact our technical support at dsp.support@analog.com and at dsptools.support@analog.com Or vi sit our o n-li ne r esou rces htt p:/ /www.analog.com/ee-notes and http://www.analog.com/processors
Interfacing MultiMediaCard™ with ADSP-2126x SHARC® Processors
Contributed by Aseem Vasudev Prabhugaonkar and Jagadeesh Rayala Rev 1 – March 11, 2005

Introduction

This application note describes how to implement the interface between an ADSP­2126x SHARC® processor and a MultiMediaCard™ (MMC). The application note also describes the MMC command format and demonstrates with example code how an MMC card can be interfaced seamlessly with the SHARC processor’s SPI port. Example code supplied with this application note implements the most commonly used commands of MultiMediaCard.

About MultiMediaCard

memory access voltage of 2.7 to 3.6 V, and a capacity from 4 MB to the gigabyte range.

About the ADSP-2126x SPI Port

The ADSP-2126x processor is equipped with a synchronous serial peripheral interface port that is compatible with the industry-standard Serial Peripheral Interface (SPI). The SPI port supports communication with a variety of peripheral devices including codecs, data converters, sample rate converters, S/PDIF or AES/EBU digital audio transmitters and receivers, LCDs, shift registers, micro-controllers, and FPGA devices with SPI emulation capabilities.
The MMC was introduced in 1998 and had an amazing reduction in cubic capacity compared with CompactFlash™. MMC cards are now widely used in digital cameras, smart cell
Important features of ADSP-2126x SPI port include:
Simple four-wire interface, consisting of two
data pins, a device select pin, and a clock pin
phones, PDAs, and portable MP3 players. Their intended use is to store information and content.
Full duplex operation, allowing simultaneous
data transmission and reception on the same
The MMC consists of a 7-pin interface and
SPI port
supports two serial data transfer protocols viz. the MMC (MultiMediaCard) mode and SPI (Serial Peripheral Interface) mode. The maximum operating clock frequency used for serial communication in both modes can go up to 20 MHz. The data written in any of these modes can be read by host in either mode. The advantage of MMC supporting SPI mode is that MMC can be interfaced seamlessly to many controllers or DSP processors, which have on­chip support for SPI. Most MMCs have a
Data formats to accommodate little and big
endian data, different word lengths, and packing modes
Master and slave modes as well as
multimaster mode in which the ADSP-2126x processor can be connected to up to four other SPI devices
Open drain outputs to avoid data contention
and to support multimaster scenarios
communication voltage from 2.0 to 3.6 V, a
Copyright 2005, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of customers’ products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property of their respective holders. Information furnished by Analog Devices applications and development tools engineers is believed to be accurate and reliable, however no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices’ Engineer-to-Engineer Notes.
a
Programmable bit rates, clock polarities, and
phases
DMA capability, allowing transfer of data
without core overhead
Master or slave booting from a master SPI
device

The MultiMediaCard Interface

In SPI mode, four signals (clock, data in, data out and chip select) are used for the interface. The clock is used to drive data out on the data out pin and receive data on the data in pin. The host drives commands and data to the MMC over the MMC’s data in pin. The host receives response and data from the MMC on its data out pin. The chip select signal is used to enable the MMC during data and command transfer. The chip select signal is also used initially to drive the MMC in SPI mode. Note that in SPI mode, data is transferred in units of eight clock cycles.
Pin Name Type Function
1 CS# Input Chip select
(active low) 2 Din Input Data input 3 VSS1 Power GND 4 VDD Power VCC 5 CLK Input Clock input 6 VSS2 Power GND 7 Dout Output Data output
Table 1. MultiMediaCard Pin Assignment
The MMC pin assignments in SPI mode are shown in Table 1 and Figure 1. Figure 2 shows the MMC interface with the ADSP-2126x SPI port.
VCC
ADSP-2126x SPI
MOSI
MISO
SPICLK
FLAGx
Figure 2. MultiMediaCard Interface with SPI Port
Din Dout CLK
GND

The MultiMediaCard Protocol

The SHARC processor's SPI issues commands to the MMC over the data in (Din) pin of the MMC. The data in pin of the MMC is connected to MOSI of the SPI. The data is also written to the MMC over the data in signal of the MMC. Based on the received command, the MMC sends response or data on the data out (Dout) pin. The data out pin of the MMC is connected to MISO of the SHARC processor's SPI port. The processor's SPI port uses one of the Programmable Flag pins (FLAGx) to drive CS# of the MMC. The communication is initiated by different commands sent from the SHARC processor to the MMC. All commands are six bytes long and are transmitted MSB first. Refer to Figure 3 for generic transfer protocol between the MMC and the SHARC processor's SPI port.
Figure 1. MultiMediaCard Pin Assignments
Interfacing MultiMediaCard™ with ADSP-2126x SHARC® Processors (EE-264) Page 2 of 6
Figure 3. MultiMediaCard Transfer Protocol
Loading...
+ 4 hidden pages