UART1_Read_Text() stop reading text data when I add delay or escape sequences

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
kumar123
Posts: 77
Joined: 17 Oct 2023 07:32

UART1_Read_Text() stop reading text data when I add delay or escape sequences

#1 Post by kumar123 » 03 May 2024 07:46

Hello IVAN,
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);   
        }
   }
}
Regards,
Kumar

Post Reply

Return to “mikroC PRO for PIC General”