Discussion in "8051 Discussion Forum" started by    Alok Shah    Apr 2, 2008.
Wed Apr 09 2008, 06:08 pm
#11
below is the program i am using to send mesg with the GSM modem..but the problem is that the GSM does respond to the same...i have used max232 to convert the tx and rx outputs to rs 232 format...i can receive the same on the hyperterminal of my computer....can you please tell me wat cud be wrong...thanks

 $regfile = "89s8252.dat"
$crystal = 11059200
$baud = 9600

Print "AT";
Print Chr(13)

Print "AT+CSCA=" + 919892051914 ",145 ";
Print Chr(13)

Waitms 3000

Print "AT+CMGF=1";
Print Chr(13)
Waitms 3000

Print "AT+CSMP=17,168,0,0";
Print Chr(13)
Waitms 3000

Print "AT+CMGS=" + 919821048857 "";
Print Chr(13)

Print "hello";
Print Chr(13)
Print Chr(26)


[ Edited Wed Apr 09 2008, 10:01 pm ]
Wed Apr 09 2008, 09:51 pm
#12
do one thing. Connect your hardware to your pc and see are you getting everything correct or not.
Don't forget to add
print chr(10)
after sending character 13. But thats only while checking on pc.
Thu Apr 10 2008, 10:31 am
#13
wat does the chr(10) do?? apart from that i have tried that and i receive everything correctly in the hyperterminal except maybe the spaces in the between the '+' and the number following it.... shld i try to increase the delay for the modem to respond...
Thu Apr 10 2008, 10:04 pm
#14
actually the reason i told you to test on hyper terminal, i think the mobile number should also come inside double quotes. I'm not sure i'm correct but i want you to try out.
Sat Apr 12 2008, 02:45 pm
#15
i tried it with the hyperterminal...and you are right the mobile number also comes inside double qoutes....but even after making the changes..i am not able to communicate wid the modem using microcontroller....does the modem need any sort of hardware initialization...
Sun Apr 13 2008, 06:39 am
#16
You still send a lot of unwanted Carriage return and Line feed
waitms as a range of 1-255; use wait or waitmse if you need long delay
the program MUST terminate with end
At least the manual must be read.
Regards

'
$regfile = "89s8252.dat"
$crystal = 11059200
$baud = 9600

Print "AT";
Print Chr(13);
waitmse 3000

Print "AT+CSCA=" + 919892051914 ",145 ";
Print Chr(13);
Waitmse 3000

Print "AT+CMGF=1";
Print Chr(13);
Waitmse 3000

Print "AT+CSMP=17,168,0,0";
Print Chr(13);
Waitmse 3000

Print "AT+CMGS=" + 919821048857 "";
Print Chr(13);
waitmse 3000

Print "hello";
Print Chr(13);
Print Chr(26);
waitmse 3000

end
Sun Apr 13 2008, 09:17 am
#17
The above code wont work and i have tried a lot. I got code from the following website
www.8051projects.info its work fine
Sub Sendsms
Disable Serial
Set Scon.1
Print "AT+CMGS=" ; Chr(34) ; "+919821048857"  ; Chr(34)
Reset Scon.1
Enable Serial
Wait 2
Disable Serial
Set Scon.1
Print "Hello from Microcontroller" ; Chr(26) '26-->
"^Z"
Reset Scon.1
Enable Serial
End Sub


[ Edited Sun Apr 13 2008, 09:21 am ]
Mon Apr 14 2008, 06:34 am
#18
does the above code work fine with 89c52...does it need other AT commands like setting up of mesg center no etc...i am attaching the manual for my gsm module..can you please look at it and let me know...
how to connect the tx and rx pins of the uc to the db9 serial cable using max232...i have a sample circuit but not sure if this will work..and wat do i have to do abt the rts and cts pins on the connector...



[ Edited Mon Apr 14 2008, 03:10 pm ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

ChrisLub
Tue Apr 23 2024, 05:21 pm
Davidbab
Tue Apr 23 2024, 10:41 am
Richardrit
Tue Apr 23 2024, 09:54 am
HenryLaf
Mon Apr 22 2024, 03:50 pm
bleradrar
Mon Apr 22 2024, 06:38 am
ppu-pro_ka
Sun Apr 21 2024, 07:39 pm
Infewow
Sun Apr 21 2024, 06:30 pm
HumanTak
Sun Apr 21 2024, 12:26 pm