Pumpkin, Inc.

Pumpkin User Forums

PIC serial communication with uAlfat -SD chip

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

PIC serial communication with uAlfat -SD chip

Postby zj » Thu Aug 21, 2008 7:26 am

hi
i hav been trying to setup serial commnication of PIC with UAlfat-SD memory card chip. i hav used serial interrupts for reception. this routine works fine for communication with PC. but in case of memory card ISR is not invoked on reception of data from card. the code is


#include <16F877A.h>
#fuses HS,NOLVP,NOWDT,PUT,NOBROWNOUT
#use delay(clock=10000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

char tester;
char str_ch[30];
int j;

//interrupt service routine
#int_rda
void serial_isr( ){
tester=getc( );
str_ch[j]=tester;
j=j+1;
}


//main programm
void main( )
{
int k;
char del[10];
j=0;
getch( );
enable_interrupts(GLOBAL);
enable_interrupts(int_rda);
enable_interrupts(GLOBAL);
//read data from this file
printf("O 1R>DSAMP.LOGX0d");
while(true){
if (tester=='W'){break;}
}
//write the read data to this file
printf("O 2W>VOLTASTR.LOGX0d");
for(k=0;k<j;k++){
printf("character is %c
",str_ch[k]);
}
delay_ms(1);
printf("C 1X0d");

delay_ms(1);
printf("C 2X0d");
}

any help wud b higly appreciated

zj
 
Posts: 1
Joined: Wed Aug 20, 2008 11:00 pm

Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 3 guests

cron