Reply To: Retrieving UART data on LCD using PIC16F877A

Home Forums Microcontrollers PIC Microcontroller Retrieving UART data on LCD using PIC16F877A Reply To: Retrieving UART data on LCD using PIC16F877A

#11064

sandeep
Participant

Hi sir,

As i tried, code entering the loop only if the RCIF flag is raised,with below code, the code enters the loop, and the data from rcreg is transfered to an array(checked using led blinking),but as i tried to test the +CMTI format to check for the new messages,like in the  second part of code.but as soon as it receives a message the +cmti response must be send to the controller, i.e RCREG, but it is not happening.suggestions pls.

I am not sure, whether the +CMTI response is sent to controller or not. and my other doubt is whether the +CMTI response comes under the ECHO feature, because i have disabled the echo feature, will it be a reason for this??

while(!RCIF)
{
  RB2=1;                     //LED, which keeps blinking, loop working good.
  delay(2000);
  RB2=0;
  delay(2000);

  for(i=0;i<10;i++)
  {
    x[i]=RCREG;
  }

  if(x[0]=='+'|| x[1]=='+'||x[2]=='+'||x[3]=='+')     //+CMTI: "SM",1
  {
    RB1=1;                                 // testing this like x[0]!='+', then it works, so array is working good.
    delay(2000);
    RB1=0;
    delay(2000);
  }
  else continue;
}
string(7) "9898001"