CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Receiving sms on wavecom modem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kkelis



Joined: 13 Dec 2006
Posts: 5

View user's profile Send private message

Receiving sms on wavecom modem
PostPosted: Tue Mar 06, 2007 11:45 am     Reply with quote

Hello everyone.
I know this topic has been discussed before but unfortunately i couldnt find a solution to my problem.
I am trying to interface a PIC18f452 to a wavecom WMOD2A gsm modem.
So far i was able to send sms and dial a number using a PIC. I also managed to receive sms using a terminal program however i was unable to receive the responses from the modem using the PIC.


Code:



#include <18F452>
#fuses HS,NOOSCSEN,NOPROTECT,NOBROWNOUT,NOWDT,NOSTVREN,NOLVP,PUT
#use delay(clock=8000000)
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, errors)
#include <input.c>
#include<string.h>
#include "lcd.c" 

#define MAX_BUFFER 20
char string[20];



#INT_RDA
void int_sra()
{
             output_high(pin_b3);
          get_string(string,MAX_BUFFER);
}


void main()
{


   lcd_init();   

       enable_interrupts(GLOBAL);
   enable_interrupts(INT_RDA);
   for(;;)
   {
      delay_ms(1000);
      output_high(pin_b4);

      printf("ATE0");
      putc(13);

      delay_ms(1000);

      printf("AT");
      putc(13);

      delay_ms(1000);
   output_low(pin_b4);
delay_ms(1000);

   printf(lcd_putc, "\fModem=%s",string);   
      delay_ms(10);
      output_low(pin_b3);      
      
 
      
     }
}



What i am trying to do here is to send "AT" to the modem and get the response "OK" on the LCD.I also have 2 LEDS blinking just to show the program is running. The program works ok when i send data from my terminal program. When i connect my development board to the modem i think it hangs up in the INT_RDA.
In the string the "OK" response is there as i can see using my ICD but i dont understand why the program hangs up. The modem sends the CR,LF characters at the end of each response so the program should exit int_rda right?

Thanks for your time and any help is really appreciated
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group