electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

I need just a small help in AT Commands of sending sms


Goto page 1, 2  Next
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> I need just a small help in AT Commands of sending sms
Author Message
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post11 Mar 2007 9:05   

ericsson t20 at commands


Dear all,
i am working in project depending on sending SMS via mobile Erixon and Atmel "AT89S52".
i wrote the assembly language due to that purpose,but i want to know just a little thing which confuse me, when we deal with (AT+CMGS) and (AT+CSCA) ,what is the the sms center telphon number and the sender number format?
i mean do i have to enter the full number including my country code??
i.e. i am in Egypt it's area code is (+2)
so do i have to type:
(AT+CSCA="+20122000020" ) as sms center telephon number?
(AT+CMGS="+20104029801") as the destination telphon number?

If so,i mean if the area code is really needed, is it ok to send (+) or it's better to send (00)?

Thanks alot in advance
and i am sorry if my questions are of a beginer,as i am a beginner
Back to top
ARoque



Joined: 02 Nov 2006
Posts: 23


Post13 Mar 2007 7:08   

ericsson t20 interfacing microcontroller


First I sugest you try with the Hyperterminal from windows, itīs easy to test.

I think you have to put the full number only when you are configure the sms center on the mobile phone.

Regards.
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post13 Mar 2007 23:26   

facsimile hyperterminal


thank you,so is it important then to assign the sms center number? or i can bypass this step and send?


i made a small program to test the dialing and i got no response from mobile,although i got 5v on pin 10 and pin 11 (RX,TX)
i don't know what to do if u have any ideas i appreciate.
thanks
N.B.
here is the small code:
do i have to send the ascii code of enter in the last(0DH) or it's just the semicolon( ; )?



ORG 0000H ;Power up
MAIN:

MOV TMOD,#20H ;Timer 1 in mode 2
MOV TH1,#-3 ;9600 baud rate
SETB TR1 ;Start timer 1
MOV SCON,#50H ;8-bit, 1 stop bit, REN enabled
DIAL:
MOV A,#'A'
ACALL SEND

MOV A,#'T'
ACALL SEND

MOV A,#'D'
ACALL SEND

MOV A,#'0'
ACALL SEND

MOV A,#'1'
ACALL SEND

MOV A,#'2'
ACALL SEND

MOV A,#'7'
ACALL SEND

MOV A,#'0'
ACALL SEND

MOV A,#'5'
ACALL SEND

MOV A,#'6'
ACALL SEND

MOV A,#'1'
ACALL SEND

MOV A,#'4'
ACALL SEND

MOV A,#'4'
ACALL SEND

MOV A,#';'
ACALL SEND


SEND: MOV SBUF, A ;Load the data
HERE: JNB TI, HERE ;Stay until last bit sent
CLR TI ;Get ready for next character
RET

RECV: JNB RI, RECV ;Wait for character
MOV A, SBUF ;Save it in accumulator
CLR RI
RET

END
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post14 Mar 2007 8:04   

j210i at commands


This is your modified code, try it again.
Code:
     ORG 0000H ;Power up
MAIN:
     MOV   TMOD,#20H    ;Timer 1 in mode 2
     MOV   TH1,#-3      ;9600 baud rate
     SETB  TR1          ;Start timer 1
     MOV   SCON,#53H    ;8-bit, 1 stop bit, REN enabled
DIAL:
     MOV   DPTR,#PhoneNum
     ACALL SendString
HangUp:
     SJMP  HangUp

PhoneNum:
     DB   'ATD 0127056144;',0Dh,00h

SendIt:
     ACALL Send
SendString:
     CLR   A
     MOVC  A,@A+DPTR
     INC   DPTR
     JNZ   SendIt
     RET

SEND:
     MOV   SBUF,A  ;Load the data
HERE:
     JNB   TI,HERE ;Stay until last bit sent
     CLR   TI      ;Get ready for next character
     RET

     END

Quote:
so is it important then to assign the sms center number? or i can bypass this step and send?

You only need to set the SMS Center number once, and you can do it from your cell phone keypad.

