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.
mokhoo said:
i have some questions about the same subject

1)how to make the communication with a usb phone( eg sony ericsson k750)
i can control it using hyper terminal and matlab(but this is only valid after driver installation)

2)can i use pic 18F4550 which is usb compatible, if so, how to connect?
i mean is it direct connection of the usb port in the microcontroller to the usb cable of the phone and direct send of data

3)what is exactly the 'serial to usb' cable function?can i use it to make a serial connection to the usb phone??


thanks in advance

please reply

Greetings
Some answers, without anesthesia:

1) The phone is not usb, the cable is. The cable is a serial to usb interface. The driver is just for interface windows with the usb-serial chip on cable. Without this chip driver, you cant receive/transmit data from/to phone.

2) The 18F4550 is not a usb HOST, is just a usb DEVICE. So, you CANT connect any USB DEVICE to this pic. Search on microchip site, there are some new 32 bit uC with usb host feature.

3) If you want to, yes, you can do everything you want. The cable function is in the cable name "serial to usb" and vice versa. read/write rx/tx phone serial pins and get/put data on usb... that's all.

Good luck!
 

Hi All!

My question is that on budhy's second circuit (https://obrazki.elektroda.pl/32_1173983545.gif) there aren't RTS and DTR lines, but on the other versions contain RTS and DTR. If I want to use Siemens MT50 am I had to connect these lines?

My second question is: what is the communicatin speed (between the MT50 and the uC)? 9600bps? And what is the frame format? 8N1?
 

hi
i want to ask about how to connect a serial port to a modem ,
i have a project and i will use a modem to send a message to a phone using H6221-CGH GPRS modem.

the problem is that i did what the company told me about installing the modem but how can i test the modem in sending messages to a phone.

oh! i have a lot of ques. how can i write AT commands to test the modem
is there any software to do that??!

in the project i use PIC16f877a what conections i need with the modem ?

thanks for whom answer?

moeen-jordan
 

can u give me program to interface nokia 6070 with microcontroller

Added after 4 minutes:

i am interfacing Mobile(nokia 6070) with P89v51rd2bn via serial port using AT commands.Plz help me as early as posible
plz............
 

Hello,

I'm trying to interface Nokia 6210 and NXP microcontroller LPC2148. I use this schematic:



My max is max232ACPE. VCC is not 5 V but +3,3 V. My code is:

Code:
#include "LPC2148.h"

// VIC controller configuration
#define TXD0_P00_SEL (1<<0)
#define RXD0_P01_SEL (1<<2)

//PCLK frequency 60 MHz
#define PCLK 60000000

//Set bitrate
#define UART_BAUD(baud) (unsigned short)(PCLK/(baud*16.0)+0.5)
#define U0LCR_8Bit_Data 3
#define U0LCR_1Bit_Stop 0
#define U0LCR_No_Parity 0
#define U0FCR_14Char_Fifo (3<<6)
#define U0FCR_FIFO_Enable 0x1
#define U0LSR_THRE 0x20
#define U0LSR_RDR 0x1
#define U0LCR_Divisor_Latch_Access_Bit 0x80U

//Initializing UART0
static void Uart0Init(unsigned short BaudRate)
{
	//Chose RX and TX
	PINSEL0 |= TXD0_P00_SEL | RXD0_P01_SEL;
	//Set transfer speed
	U0LCR=U0LCR_Divisor_Latch_Access_Bit;
	U0DLL=(unsigned char)BaudRate;
	U0DLM=(unsigned char)(BaudRate>>8);
	//Set 8,n,1
	U0LCR=U0LCR_8Bit_Data | U0LCR_1Bit_Stop | U0LCR_No_Parity;
	//Enable fifo
	U0FCR=U0FCR_FIFO_Enable | U0FCR_14Char_Fifo;
	//Disable interrupts and zeros interrupts flags
	U0IER=0;
	U0IIR=0;
	//When character is received LSR set to 0
	U0LSR=0;
	//IO0DIR = 0x00000100;
}
static void Uart0Puts (const char *str)
{
		//Send next character
		while (*str)
		{
			//wait until get permission to save into send buffer
			while(!(U0LSR&U0LSR_THRE));
			//sent char and go to the next char
			U0THR=*str++;
		}
}
static void Uart0Gets (char *str)
{
		char c;
		do
		{
			//wait for char
			while(!(U0LSR&U0LSR_RDR));
			//receive char
			c=U0RBR;
			IOCLR0=0x100;
			wait();
			IOSET0=0x100;
			//save char
			*str++=c;
			//wait for transmitter
			while(!(U0LSR&U0LSR_THRE));
			//send back char
			U0THR=c;
		}
		while (c!='r');
		*(str-1)=0;
}
void wait(void)
{
int i;
for (i=0;i<100000;i++);
}
char buf[1024];
int main (void)
{
	Uart0Init(UART_BAUD(9600));
	IODIR0 = 0x00000100;
	PINSEL0|=0x100;
	IOSET0=0x100;
		Uart0Puts("A");
		wait();
		Uart0Puts("T");
		wait();
		Uart0Puts("H");
		wait();
		Uart0Puts("\r");
		wait();
	IOCLR0=0x100;
	while(1)
	{
		//receive line
		Uart0Gets(buf);
	}
return(0);
}

This program must hung up incoming call, but it doesn't work. I try to solve this problem during all week. Please help me! I'm waiting for any sugestions.
 

hello everybody
i am using gsm modem interfaced with microcontroller. i have sucessfully send sms using AT+CMSS command from the circuit. But i am having problem in reading new sms from microcontroller. Can anyone provide code or pseudocode for reading sms . Plz help.
 

Re: sending at commands using mcu

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

im not sure whether this happens with c
but it is working with C#
Just assign ur AT command to variable
 

Re: sending at commands using mcu

im not sure whether this happens with c
but it is working with C#
Just assign ur AT command to variable

I tested it myself in Basic and C. Both run perfectly.
 

Hi to Everybody.....

If not possible to write any AT Commands in Hyper Terminal Means..
Please select in ASCII settings ie.,
Just enable the ASCII Sending Option.....
Both option you must enable...
1.) Send line end wtith feeds
2.)Echo type characters Locally

Then give ok

After that try to give commands.....
Now if you press A in Hyper Terminal it will display 2 characters
on the Hyper Terminal...
If you press any key it will display 2 letters....

Now you go to the ASCII Settings and Deselect the

ASCII Sending Option.....
Both option you must Disable...
1.) Send line end wtith feeds
2.)Echo type characters Locally

Then give ok

After that you try again to give the Commands in Hyper Terminal
Now it wil accept....
and it will display only single character..
Can you try this one....


See my following attachment
 

Attachments

  • Hyper Terminal.doc
    189 KB · Views: 127
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top