CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Interfacing to a Multimediacard (MMC)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
tberckmann
Guest







Interfacing to a Multimediacard (MMC)
PostPosted: Tue May 24, 2005 11:11 am     Reply with quote

I am attempting to connect a PIC18f6720 to an Atmel AT45DCB008 MMC using the SPI bus.

I have confirmed that the card is receiving the required 3.3V, that it is properly grounded, and that the pins are properly connected to the bus.

I initialized the card with the following code:

Code:


SETUP_SPI(SPI_MASTER | SPI_CLK_DIV_4);

SSPSTAT |= 0x40;                          // set CKE - bit 6
SSPCON1 &= ~0x10;                         // unset CKP - bit 4

chip_select(NONE);                    // set SS = 1 (off)

for(i=0;i<10;i++)                       // send at least 74 clks on
{
        SPI_WRITE(0xFF);
}

chip_select(MMC_CS);                     // set SS = 0 (on)
delay_us(250);


SPI_WRITE(0x40);                        // send reset command
SPI_WRITE(0x00);                        // all the arguments are 0x00
SPI_WRITE(0x00);
SPI_WRITE(0x00);
SPI_WRITE(0x00);
SPI_WRITE(0x95);                        // precalculated checksum

SPI_READ(0xFF)


I confirmed (using an oscilloscope) that the write commands were in SPI mode 0 (that the command was available on the rising edge, and properly formatted, etc...) and that all of the timing was correct. However, in the final SPI_READ command, there is no response from the card, despite polling for several seconds.

Does anyone have some troubleshooting tips or suggestions for me?
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue May 24, 2005 11:32 am     Reply with quote

The AT45DCB008 has a physical connector and dimensions that are equal to an MMC card, the used protocol however is completely different. I had a quick look at the datasheets and the protocol looks much easier than the protocol for the MMC card.

For a detailed description of the AT45DCB008 you have to look at the datasheet for the AT45DB642
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group