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.

[SOLVED] How to write AT-commands on an MCU?

Status
Not open for further replies.

seadolphine2000

Advanced Member level 3
Joined
Apr 12, 2005
Messages
880
Helped
122
Reputation
244
Reaction score
87
Trophy points
1,308
Activity points
7,372
at commands pic

Hi everyone,..

I know that this topic might be repeated but I'm really confused.
I have a NOKIA 6610 and I want to connect it with PIC16F877 via serial cable. My only problem is:
How to write the AT-commands in basic or C languages?

For example:
AT+CMGR=2 --> This command will read the sms stored in location 2.

I want to know how to translate this command into basic or C.?

Thanks very very much guys for your help and patience.
 

how to write at commands

If you are using C language for programming, Take a string
e.g.
unsigned char send_data[] = "AT+CMGR=2";

and send this on UART using SBUF, use any loop such as for loop.

and after sending this string you have to send CR
(carriage return ASCII CODE = 0x0d)

and you have to wait for response from modem.
 
where to write at commands

eamol,..
Thanks very much for your help. I have another question:
What is " SBUF "?

Thanks again for your time.
 

mcu and 6610

how do you do this in assembly?
does each AT - command has a ascii or binary equivalent?
:D
 
  • Like
Reactions: zia

    zia

    Points: 2
    Helpful Answer Positive Rating
sending at commands using mcu

This had been discussed many time here, try to use the search function and you will get many results.
 
  • Like
Reactions: shahd

    shahd

    Points: 2
    Helpful Answer Positive Rating
pic mcu atcommands

seadolphine2000 wrote:
How to write the AT-commands in basic or C languages?
if your C language stdio library has puts() and putchar() function, and those function are redirected to serial port, you can send AT command like that :
Code:
unsigned char send_data[] = "AT+CMGR=2"; 
    puts(send_data); 
    putchar(0x0D);

blastronics wrote :
does each AT - command has a ascii or binary equivalent?
AT command is an ASCII string, it is represented with ASCII code!
You can build that AT command like this :
Code:
ReadSMS DB 'AT+CMGR=2',0x0D

how do you do this in assembly?
Write a Serial Port charater output sub-routine, use it to output above ASCII string character by character, after 0x0D is printed stop the loop.
 
nokia 6610 at commands

Hello all,..

I have another question and hope you can help.

Can I send the command AT+CMGR=2 in ASCII?
I mean, can I send it character by character?
Example:
Soft_Uart_write(64)
Soft_Uart_write(84)
....
so on

where:
Soft_Uart_write is the command that sends the data serially.
64 is the ASCII code of A and 84 is the ASCII code of T.

Thanks very very much guys for all your help, I really appreciate that.
 

soft_uart_write

Yes you can do that. 64 and 'A' has same binary value : 01100100

if Soft_Uart_write() is an C function, Soft_Uart_write(64) and Soft_Uart_write('A') is the same!
 
mcu commands

at commands are string's

write them in strings

make a set of defines and a menu use some buttons to then send the strings

you simply make an array of command strings
DONT send char by char

instead dump the whole string
alternalty wire a keyboard upto the pic and an lcd then youll have a dumb terminal
 

at commands mcu

Hi seadolphine2000,

I use this C+ code to call to one number.
I using PIC16F877 and Siemens :

Code:
printf("AT");
delay_ms(500);
printf("D+359xxxxxxxxxL;");

"+359" is country code.
"xxxxxxxxxx" is number

Kuzito
 
  • Like
Reactions: gouday

    gouday

    Points: 2
    Helpful Answer Positive Rating
pic at commands

Guys,..
Thanks very much for your time and consideration up till now.

I have another problem which is when I connect the phone to the PC and start to send the command using the hyper terminal, I found that all what I typed didn't appear on the hyp trm screen.
I tried all the possible combinations of baud rate, flow control, ASCII settings,... but all gave the same result, Nothing appear.

A friend has 6210 and he tried connecting the phone to the hyp trm and succeeded, he told me that he had installed a driver for the phone cable.

The question is: What driver for the cable?
Do I need to write this driver on the MCU to connect the phone to the MCU?


Thanks very very much all of you.
 

at90s2313 nokia at command

I found that all what I typed didn't appear on the hyp trm screen.
Keep try type in AT <enter>, what is the answer from cell phone?
If the Cellphone answer OK, it mean every thing is OK. At this case you have to type in ATE1<enter>, after that every thing is going right
 

at commands for k750

i have siemens C55 cell phone,, the AT command work well while connected PC.
the data cable convert RS232 violatage level into TTL/CMOS, data cable have max232 circuit within the port. and it get power from DB-9 PC.

now problem is that if i connect the data cable with micro controller then how can i provide powere to it cause there is only 3 pins in MC (Tx,Rx and GRD),
and i dont know what voltage and from which pins of PC's DB-9 the data cable get the power.

once i connected direct C55 's TX,RX & grd with CELL phone the at commands workd but other day it doesn't work , some body told me that u must use MAX232 is to interface and use data cable.
 

schematic max232cpe mcu

data cable have max232 circuit within the port. and it get power from DB-9 PC.
i dont know what voltage and from which pins of PC's DB-9 the data cable get the power.
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)

50_1174089914.gif


But be careful that the following pins
pin 2 DB9 (RXD)
pin 3 DB9 (TXD)
has a RS232 Voltage level, that's >+5 Volt as logic level '0' and <-5 Volt as logic level '1', you can't connect this pin to micro controller's TXD pin and RXD pin directly, it may burn out that pins!

once i connected direct C55 's TX,RX & grd with CELL phone the at commands works but other day it doesn't work
Without the above voltage supplies, the data cable doesn't works!

some body told me that u must use MAX232 is to interface and use data cable.
Yes, its true!

Another connection is like this:
32_1173983545.gif
 

view screen siemen c55 with vb6

budhy,..
has a RS232 Voltage level, that's >+5 Volt as logic level '0' and <-5 Volt as logic level '1'
How to supply the Rx,Tx pins with -5 volts from the microcontroller?

Thanks very much guys for your concern.
 

at command pic

How to supply the Rx,Tx pins with -5 volts from the microcontroller?
Please note that <-5 Volt and >+5 Volt is the RS232 Voltage level (at DB-9 pins), it isn't micro controller pins. That voltage is supplied from IC MAX232!
 

sms controller using pic with ericsson t20

budhy,..
Thanks very much for all your help, but I'm really confused. According to this
Quote:
some body told me that u must use MAX232 is to interface and use data cable.

Yes, its true!

I have to use the MAX232, but according to this:

Quote:
PIC16F84A microcontroller and a Nokia 6210 cellphone. We will also use a Max232

mobile phones usually use inverted TTL RX/TX signals, so max232 is unnecessary

The MAX232 is unnecessary.

I'm really confused.
 

pakistani putchar

Don't confuse, kishorekhatri discuss about connect cellphone to microcontroller thru a dala cable, which has build in 3.8 Volt Logic to RS232 converter.
At this case he need a RS232 to 5 Volt logic converter on the microcontroleer board.

The picture I were attached illustrate direct connection without data cable, at this case max232 is unnecessary
 
program for sending sms on mcu

MR Budhy wat is ur Yahoo id ?
i wanna discuss u more about my project ...

thanks
 

how to write at commands

Hi
This is Prabakaran , can i have the connection between the Micro controller and Mobile Phone . Can u give the circuit diagram to connect the mobile phone with microcontoller to implement the functionality . This would be useful for my reference.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top