Quote:
i made a small program to test the dialing and i got no response from mobile,although i got 5v on pin 10 and pin 11 (RX,TX)

Are you direct connect you cell phone to your microcontroller? Be carefull there is a different voltage between microcontroller dan cell phone, you may burn you cell phone out if you direct connect them!
Please send your connection diagram
Back to top
itsfanidotcom



Joined: 09 Mar 2007
Posts: 98
Helped: 3


Post14 Mar 2007 9:10   

atcommand ericsson t20


Hi there i wanna know if possible to order free samples of AT89C51 Microcontroller.....
thanks in advance.
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post14 Mar 2007 22:22   

I need just a small help in AT Commands of sending sms


thanks alot for your code but i still have problems

HangUp:
SJMP HangUp

why we use this loop? isn't it infinite loop? so i guess the program will held on this step?!
i tried it but i obtained 0v and 0v on TX,RX of microcontroller,

MOV SCON,#53H ;8-bit, 1 stop bit, REN enabled

why we use REN enabled?

about the connection i use two connections,one with a cut cable and directly connected to atmel chip
and second is with full cable connected through converter max232

so what do you suggest?
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post16 Mar 2007 14:07   

I need just a small help in AT Commands of sending sms


Can anyone help me or suggest something?
Back to top
BeTZ



Joined: 16 Mar 2007
Posts: 29
Helped: 1


Post16 Mar 2007 15:32   

I need just a small help in AT Commands of sending sms


i think you can trace the program from the beginning, MAIN is used for initialized UART (which REN enable is used for received interrupt UART), after that you dial your number destination ("ATD" "number destination"),
the SendString procedures is used for Transmite your AT command through UART per char. It will remain send data till your pointer (@DPTR) find 00h (JNZ sendIt). "SJMP HangUp" is the superloop program in asm. your program will remain in that loop and it wiil jump in elsewhere when it's interrupted. We used to used superloop in microcontroler programming.

i hope it's useful

Added after 14 minutes:

about the connection, usually your mobile phone used around 3-4 V level voltage. If you try to connect your microcontroler directly through your phone, it won't work, try to used voltage divider (Tx in microcontroller is 5V). Another way to connect your phone and your microcontroller is used max 232 level converter (+12V for low logic and -12V for high logic). your cable data is using max 232 and you should convert your microcontroler level voltage
using max 232.
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post16 Mar 2007 17:17   

I need just a small help in AT Commands of sending sms


Thank you Betz,but as i told you i use 2 circuits one with cable and coressponding max232 converter to convert the level of the microcontroller,
and second circuit with a cut cable and no max232

i used those 2 circuits and no results happened
about your hint voltage devider,ididn't got you,if you could explain what do you mean i'd be glad
as i know the level of micro controller is like the level of mobile voltage so why do we use the voltage devider that you talk about?


Ahh bytheway when i measure voltage on tx and rx of microcontroller i obtain logic 1 "in case of cut cable with no max232"
but when using cable and converter max232 i obtainon microcontroller trminals logic 1 and on the mobile i got weak -ve voltage"-3v to -1v" on rx of mobile<i suppose to get -12v or arround,am i right?" and no voltage at all on the tx of the mobile 0v



Thanks in advance,
i hope you you can help me or suggest any new ideas


Last edited by ha_wasfy on 16 Mar 2007 17:26; edited 1 time in total
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post16 Mar 2007 17:25   

Re: I need just a small help in AT Commands of sending sms


Your problem very similar with this thread :
Arrowhttp://www.edaboard.com/ftopic231740.html#802399


the solution is in this thread :
Arrowhttp://www.edaboard.com/ftopic231740.html#802443


please mention the type of your Ericson cell phone
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post16 Mar 2007 17:35   

I need just a small help in AT Commands of sending sms


Mr Budhy
in the 1st link you said that one has to connect some pins of cable to +9v and -9volt to work
i didn't connect them as i don't know all i did waspin2,3,5 only,do you think that this maybe the problem i face? i mean that the cable is not working for that reason?
thanks in advance

I use Sony Ericsson T290 and atmel"AT98S52"
Back to top
budhy



