Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
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
Picture1.png
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);
}
}
 

Oluwole_Oyetoke

Junior Member level 3
Joined
Apr 20, 2013
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,407
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
View attachment 55568
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top