Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Status
Not open for further replies.

ha_wasfy

Member level 1
Joined
Aug 26, 2006
Messages
33
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
1,572
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
 

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.
 

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
 
  • Like
Reactions: ghode

    ghode

    Points: 2
    Helpful Answer Positive Rating
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
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.

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
 

atcommand ericsson t20

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

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?
 

Can anyone help me or suggest something?
 

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.
 

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
 

Your problem very similar with this thread :
:arrow:#802399


the solution is in this thread :
:arrow:#802443


please mention the type of your Ericson cell phone
 

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"
 

in the 1st link you said that one has to connect some pins of cable to +9 v and -9 volt to work
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
50_1174089914.gif


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


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

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.
 

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
 

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
 

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.
 

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
 

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.
 

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.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top