Hi friends,

I am trying to prepare a common project for checking and controlling some stuff in my village house; Sensor -> Pic -> Mobile Phone and Mobile Phone -> Pic -> Actuator by using SMS.

But already I spent a considerable time and still I could not succeed. In fact I already checked the forum, but unfortunately still could not succeed.

And as a general information;
Mobile phone is T630 sony ericsson, which supports txt mode.
I use 16F877 (20/P), MAX232, 4 MHz Crystal,
I use pic basic pro,

Below I put some info about my latest situation:

(1) I can communicate between pic to hyper terminal and hyper terminal to pic without problem.
I used a USB1.1 to RS232 converter cable, because I don’t have serial port on my notebook.
Schematic is as shown:

PBP code is as shown:
' Initialization
TRISB=%00000000
PORTB=%00000000

'Definitions
DEFINE OSC 4
DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 2400
DEFINE HSER_SPBRG 25

BEGIN:
PORTB = 0
HIGH PORTB.7
PAUSE 1000
LOW PORTB.7
HIGH PORTB.6
HSerout ["AT",13,10] 'TEST COMMUNICATION
HSERIN 5000,begin,[WAIT("OK")]
HIGH PORTB.5
PAUSE 500
GOTO begin

'END
End

Hyper Terminal Settings are as below:
Bits per second:2400 / Data Bits:8 / Parity : None / Stop Bits:1 / Flow Control :None

Both simulation and real test are succeeded;
(2) I can communicate between pc to mobile and mobile to pc without problem. Below you can see some of commands and answers.
Again I used a USB1.1 to RS232 converter cable.

AT
OK
AT+CMGF=?
+CMGF: (0,1)

OK
AT+CMGF=1
OK
AT+CMGS="0XXXXXXXXXX",129 ‘ ”0XXXXXXXXXX” – TEL NO ‘
> "SELAM DENEME MESAJIDIR"
+CMGS: 0

OK

(3) Test Communication between pic and mobile phone,

The same
- pic basic pro program same as above,
- 16f877, 4Mhz, 2400 8-N-1 baud rates.
- the same connections as:
RS232 pins 1-4-6 interconnected, pins 7 and 8 interconnected, pin 5 earth,
RS232 pin2(RX) to leg7(T2OUT) of max232
RS232 pin3(TX) to leg8(R2IN) of max232
PIC RC6/TX to leg10(T2IN) of max232
PIC RC7/RX to leg9(R2OUT) of max232

But this time I can not see the 3rd led, wait 5 seconds and return back to loop.
This is where I stop, My biggest concerns are :
- baud rate,
- crystal 4Mhz may be not enough,

May I have you kind suggestions?

Most probably one these main problems i have:
- maybe pic can not receive "OK" message from mobile phone
- maybe mobile phone can not receive "AT" command from the pic