PDA

View Full Version : gsm modem and pic communication



shani_developer
- 1st September 2010, 20:22
hi everybody
i am my my project on gsm based controlling system
i have done simulation using proteus isis and it is working properly i have attached sony ericsson t290 ia can send and receive sms using simulation but when i made hardware it can only send but cant receive i use rsout and rsin commands for sending and receiving sms. but the problem is that the gsm phone not giviing any responce. i used 12mhz crystal and 9600 baud rate then i tested the hardware using hserin and hserout commands and test the circuit but still it is not giving any responce in hardware i used max 232 between pic and gsm modem.

Device 18F4520
DEFINE OSC 12


' Set transmit register to transmitter enabled
DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_SPBRG 77 '.16% error
DEFINE HSER_CLROERR 1
DEFINE HSER_BAUD 9600
SPBRG=77
TRISC=%10111111
BAUDCON.3=1


SMS: 'this is the SMS commands routine in order to send an SMS

HSerOut ["AT" ,13] 'set modem speed to 9600 baud

HSerIn 3000, SMS, [Wait("OK")]
Print At 1,1,"working" 'in order to test whther it is executing hserin command

but the phone still not responding
please solve this problem

Ioannis
- 7th September 2010, 09:21
As a first step I would recommend to study the AT commnads of the specific phone.

Maybe it needs something at the beginning to enter AT command mode.

Then, please, DO connect the phone to a PC directly and test it with a Terminal program.

After you feel confident with the phone then go for the micro controller connection.

At this stage you do not know what the phone sends as a response. Maybe instead of 'OK' sends a 0 (zero).

Ioannis