Joined: 21 Oct 2006
Posts: 836
Helped: 185
Location: Indonesia


Post16 Mar 2007 19:02   

Re: I need just a small help in AT Commands of sending sms


Quote:
in the 1st link you said that one has to connect some pins of cable to +9 v and -9 volt to work

Quote:
You have to supply these voltage to DB-9 connector
pin 7 DB9 (RTS) -9 Volt
pin 4 DB9 (DTR) +9 Volt
pin 5 DB9 (GND)

This is the connection diagram
I need just a small help in AT Commands of sending sms

Quote:
i didn't connect them as i don't know all i did waspin2,3,5 only,do you think that this maybe the problem i face? i mean that the cable is not working for that reason?

Yes


Exclamation+9 Volt and - 9 Volt are voltage source for the circuit inside the data cable


Last edited by budhy on 17 Mar 2007 1:06; edited 1 time in total
Back to top
daviddlc



Joined: 11 Feb 2007
Posts: 196
Helped: 13


Post16 Mar 2007 19:51   

Re: I need just a small help in AT Commands of sending sms


You need to check if you are using an extension cable or serial comm. cable.

At the end you just need to make sure you are connecting the TX on the microcontroller side (after the MAX 232) to the RX on the other device , and the RX on the MAX 232 to the TX on the other device.

As I can see in the schematic you have TX to TX and RX to RX, but again don't know what type of cable you are using.
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post16 Mar 2007 21:35   

I need just a small help in AT Commands of sending sms


thanks for schematic,but i have a question,why do u connect TX with TX and RX with RX ? i guess that we have to connect RX with TX and viceversa

is it a misstyping or do u have a certain reason for that?

and there is another something i guessed i had to get external source to get +9v and -9v,but as i see you are using the max232 instead of that,so is it possible?

sorry excuse me as i am not very professional so my qustions maybe dummy to you,


thanks in advance

Added after 1 hours 27 minutes:

Mr Budhy,
i did as your drawings but with TX>RX and RX>TX
but nothing happened no call or indication to call happened
i measured voltage it's 5v on microcontroller TX and RX but very low on the after max,the only thing that i noticed is that the phone started charging optmization as it happens during connecting it to pc and hyper terminal so i guess the cable is working but it maybe has problems with assembly program can you give me a simple program to even do a call,a program you trust and tested as i want to make sure from where the problem is.

Thanks in advance
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post17 Mar 2007 13:20   

I need just a small help in AT Commands of sending sms


for dial( ATD"tel number"; )
do i have to send 0DH as enter key? or no?
i tried without using 0DH but not working


here is the code with odh i tried it again but not working,i mean no dial happens
ORG 0000H ;Power up
MAIN:



MOV TMOD,#20H ;Timer 1 in mode 2
MOV TH1,#-3 ;9600 baud rate
SETB TR1 ;Start timer 1
MOV SCON,#50H ;8-bit, 1 stop bit, REN enabled
DIAL:
MOV A,#'A'
ACALL SEND

MOV A,#'T'
ACALL SEND

MOV A,#'D'
ACALL SEND

MOV A,#'0'
ACALL SEND

MOV A,#'1'
ACALL SEND

MOV A,#'2'
ACALL SEND

MOV A,#'7'
ACALL SEND

MOV A,#'0'
ACALL SEND

MOV A,#'5'
ACALL SEND

MOV A,#'6'
ACALL SEND

MOV A,#'1'
ACALL SEND

MOV A,#'4'
ACALL SEND

MOV A,#'4'
ACALL SEND

MOV A,#';'
ACALL SEND

MOV A,#0DH
ACALL SEND

SEND: MOV SBUF, A ;Load the data
HERE: JNB TI, HERE ;Stay until last bit sent
CLR TI ;Get ready for next character
RET

RECV: JNB RI, RECV ;Wait for character
MOV A, SBUF ;Save it in accumulator
CLR RI
RET

END




Even i tried your modified code,,nothig dialed
i measure the voltage on TX and RX of both mobile and microcontroller i obtain logic "1" although after the max232 it's very very low voltage"-0.67v,0.04 v"
about your modified code i don't understand why u use 53 instead 50 in the line:


