duryan
Newbie level 4
- Joined
- Dec 1, 2011
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,342
hi guys!
below is my code in interfacing mmc and pic18f4550
The code is not yet complete but i don't have a display in the LCD when Mmc_Fat_Init() is being executed. When i remove Mmc_Fat_Init(), got an out in the LCD as shown below
Any suggestion is very much appreciated.
below is my code in interfacing mmc and pic18f4550
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 #define BUFFER_SIZE 15 //Memory Card Chip Select Connection sfr sbit Mmc_Chip_Select at RB2_bit; sfr sbit Mmc_Chip_Select_Direction at TRISB2_bit; // // LCD module connections sbit LCD_RS at RD0_bit; sbit LCD_RW at RD1_bit; sbit LCD_EN at RD2_bit; sbit LCD_D4 at RD4_bit; sbit LCD_D5 at RD5_bit; sbit LCD_D6 at RD6_bit; sbit LCD_D7 at RD7_bit; sbit LCD_RS_Direction at TRISD0_bit; sbit LCD_EN_Direction at TRISD2_bit; sbit LCD_D4_Direction at TRISD4_bit; sbit LCD_D5_Direction at TRISD5_bit; sbit LCD_D6_Direction at TRISD6_bit; sbit LCD_D7_Direction at TRISD7_bit; // End LCD module connections unsigned char filename[] = "Temp.TXT"; unsigned char error; void main() { TRISD = 0x00; Lcd_Init(); Lcd_Cmd(_LCD_CURSOR_OFF); Lcd_Cmd(_LCD_CLEAR); Delay_ms(100); Lcd_Out(1,1," TEMP. RECORDER"); Lcd_Out(2,1," EMBEDDED LAB"); Delay_ms(1000); ADCON1 = 0x0F; //All Analog Channels SPI1_Init(); SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV64, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH); Delay_us(10); error = MMC_Init(); while(error == 1) { Lcd_Cmd(_LCD_CLEAR); Lcd_Out(1,1," CARD NOT FOUND"); error = MMC_Init(); } Lcd_Cmd(_LCD_CLEAR); Lcd_Out(1,1," CARD DETECTED!"); Lcd_Out(2,1,"CARD INITIALIZED"); Delay_ms(1000); SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV4, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_LOW, _SPI_LOW_2_HIGH); Mmc_Fat_Init(); while(1); }
The code is not yet complete but i don't have a display in the LCD when Mmc_Fat_Init() is being executed. When i remove Mmc_Fat_Init(), got an out in the LCD as shown below
CARD DETECTED!
CARD INITIALIZED
Any suggestion is very much appreciated.
Last edited: