|
|
View previous topic :: View next topic |
Author |
Message |
tberckmann Guest
|
Interfacing to a Multimediacard (MMC) |
Posted: Tue May 24, 2005 11:11 am |
|
|
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
|
|
Posted: Tue May 24, 2005 11:32 am |
|
|
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 |
|
|
|
|
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
|