MOV SCON,#53H ;8-bit, 1 stop bit, REN enabled

i hope you kindly replay me
thanks in advance
Back to top
BeTZ



Joined: 16 Mar 2007
Posts: 29
Helped: 1


Post17 Mar 2007 15:40   

Re: I need just a small help in AT Commands of sending sms


you can try to connect your phone with PC through cable data (com). And then open hyperterminal.

Use hyperterminal to send your AT Command. first send "AT <enter>" if your phone replies "OK", that means your phone and your PC is connected. If it replies "ERROR" may be your baud rate is wrong. And when it is connected you can type your AT Command.After you know that your AT Command is right, you can program your uC. You should 0dh (enter) to end that command (ATD)

For your connection between S52 and T290, one thing you should know is your phone cable interface. In your phone cable (COM not USB), it usually use RS-232 level converter. Because it is used to connecting your PC (RS-232, COM Port) and cell phone. You should find schematic of your phone cable.
If you prefer not to use phone cable, you can connect your phone directly to your S52 but be care full, you must concern about your phone I/O voltage. If your phone level voltage is 0-5V, you can connect it directly to your S52 but if it's below that, you should lower your Tx (S52) voltage.
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post17 Mar 2007 16:59   

I need just a small help in AT Commands of sending sms


Mr Betz,i've tested this phone in hyper terminal before i deal with microcontroller,and it works for PC.
about the connection,yes i use a max232 on my circuit to convert the voltage level <as i know that there's a converter too in the cable>and as Mr Budhy<thanks to him> told me to connect pin7 and pin4 to -9v and +9v respectvly to make the cable circuit work.



and i wrote the assembly program as i explained with 0dh and without
but no response from the phone
and i have a question
for SCON register:

MOV SCON,#53H ;8-bit, 1 stop bit, REN enabled ?
or
MOV SCON,#50H ;8-bit, 1 stop bit, REN enabled ?

and why?
Thanks in advance
Back to top
BeTZ



Joined: 16 Mar 2007
Posts: 29
Helped: 1


Post18 Mar 2007 6:28   

I need just a small help in AT Commands of sending sms


have you set interrupt enable (in this case Serial & Global Interrupt)?

EA reset value for S52 is 0x00 0000 b.
EA is global interrupt Enabled/disabled
ES is Serial Interrupt Enabled/disabled


but you don't have to using interrupt for transmit, may be interrupt is useful when you receive data.
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post19 Mar 2007 8:38   

I need just a small help in AT Commands of sending sms


thank you
I have another question,someone told me that every character i send using microcontroller i must wait till receiving it's echo before sending the next character"means the same character but as a response from the mobile" i.e. send"A" wait to recieve "A" in order to send the next character "T" and so on...
and someone else told me the same idea but with out the echo as he said each letter i send i must receive "ok" from the phone to send the next character.
Which idea is true? or both are not?

I hope someone shares his ideas with me.
Thanks in advance.
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post19 Mar 2007 21:25   

I need just a small help in AT Commands of sending sms


nothing new?!
Back to top
ric_vas



Joined: 30 Jun 2005
Posts: 66
Helped: 3


Post20 Mar 2007 1:43   

Re: I need just a small help in AT Commands of sending sms


As far as I know you don't need to wait for echo before sending any character...you can even disable phone echo with ATE0 command. You will only receive an "OK" answer after sending a complete command (which must be finished with CR LF pair). If the command is not recognized you will get nothing or an error message.

Ric
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post20 Mar 2007 18:01   

Re: I need just a small help in AT Commands of sending sms


ric_vas wrote:
As far as I know you don't need to wait for echo before sending any character...you can even disable phone echo with ATE0 command. You will only receive an "OK" answer after sending a complete command (which must be finished with CR LF pair). If the command is not recognized you will get nothing or an error message.

Ric


can you explain it more please? what CR LF Pair?
Say i want to dial so what do i have to send?
ATD0127056144;
so how do i finish with that CR LF?

