View previous topic :: View next topic |
Author |
Message |
zent_88
Joined: 18 Sep 2006 Posts: 10
|
Posted: Wed Sep 27, 2006 5:11 am Post subject: sms to control atmel 89c51 |
|
|
hi..does anyone familiar with this project ??i plan to write it in bascom 8051 ......i'm using t610(AT command) as GSM phone ..... |
|
Back to top |
|
|
Gianni
Joined: 09 Jul 2004 Posts: 61 Location: Italy
|
|
Back to top |
|
|
zent_88
Joined: 18 Sep 2006 Posts: 10
|
Posted: Thu Sep 28, 2006 3:30 am Post subject: |
|
|
thx for the link ......i am not very sure about the reading sms part ...:
' ////////////////Serial interrupt routine ////////////////
Dim Swrk As Byte
Dim Si As Byte
Dim Sj As Byte
Serial_interrupt_rtn:
Disable Serial
' we move all characters one place to the left (on LCD)
' and we put the newly read character at the end
Swrk = Inkey()
Scon.1 = 0
For Si = 1 To 15
Sj = Si + 1
Xx1(si) = Xx1(sj)
Next
Xx1(16) = Swrk
Enable Serial
Return
these is taken from http://www.mcselec.com/index.php?option=com_content&task=view&id=64&Itemid=57
before Inkey() , do we need to these:?
Print "AT"
Wait 5
Print Chr(13)
Print "AT+CMGF=0" ' set pdu mode
Print Chr (13)
Print "AT+CMGR=1" 'read sms in 1st location
Print Chr(13)
if possible ..can anyone post a code on turning on a LED when the phone send a "LEDON" to the gsm c35i module .....thx alot ..... |
|
Back to top |
|
|
Gianni
Joined: 09 Jul 2004 Posts: 61 Location: Italy
|
Posted: Thu Sep 28, 2006 1:19 pm Post subject: |
|
|
If your cell phone do not support sms text mode you have to convert the sms message from pdu format to text, then search the "LEDON" string in the message.
for example
dim Tmp1 as byte
dim TmpString as xram string * 8
dim SMStextString xram as string * 120
Myled alias P1.0
TmpString = "LEDON"
Tmp1 = instr(SMStextString,TmpString)
if Tmp1 > 0 then
Myled = 0
else
Myled = 1
endif
Regards |
|
Back to top |
|
|
zent_88
Joined: 18 Sep 2006 Posts: 10
|
Posted: Thu Sep 28, 2006 2:51 pm Post subject: |
|
|
huh....we don't need to use inkey() command to retreive the sms from the GSM module??
how about the below command ???
Print "AT"
Wait 5
Print Chr(13)
Print "AT+CMGF=0" ' set pdu mode
Print Chr (13)
Print "AT+CMGR=1" 'read sms in 1st location
Print Chr(13) |
|
Back to top |
|
|
Gianni
Joined: 09 Jul 2004 Posts: 61 Location: Italy
|
Posted: Fri Sep 29, 2006 11:56 am Post subject: |
|
|
Quote: | huh....we don't need to use inkey() command to retreive the sms from the GSM module?? |
if you use a serial interrupt routine the received data will be put in the serial buffer and retrieved from the buffer.
Quote: | how about the below command ???
Print "AT"
Wait 5
Print Chr(13)
Print "AT+CMGF=0" ' set pdu mode
Print Chr (13)
Print "AT+CMGR=1" 'read sms in 1st location
Print Chr(13)
|
Perhaps read the "AT command set reference manual for the siemens mobile phones" may be usefull
Regards |
|
Back to top |
|
|
|