I am trying to read text data through the UART1_Read_Text() function, I stop reading data when I add some delay or escape sequence. The flow of code output should not be changed.
This is the code below I am using. The device I have for this code is pic18f67k40.
Code: Select all
void main(){
char uart_input[10], uar[10] = "0";
int entry = 1;
RC1PPS = 0x17;
CK1PPS = 0x16;
RC0PPS = 0x0D;
CKPPS = 0x0C;
TRISC7_bit = 1; // RX1 as input
TRISC6_bit = 0; // TX1 as output
UART1_Init(9600);
while(1){
if(UART1_Data_Ready() == 1 ){
UART1_Read_Text(uart_input,";", 9);
UART1_Write_Text(uart_input);
strcpy(uar, uart_input);
}
else{
UART1_Write_Text(uar);
}
}
}
Kumar