Bingo. The work has already been done for us. http://www.captain.at/electronic-atmega-mmc.phpNow to convert that for use on the Arduino....
You will learn eventually.
/* initialize SPI with lowest frequency; max. 400kHz during identification mode of card */ SPCR = (0 << SPIE) | /* SPI Interrupt Enable */ (1 << SPE) | /* SPI Enable */ (0 << DORD) | /* Data Order: MSB first */ (1 << MSTR) | /* Master mode */ (0 << CPOL) | /* Clock Polarity: SCK low when idle */ (0 << CPHA) | /* Clock Phase: sample on rising SCK edge */ (1 << SPR1) | /* Clock Frequency: f_OSC / 128 */ (1 << SPR0); SPSR &= ~(1 << SPI2X); /* No doubled clock frequency */
Ok I'm looking at someone else's code Once I know how to convert it to Arduino style code, I should be dumping data from a SD card.
SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR1)|(1<<SPR0)|0<<SPI2X;
take a look here: http://www.arduino.cc/en/Reference/Bitshift