Unable to receive response from SIM900

I am trying to communicate to SIM900 with PIC18F2520. I am able to send AT commands using UART but I also want to receive its response like OK or ERROR.

Following is the code for RX interrupt

#pragma code rx_interrupt = 0x8 void rx_int(void) {   _asm goto rx_handler _endasm } #pragma code #pragma interrupt rx_handler void rx_handler(void) {   while (!DataRdyUSART());   //if data is ready to receive   for(k=0;k<=20;k++)   {      Rx[k] = getcUSART();    //read a byte from UART    }   UARTSend("We have read everything");   //I have a put a breakpoint here   if(strstr(Rx,"OK") != NULL)   {     UARTSend("OK received"\n);   }     PIR1bits.RCIF = 0;   //Clear the interrupt flag   } 

Above is the code I am using for receiving data from SIM900. In the debug mode, I send UARTSend("AT\r");. I have a put a breakpoint at UARTSend("We have read everything");. At this line, I check for the Rx buffer in variable but it doesnt have OK instead it has few random chars while on the terminal I am getting proper response.

Unable to receive response from SIM900

So how to read response from SIM900. The approach I am using it correct or not.Please help.

Replay

Category: pic Time: 2016-07-30 Views: 0
Tags: pic sim900

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.214 (s). 12 q(s)