Skip to main content
edited tags
Link
Bence Kaulics
  • 6.4k
  • 12
  • 35
  • 60
added 90 characters in body
Source Link
S Andrew
  • 621
  • 12
  • 29

I am using PIC18F2520 and trying to communicate with GSM SIM900. I am using UART interrupt to receive data from the GSM. I am saving each byte in rxData. Now most of the commands ends with response OK. But there are few commands which does not respond with OK like when we receive sms notification from GSM, GSM send following notification

 +CMTI: "SM",2

Now this response doesn't have any OK. How to receive data in this case. In my application I need to check for the received sms. I am using following code:

void rx_handler(void)
{
  rxData[index] = ReadUSART();

  if(<some condition>)    //condition to check for sms notification
  {
    rxFlag = 1;        //set flag to process it in main loop
    
  }
  index++;

PIR1bits.RCIF==0;

}

I am getting confused on how to check for the sms notification. Till now for other commands, I was setting condition for OK but this doesnt have any OK response. Please help.

enter image description here

I am using PIC18F2520 and trying to communicate with GSM SIM900. I am using UART interrupt to receive data from the GSM. I am saving each byte in rxData. Now most of the commands ends with response OK. But there are few commands which does not respond with OK like when we receive sms notification from GSM, GSM send following notification

 +CMTI: "SM",2

Now this response doesn't have any OK. How to receive data in this case. In my application I need to check for the received sms. I am using following code:

void rx_handler(void)
{
  rxData[index] = ReadUSART();

  if(<some condition>)    //condition to check for sms notification
  {
    rxFlag = 1;        //set flag to process it in main loop
    
  }
  index++;

PIR1bits.RCIF==0;

}

I am getting confused on how to check for the sms notification. Till now for other commands, I was setting condition for OK but this doesnt have any OK response. Please help.

I am using PIC18F2520 and trying to communicate with GSM SIM900. I am using UART interrupt to receive data from the GSM. I am saving each byte in rxData. Now most of the commands ends with response OK. But there are few commands which does not respond with OK like when we receive sms notification from GSM, GSM send following notification

 +CMTI: "SM",2

Now this response doesn't have any OK. How to receive data in this case. In my application I need to check for the received sms. I am using following code:

void rx_handler(void)
{
  rxData[index] = ReadUSART();

  if(<some condition>)    //condition to check for sms notification
  {
    rxFlag = 1;        //set flag to process it in main loop
    
  }
  index++;

PIR1bits.RCIF==0;

}

I am getting confused on how to check for the sms notification. Till now for other commands, I was setting condition for OK but this doesnt have any OK response. Please help.

enter image description here

Source Link
S Andrew
  • 621
  • 12
  • 29

What is the best way to receive unsolicited response from GSM SIM900 in PIC18

I am using PIC18F2520 and trying to communicate with GSM SIM900. I am using UART interrupt to receive data from the GSM. I am saving each byte in rxData. Now most of the commands ends with response OK. But there are few commands which does not respond with OK like when we receive sms notification from GSM, GSM send following notification

 +CMTI: "SM",2

Now this response doesn't have any OK. How to receive data in this case. In my application I need to check for the received sms. I am using following code:

void rx_handler(void)
{
  rxData[index] = ReadUSART();

  if(<some condition>)    //condition to check for sms notification
  {
    rxFlag = 1;        //set flag to process it in main loop
    
  }
  index++;

PIR1bits.RCIF==0;

}

I am getting confused on how to check for the sms notification. Till now for other commands, I was setting condition for OK but this doesnt have any OK response. Please help.