problem in initializing mmc with pic18f4520 (micro C)

Status
Not open for further replies.

gemmy

Newbie level 1
Joined
Apr 23, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,287
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

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);
}
}
 


I think the major challenge you are having is your MMC image. Use Winimg85 to develope an image
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…