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.

Help required in GSM controlled Home devices.....Urgent

Status
Not open for further replies.

tubaaamir

Newbie level 3
Joined
Nov 2, 2008
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,321
usart_init

Plz can anybdy help me out in connecting erricson T29 with ATmega32 for smscontroller to control home devices....!....

..i read smwhere that T29 cannot be used as GSM modem.....is this true??? ..

...plus Do i hav to design hyperterminal type routine for MCU to get sms from Cell phone...

..and what is difference (as per using GSM Modem and AT cmd set) b/w T28 and T29
 

ucsra

Hii..

I don't have idea about T28 or T29 GSM modem..

...plus Do i hav to design hyperterminal type routine for MCU to get sms from Cell phone...

After you interface it you'll need to design some routine to read the sms or to accept the calls by sending the respective AT commands from the controller to the GSM module..


Surya
 

gsm controlled devices

...Plz can u give me some example as to how i send AT cmnds to cell using MCU..

..i hav to write prgm in Assambly or C....???....
 

unsigned char usart_receive( void )

U can write program on ATmega32 in C or in ASM both will work..



--> You'll connect RX(module) with TX(controller) and TX(module) with RX(controller)
This RX and TX will correspond to a UART

--> To use the UART in the software routines u'll need to configure the Uart baud and initialize it.. This shown in the data sheet..
Although a better tutorial is here:

https://www.avrfreaks.net/index.php...&start=0&postdays=0&postorder=asc&highlight=

--> Next U'll need to refer to the GSM module AT command set.. for the respective commands that needs to be sent..
e.g. AT+CMGR=1 to read sms at first location
etc etc..

Surya
:D
 

example void usart_init(void) atmega32

Hi...

thnks for link....i got it....

but nw my prob is that although my cell(now i m using T290) responds ok as i snd AT through my microcontroller(i m using ATmega32) but response is not correct for other cmds....i m using following code for deleting msg from 1st memo loc


//////////////

#include <avr\io.h> // Most basic include files
#include <avr\interrupt.h> // Add the necessary ones
#include <avr\signal.h> // here
#define _F_CPU 1000000UL
#include<util\delay.h>

// ***********************************************************


void USART_Init( unsigned int); //prototype for Intialization function
void USART_Transmit( unsigned char); //prototype for data Transmitting function
// with one input argument
unsigned char USART_Receive( void ); //prototype for data Recieving function with
// one output argument

// ***********************************************************

int main(void) //calling main function
{
int baud=12; //loading 25 in UBBR i.e baudrate=2400
unsigned char res1,ok[2],inst[12],cr,data; //intializing char type variables
USART_Init(baud); //calling Intialization function
DDRB=0x05;
PORTB=0x00;
//Carriage Return
cr=0x0D;
while(1) // Infinite loop; define here the system
// behaviour
{
//calling data recieving function with output // stored in 'result'
unsigned char MSinst[12] = {'A','T','+','C','P','M','S','=','"','M','E','"'};
for (int j=0; j<=11; j++)
{
while (( UCSRA & (1<<UDRE))==0 ) ;

UDR = MSinst[j];
}

//Carriage Return
USART_Transmit(cr);

_delay_us(100000);
_delay_us(100000);
_delay_us(100000);
_delay_us(100000);
_delay_us(100000);

unsigned char DLinst[9]={'A','T','+','C','M','G','D','=','1'};

for (int j=0; j<=8; j++)
{
while (( UCSRA & (1<<UDRE))==0 ) ;

UDR = DLinst[j];
}
//Carriage Return

USART_Transmit(cr);

while ((UCSRA & (1<<RXC))==0 );
ok[0]= UDR;
while ((UCSRA & (1<<RXC))==0 );
ok[1]= UDR;
if ((ok[0]=='o')&&(ok[1]=='k'))
{
PORTB=0xFE;
_delay_us(100000);
_delay_us(100000); }
else
PORTB=0xFB;

_delay_us(100000);
_delay_us(100000);



}

}
void USART_Init( unsigned int baud ) //defining intialization function
{
UBRRL = baud; //sending value in UBRRL i.e
UCSRA = (1<<U2X); // Setting baud rate=9600
UCSRB = (1<<RXEN)|(1<<TXEN); // Enabling receiver and transmitter bits
UCSRC = (1<<URSEL)|(0<<USBS)|(3<<UCSZ0)|(0<<UPM0);
//Setting frame format:
//8data bits,2stop bits,even parity
}




