No Código abaixo:
Como eu vou fazer para a rs232 não tarvar,se não chegar nenhum byte
por um tempo de aproximadamente 500_ms ou se não atingir a quantidade
de bytes de RX ???
Alguem teria algum exemplo prático para postar????
#include <18F2620.h>
#device adc=8
#FUSES INTRC_IO //Internal RC Osc, no CLKOUT
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOIESO //Internal External Switch Over mode
enabled
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOPUT //No Power Up Timer(Tempo de 72ms)
#FUSES NOSTVREN //Stack full/underflow will cause reset
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOLVP //Low Voltage Programming on B3(PIC16) or
B5(PIC18)
#FUSES NOXINST//Extended CPU (Desabilitar para não dar pane quando aumenta
memoria
#FUSES MCLR //Master Clear pin enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES NOPBADEN //PORTB pins are configured as analog input
channels on RESET
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
char Recebe[255];
char RX,i,PD;
void main()
{
PD=0;RX=60;
for( i=0; i<=RX; i++){
Recebe[PD]=getc;PD++;//Nenhum byte para aqui !!!
//Se travar(Mensagem de erro)
}
}