Send At Commands To Mobile Phone

jmancallosa

New Member
Hello,

I need to send AT commands to a mobile phone. The reason is that I want to send a sms using Picaxe.
The problem I have is that my mobile phone works in 9600 bps. If I send the commands directly using the hyperterminal with that rate everything goes OK.

The commands are:
sertxd("AT+CMGF=0")
sertxd(13)
sertxd("AT+CMGS=22")
sertxd(13)
sertxd("Here I write the PDU STRING with the message I want to send")
sertxd(26)

Do I have to use sertxd(10) after sertxd(13)??

Ehen I use Picaxe it doesn´t work. I have Picaxe 28X. I think this works with 4800 bps.
Do I have to increase the Clock Speed? How can I do it?

Am I doing something that is not correct?
How can I do what I want?

Thanks a lot and sorry for my poor english!!
 

manuka

Senior Member
SERTXD is used to output 4800bps serial data back up the programming cable for F8 display of course, so just clock doubling a normal 4MHz PICAXE (to 8MHz) will give sertxd output at 9600bps. Easy! Even 4MHz PICAXE-08Ms handle this-just use the following commands.

SETFREQ M8 ' Sets 8MHz operation
SETFREQ M4 ' Sets 4MHz operation

These can be mixed at will within a program- much like changing gears in a car- although a brief settling time (~millisecs) may need considering before you rev. up again.

Do I have to use sertxd(10) after sertxd(13)?? Just what effect are you after? These quaint ASCII control codes give a new line feed(LF=10) & carriage return(CR=13). In general both are used, so a fresh text display will be positioned back at the screen LHS & one line down. It's quite normal to use diverse ASCII code tweaks in an attempt to get just the display effect you want.
 
Last edited:

Technical

Technical Support
Staff member
The 28X can only run at twice speed if you use an external 8MHz resonator.
If you used a 28X1 instead you can use the setfreq commands. If the phone works without the 10 after 13 then don't use it, it depends on the phone!
 

jmancallosa

New Member
Thank you for your help!

Today I´ve been trying some things. I´ve built a null modem cable to connect PICAXE with my cellular phone. Both have female connectors. For this reason I´ve built the null modem cable.

My problem is that if I connect this to PICAXE and then to my computer and I open hyperterminal, everything is OK.
But If I connect my cellular to the null modem cable and then to the computer, then hyperterminal doesn´t recognize the cellular modem. If I connect the cellular directly without the use of null modem then it recognize.
What do you think the problem is?

Thank you,
Jose
 

hippy

Technical Support
Staff member
There isn't a problem, it's just that the PICAXE-to-phone connection is different to the PC-to-phone connection, one wants a null-modem ( ie cross-over cable ), the other is simply wired straight-through.
 

jmancallosa

New Member
Hi Hippy!

Picaxe-to-Phone connection wants a null-modem (cross-over cable). I´ve done it but nothing happens when I try to send the commands from picaxe to phone.

I´ve been thinking that maybe the problem is the control wires (i.e. RTS, CTS, ...). Picaxe doesn´t have these lines and I think the phone need them. Do you think that´s the problem? I´m trying now to emulate these lines in phone connection crossing some lines.

What do you think about this? And how could I do it?

Thank you very much,
Jose Manuel
 

MPep

Senior Member
You should also find out if your cellphone can accept the SMS message in ASCII, rather than PDU mode.

Have only briefly looked into it, but PDU mode (which is accepted by ALL cellphones) uses 7bit encoding. Rather difficult to do on a PICAXE.
Only some cellphones accept ASCII.
 
Top