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.!