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
Im using Mikroc pro 5.61, and Proteus 7. but my Mmc_Fat_Init is not functioning. can anyone help me out. here is my code.
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D7 at RD7_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D7_Direction at TRISD7_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit Mmc_Chip_Select at RC2_bit;
sbit Mmc_Chip_Select_Direction at TRISC2_bit;
void main() {
int error;
TRISD = 0;
PORTD = 0xFF;
Lcd_Init();
Delay_ms(1000);
SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV4, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH);
//Mmc_Init();
error = Mmc_Fat_Init();
if(error==0)
{
Lcd_Out(1,1,"Working");
Delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
Delay_ms(1000);
}
else if(error==1)
{
Lcd_Out(1,1,"Not_Working");
}
else if(error==255)
{
Lcd_Out(1,1,"Too-Bad");
Delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
Delay_ms(1000);
}
}
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D7 at RD7_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D7_Direction at TRISD7_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit Mmc_Chip_Select at RC2_bit;
sbit Mmc_Chip_Select_Direction at TRISC2_bit;
void main() {
int error;
TRISD = 0;
PORTD = 0xFF;
Lcd_Init();
Delay_ms(1000);
SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV4, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH);
//Mmc_Init();
error = Mmc_Fat_Init();
if(error==0)
{
Lcd_Out(1,1,"Working");
Delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
Delay_ms(1000);
}
else if(error==1)
{
Lcd_Out(1,1,"Not_Working");
}
else if(error==255)
{
Lcd_Out(1,1,"Too-Bad");
Delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
Delay_ms(1000);
}
}