PDA

View Full Version : send sms



anushka
- 18th January 2007, 11:36
hi
im a member of a group that is doing a project to send sms using 16f877 mcu. friends who have done similer projects can help us to succeed the project.give me ur ideas and support.

thank you.

sayzer
- 18th January 2007, 11:45
anushka,

There is a search box on this page.

Also, there are titles, and topics on the main page.

You start from there and see what you can collect.

Then you may post your questions to the posts you find; you will get our answers for your questions for sure.

But do a search first.

sjohansson
- 19th January 2007, 20:27
Hi.
Here is a piece of code I wrote for a Basic Stamp 2.
I hope it helps you to get started.

Regards
Stefan.



================================================== =======================
'
' File...... GsmN12i.BS2
' Purpose... Send SMS using a Nokia GSM-module
' Author.... Stefan Johansson
' E-mail.... xxxxxx
' Started... 2006-11-23
' Updated... 2006-11-23
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' ================================================== =======================


' -----[ Program Description ]---------------------------------------------

'
' Program send a SMS using a NOKIA N12i GSM-module.
'
'
' Ascii-codes:
' å = 134
' Å = 143
' ä = 132
' Ä = 142
' ö = 148
' Ö = 153
' Ctrl+Z = 26 (Used to send message.)
' ---------------------------


' -----[ I/O Definitions ]-------------------------------------------------
TX PIN 7 'N12i Pin 27
RX PIN 9 'N12i Pin 29

' -----[ Constants ]-------------------------------------------------------
T9600 CON 84

' -----[Mainprogram]------------------------------------------------------
PAUSE 1000

SEROUT TX,T9600,["AT",CR]
SERIN RX,T9600,[WAIT ("OK")]
DEBUG "Test communication ---OK", CR
PAUSE 1000

SEROUT TX,T9600,["AT+CMGF=1",CR]
SERIN RX,T9600,[WAIT ("OK")]
DEBUG "AT+CMGF=1 Set messagetype---OK", CR
PAUSE 1000

'SEROUT TX,T9600,[CR]
PAUSE 1000
SEROUT TX,T9600,["AT+CSCA=",34,43,"4670xxxxxxx",34,CR]
SERIN RX,T9600,[WAIT ("OK")]
DEBUG "AT+CSCA=","Set message central number: +4670xxxxxx ---OK", CR
PAUSE 1000

'SEROUT TX,T9600,["AT+CMGS=",34,"070xxxxxxx",34,CR]
SEROUT TX,T9600,["AT+CMGS=",34,"070xxxxxxx",34,CR]
DEBUG "AT+CMGS=","Telephone number: 070xxxxxxx ---OK", CR
PAUSE 1000

SEROUT TX,T9600,["This is a test message from a NOKIA N12i GSM-module" ,26]
DEBUG "Message Sent!!!", CR
PAUSE 5000

END