void USART_Transmit( unsigned char data ) //defining data transmitting function
{
while (( UCSRA & (1<<UDRE))==0 ) ; //Wait until the transmitter buffer gets
// empty
UDR = data; // Putting data into buffer, sending the
// data
}



////////////



PLZZZZZzz hlp.!
 

nokia at command set for receiver and transmitter

tubaaamir said:
Hi...

thnks for link....i got it....

but nw my prob is that although my cell(now i m using T290) responds ok as i snd AT through my microcontroller(i m using ATmega32) but response is not correct for other cmds....i m using following code for deleting msg from 1st memo loc


//////////////

#include <avr\io.h> // Most basic include files
#include <avr\interrupt.h> // Add the necessary ones
#include <avr\signal.h> // here
#define _F_CPU 1000000UL
#include<util\delay.h>

// ***********************************************************


void USART_Init( unsigned int); //prototype for Intialization function
void USART_Transmit( unsigned char); //prototype for data Transmitting function
// with one input argument
unsigned char USART_Receive( void ); //prototype for data Recieving function with
// one output argument

// ***********************************************************

int main(void) //calling main function
{
int baud=12; //loading 25 in UBBR i.e baudrate=2400
unsigned char res1,ok[2],inst[12],cr,data; //intializing char type variables
USART_Init(baud); //calling Intialization function
DDRB=0x05;
PORTB=0x00;
//Carriage Return
cr=0x0D;
while(1) // Infinite loop; define here the system
// behaviour
{
//calling data recieving function with output // stored in 'result'
unsigned char MSinst[12] = {'A','T','+','C','P','M','S','=','"','M','E','"'};
for (int j=0; j<=11; j++)
{
while (( UCSRA & (1<<UDRE))==0 ) ;

UDR = MSinst[j];
}

//Carriage Return
USART_Transmit(cr);

_delay_us(100000);
_delay_us(100000);
_delay_us(100000);
_delay_us(100000);
_delay_us(100000);

unsigned char DLinst[9]={'A','T','+','C','M','G','D','=','1'};

for (int j=0; j<=8; j++)
{
while (( UCSRA & (1<<UDRE))==0 ) ;

UDR = DLinst[j];
}
//Carriage Return

USART_Transmit(cr);

while ((UCSRA & (1<<RXC))==0 );
ok[0]= UDR;
while ((UCSRA & (1<<RXC))==0 );
ok[1]= UDR;
if ((ok[0]=='o')&&(ok[1]=='k'))
{
PORTB=0xFE;
_delay_us(100000);
_delay_us(100000); }
else
PORTB=0xFB;

_delay_us(100000);
_delay_us(100000);



}

}
void USART_Init( unsigned int baud ) //defining intialization function
{
UBRRL = baud; //sending value in UBRRL i.e
UCSRA = (1<<U2X); // Setting baud rate=9600
UCSRB = (1<<RXEN)|(1<<TXEN); // Enabling receiver and transmitter bits
UCSRC = (1<<URSEL)|(0<<USBS)|(3<<UCSZ0)|(0<<UPM0);
//Setting frame format:
//8data bits,2stop bits,even parity
}




void USART_Transmit( unsigned char data ) //defining data transmitting function
{
while (( UCSRA & (1<<UDRE))==0 ) ; //Wait until the transmitter buffer gets
// empty
UDR = data; // Putting data into buffer, sending the
// data
}



////////////



PLZZZZZzz hlp.!

Greetings,

First, do you have the "interface" schematic between the phone and your microcontroller? It could be the problem -The Design-

Now, if we found the design schematic is correct, check the T290 AT Command set, and check for response of those commands you're trying to use. Note that not all commands responds with an "ok" automatically, those need some extra-data to be completed.

I'll be waiting for the schematic.

Best regards

Here: the manual link

 

at commands in t290 tutorial

movie_freak said:
U can write program on ATmega32 in C or in ASM both will work..



--> You'll connect RX(module) with TX(controller) and TX(module) with RX(controller)
This RX and TX will correspond to a UART

--> To use the UART in the software routines u'll need to configure the Uart baud and initialize it.. This shown in the data sheet..
Although a better tutorial is here:

https://www.avrfreaks.net/index.php...&start=0&postdays=0&postorder=asc&highlight=

--> Next U'll need to refer to the GSM module AT command set.. for the respective commands that needs to be sent..
e.g. AT+CMGR=1 to read sms at first location
etc etc..

Surya
:D

hi there! i have also an issue about sending at commands using mcu. im using pic16f877a mcu, and a 6210 nokia fon. ... can i ask some example of the codes?... tanx a lot...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top