Continue to Site

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.

sd card interfacing with 18f452 using MPLAB IDE and PICI8C compiler

Status
Not open for further replies.

sathishaliasvsk

Newbie level 5
Joined
Feb 2, 2010
Messages
8
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
india
Activity points
1,375
Hi everybody!
i am trying to interface SD card with 18F452 for that i have read one book from microchip in that they used pici8f8722. i modified that progarm just by changing that ic name, followed every steps and added all the MDD files, HITECH PIC18 C compiler and MPLAB i used as it is in that book. while compiling am getting error FSIO.c out of Date all the spi command like SPIBUF, SPIInt flag all not defined.

i dont know what to do now give me some idea i just want to write a data from 18F452 to SD card by using MPLAB and HITECH PIC18C compiler
 

Just try the original program and see if it is working first? By the way, can you post the codes here?
 

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!
 

is there any other way to program not by calling inbuilt function give some sample codes?

---------- Post added at 13:01 ---------- Previous post was at 12:58 ----------

yes i have include. FSIO.C as well as FSIO.h

---------- Post added at 13:10 ---------- Previous post was at 13:01 ----------

am using evaluation version? will it be a problem?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top