Hola amigos estoy tratando de hacer una conexión rs232 puedo enviar bien los datos pero cuando trato de hacer una interrupción para leer el buffer del pic todo se desvarajusta ni lee ni escribe aqui les pongo el programa haber si alguien me puede hechar una mano muxas gracias
#include <16F877A.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES XT //Crystal osc <= 4mhz
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES BROWNOUT //Reset when brownout detected
#FUSES LVP //Low Voltage Programming on B3(PIC16) or B5(PIC18)
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
#use delay(clock=4000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
#int_RDA
#include <ctype.h>
#include <string.h>
int const lenbuff=64;
int addcbuff(char c);
void echos (char c);
char rcvchar=0x00;
int xbuff=0x00;
char cbuff[lenbuff];
//RDA_isr()
void serial_isr()
{
rcvchar=0x00;
if (kbhit())
{
rcvchar=getc();
addcbuff(rcvchar);
putc (rcvchar);
}
}
int addcbuff (char c)
{
cbuff[xbuff++]=c;
if (xbuff>lenbuff)
xbuff=lenbuff;
}
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(VREF_LOW|-2);
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
while (true)
{
printf("haciendo tiempo
"

;
delay_ms(1000);
enable_interrupts(int_rda); // Habilita Interrupción RDA
enable_interrupts(global); // Habilita interrupciones
}
}
le he dado miles de vueltas pero no encuentro el error un saludo