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.

Difficulty interfacing Atmega32 with GSM mobile ............

Status
Not open for further replies.

dadda007

Newbie level 5
Joined
Nov 22, 2007
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,357
atmega max232

I wrote a code to send AT commands from ATmega32 to my Ericson 230 cell , but sadly :cry: it is not giving any output ...... I used a RS232(DB9 standard ) cable to interface the cell and the Atmega32, besides i also used MAX232 IC for Voltage conversion . My code is :

Code:
#include<avr/io.h>
#include<util/delay.h>

#define A 0x41
#define C 0x43
#define T 0x54
#define M 0x4d
#define G 0x44
#define D 0x47
#define E 0x48
#define P 0x50
#define S 0x53


void init_txr(void);
void trans_data(char);


int main(void)

{
    
DDRB=0xff;
DDRA=0xff;
init_txr();


int x[10]={'A','T',0x3d,'C','M','G','D',0x2b,0x01,0x0d},i;
int y[13]={'A','T',0x3d,'C','P','M','S',0x2b,0x22,'M','E',0x22,0x0d};
int z[10]={'A','T',0X3D,'C','M','G','F',0X2B,0X00,0X0D};

while(1)

{

for(i=0;i<13;i++)
trans_data(y[i]);

_delay_ms(50);

for(i=0;i<10;i++)
trans_data(z[i]);

_delay_ms(50);

for(i=0;i<10;i++)
trans_data(x[i]);

_delay_ms(50);


}

return 0;

}



void init_txr(void)

{

//UBRRH=0x00;
UBRRL=0x19;
//UCSRC=0x86;
UCSRB=0x08;
//UCSRA=0x00;

}


void trans_data(char a)

{



while(!(UCSRA & (1<<UDRE)))

;

UDR=a;
PORTA=0x0f;

}

The pin connections i used for the RS232 are :

Pin 2 to 14 of MAX232
Pin 3 to 8 of MAX232
Pin 5 Gnd
Pin 4 to Pin 2 of MAX232
Pin 7 to Pin 7 of MAX232

Plz help :!:
 

mega32 usart

Hey, u are using winavr isn't it?

i suggest u to view this library for avr -> avrlib

**broken link removed**

for sending a string to uart just use ... rprintfStr(mystring), maybe your problem dealing with treat a const / var.

.. regarding your problem, have you capture mega32 usart output on hyperterminal,if output is exactly same as your array / string ('A'...) i think the problem is on GSM / connection on it,otherwise the problem my come from mega32.
 

atmega ericson

One more link

**broken link removed**

Hope you find this helpful

Nandhu
 

atmega32

dadda007 said:
...........

The pin connections i used for the RS232 are :

Pin 2 to 14 of MAX232
Pin 3 to 8 of MAX232
Pin 5 Gnd
Pin 4 to Pin 2 of MAX232
Pin 7 to Pin 7 of MAX232

Plz help :!:


wow... i dont see that, did u implemeting sofware uart? why the connection like that ?

.. usually to use USART module on AVR the connection (minimal is ):

atmega32 pin <> level converter (max232)
15 (TXD) 11/10
14 (RXD) 12/9
GND GND
 

max232 atmega db9

I’m not sure with the Ericson but most Mobile serial interfaces are 3.3 Volts so you may not need the MAX 232. The MAX232 translates [PC +- 12volt] to uC 5volts. If your ATmega32 is running at 3.3 Volts then you should be able to connect with just a couple of current limiting resistors for safety.
 

x10 atmega

There is no need of using max232 circuit in your project.

Because logic level is same in Ericson 230 and atmega 32 microcontroller.

If the voltage range is same for for both controller and Ericson 230 it is better to connect rx/tx directly, or use optocupler for saftey.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top