Thanks in advance
Back to top
ric_vas



Joined: 30 Jun 2005
Posts: 66
Helped: 3


Post20 Mar 2007 18:36   

Re: I need just a small help in AT Commands of sending sms


These are characters you have to send after each command. Their meaning are:

CR = carriage return (hex value 0x0D)
LF = Line feed (hex value 0x0A)

If you were programming in C the command you mention would be:

printf("ATD0127056144;\r\n");

The \r\n in C is the CR LF pair. If you are using Assembly just send 0x0D and 0x0A (this is equivalent to the ENTER key when you're using HyperTerminal).

Ric
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post20 Mar 2007 19:49   

I need just a small help in AT Commands of sending sms


Mr Ric
Thanks alot for your help.I am using assembly language of Atmel "AT89S52",and i was sending only 0DH without 0A.
So as i think you suggest me to do as follows:
1)sending ATE0 followed by 0DH then 0AH.
2)sending ATD0127056144; followed by 0DH then 0AH.
am i right then?
if not just tell me the correct assembly code from your point of view to do the dial.

Just a small note:i thought that i have to send 0DH only as the return key ascii code,so you say both"0DH" and "0AH" are required as the equivalent of "return key" of the keyboard,right?
and if so does it mean that each AT Command must be followed by them i mean by 0DH and 0AH?
Is the order important,0DH then 0AH or no?
Thanks alot.
Back to top
Google
AdSense
Google Adsense




Post20 Mar 2007 19:49   

Ads




Back to top
ric_vas



Joined: 30 Jun 2005
Posts: 66
Helped: 3


Post20 Mar 2007 19:59   

Re: I need just a small help in AT Commands of sending sms


To be honest with you I'm not a 100% sure if you need both. I've using this for a while and endup geeting used to send the pair. As per my experience you example are fine.

Ruc
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post20 Mar 2007 20:30   

I need just a small help in AT Commands of sending sms


thank you
so do you really made the interface between a mobile phone and micro controller atmel?
if so i'd like you to share me your experience please as i really tried alot and faced problems in hardware and in assemply code,but i still trying


thanks
if so ,i mean if you made the interface i'd like you to give me your e-mail if you don't mind so we can share thoughts
thanks
Back to top
ric_vas



Joined: 30 Jun 2005
Posts: 66
Helped: 3


Post20 Mar 2007 20:38   

Re: I need just a small help in AT Commands of sending sms


No. I didn't play with Atmel this time and it was not a mobile phone but a mobile module (like siemens MC35i). The AT protocol is pretty much the same and that's where I can try to help you.

Ric
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post20 Mar 2007 20:44   

I need just a small help in AT Commands of sending sms


Thank you alot
so i guess i'll try your recommends on code and see what happen
Back to top
cropty



Joined: 14 Mar 2007
Posts: 3


Post23 Mar 2007 6:47   

in need of serious help in sendin an sms


serious help needed in tryin to send an sms usin p89c51rd2.. .am interfacin a j210i sony ericsson make to it.i aint sure if this phone is at command compatible.
can someone post the assembly language code for the same.
plz plz plz.submission in 10 days!
Back to top
ha_wasfy



Joined: 26 Aug 2006
Posts: 36
Helped: 1


Post23 Mar 2007 13:39   

I need just a small help in AT Commands of sending sms


Now i have to pause my project as we are having exams by now.so i'll resume it after exams and tell you what is habbening,and thank you alot for your help and i hope it really works.
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> I need just a small help in AT Commands of sending sms
Page 1 of 2 All times are GMT + 1 Hour
Goto page 1, 2  Next
Similar topics:
sending, receiving, comparing SMS through AT commands (26)
nokia 3310 sms sending using z8encore microcontroller(HELP!) (1)
Sending and receiving AT commands on 89c2051 (2)
SIM300S_V6.01 - problem with sending AT commands (3)
Sending Commands to Keyboard from PIC 18F452 (1)
sending SMS coding (1)
Sending Bulk SMS (4)
Sending SMS from 8051 (6)
sending sms via internet (4)
Sending larger files by SMS (14)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS