#include <16F877A.h>
#device *=16
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES PUT //Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
int DATA0;
int DATA1;
int1 kbhit_rs232=0;
#int_RDA
RDA_isr()
{
DATA0=0x00;
DATA1=0x00;
while(kbhit()==0){} //Espero segundo dato
kbhit_rs232=1;
}
void main()
{
set_tris_c(0xF8);
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
do{
while(kbhit_rs232==0){}
kbhit_rs232=0;
// Se recibio Dato
}while(TRUE);
}