I want to communicate an Pic18 with an MMC to build a dataLogger. I already tried to use the mmc_spi.c standard library to send a simple sentence to the MMC but I can´t even initialize it without error. Can anyone help me?
#include <18f25k20.h>
#fuses HS, NOWDT, PUT, NOLVP
#use delay(clock=4M)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#define MMC_CLK PIN_C3
#define MMC_DI PIN_C4
#define MMC_DO PIN_C5
#define MMC_CS PIN_C2
#include <mmc_spi.c>
void main()
{
printf("\n\rTest MMC_SPI\n\r");
if(mmc_init()==0)
printf("\n\rSuccessfully initialized\n\r");
else
printf("\n\rError\n\r");
}
I also enabled a print out debbug message and I get:
ERR: MMC is busy
ERR: after reset, device ins´t idle