gemmy
Newbie level 1
i cant initializ mmc with microcontroller pic 18
i used microc library mmc with micro c pro for pic version 4.60.0
i have i problem in initializing it with the function Mmc_Init();.
it returns 1 which means that there is an error
whith freq=8 mhz
another question what should i put on the mmcard on proteus
i put on it a txt file is that's right
thnx in advance
i used microc library mmc with micro c pro for pic version 4.60.0
i have i problem in initializing it with the function Mmc_Init();.
it returns 1 which means that there is an error
whith freq=8 mhz
another question what should i put on the mmcard on proteus
i put on it a txt file is that's right
thnx in advance
Code:
sfr sbit Mmc_Chip_Select at RC0_bit;
sfr sbit Mmc_Chip_Select_Direction at TRISC0_bit;
unsigned int error;
unsigned int erroro;
unsigned long sectorNo = 510;
char dataBuffer[512];
void main(){
TRISD=0x00;
PORTD=00000000;
// MMC module connections
while (1)
{
SPI1_Init();
dataBuffer[3]="abcd";
error = Mmc_Init(); // Init with CS line at RC0_bit
if (error == 1)
PORTD.F0=1;
erroro = Mmc_Write_Sector(sectorNo, dataBuffer);
}
}