Tareq Domi
Junior Member level 2
- Joined
- Nov 16, 2014
- Messages
- 22
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 167
hello guys !
i need to interface an SD/MMC card with PIC 18F4520 , just to read/write a text file .
well , i wrote a simple code on Mikroc as a start , but i faced a problem once i use "Mmc_fat_init() " .
here is the code :
this code is working correctly on proteus , but once i uncomment the line " //MMc_Fat_init() ; " then the initialization fails in the proteus .
anyone can give a help
thanks
i need to interface an SD/MMC card with PIC 18F4520 , just to read/write a text file .
well , i wrote a simple code on Mikroc as a start , but i faced a problem once i use "Mmc_fat_init() " .
here is the code :
Code:
sfr sbit Mmc_Chip_Select at RC0_bit;
sfr sbit Mmc_Chip_Select_Direction at TRISC0_bit;
void main() {
SPI1_Init();
SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV64, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH);
error = MMC_Init();
while(error == 1)
{
error = MMC_Init();
}
//MMc_Fat_Init() ;
}
this code is working correctly on proteus , but once i uncomment the line " //MMc_Fat_init() ; " then the initialization fails in the proteus .
anyone can give a help
thanks