i tried with original program also but the same error
---------- Post added at 12:55 ---------- Previous post was at 12:51 ----------
This is the code its fully calling that MDD files from the Libraries
/***************************************************************************************************
PROJECT TO WRITE SHORT TEXT TO AN SD CARD
======================================
In these projects, a PIC18F8722-type microcontroller is used. The microcontroller
is operated with a 10-MHz crystal.
An SD card is connected to the microcontroller as follows:
SD card microcontroller
CS RB3
CLK RC3
DO RC4
DI RC5
The program uses the Microchip MDD library functions to read and write to
the SD card.
In this version of the program an LED is connected to port RD0 and
the LED is turned ON when the program is terminated successfully.
Author: Dogan Ibrahim
Date: July 2009
File: WRITE2.C
***************************************************************************************************/
#include <p18f8722.h>
#include <FSIO.h>
#pragma config WDT = OFF, OSC = HSPLL, LVP = OFF
#pragma config MCLRE = ON, CCP2MX = PORTC, MODE = MC
#define LED PORTDbits.RD0
#define ON 1
#define OFF 0
/* ================ START OF MAIN PROGRAM ================ */
//
// Start of MAIN Program
void main(void)
{
FSFILE *MyFile;
unsigned char txt[ ]="This is a TEXT message";
TRISD = 0;
PORTD = 0;
//
// Initialize the SD card routines
//
while(!FSInit( ));
//
// Create a new file called MESSAGE.TXT
//
MyFile = FSfopenpgm("MESSAGE.TXT", "w+");
if(MyFile == NULL)while(1);
//
// Write message to the file
//
if(FSfwrite((void *)txt, 1, 22, MyFile) != 22)while(1);
//
// Close the file
//
if(FSfclose(MyFile) != 0)while(1);
//
// Success. Turn ON the LED
//
LED = ON;
while(1);
}
---------- Post added at 12:57 ---------- Previous post was at 12:55 ----------
can any one help me!