You are on page 1of 6

11/11/2015

How to interface GSM modem TO atmega16

Close or E sc Key

Follow @EngineersGarage

Follow

Arduino Projects (http://ww w.engineersgara ge.com/ microcontrol ler/arduino-projects) | Raspberry Pi


| Electronic Circuits (http://w ww.e ngi neersgarage. com /ele ctroniccircuits)
| AVR (http:/ /www .engine ersgarage.com/e mbedded/ avr-microcontroller-projects) | PIC
(http://ww w.engine ersgara ge.com/e mbe dded/pic-microcontrolle r-proje cts)
| 8051
(http://ww w.engine ersgara ge.com/m icrocontrol ler/ 8051projects)
| Electronic Projects

(http://w ww.e ngi neersgarage. com /embedde d/ra spbe rry-pi)

(http:// www. enginee rsga rage .com /contri buti on)

How to interface GSM modem TO atmega16


Lo g in or regist er to po st co mmen ts

11 p osts / 0 n ew

Last post

#1

We d, 23/ 02/2 011 - 00 :51

hardeep

Ho w to int erface GSM modem TO atmega1 6


Si r i wanted to in terface GSM mod em SIM300 to A tmega16 ...i w ant to c ommunic ate
bo th the w ays. ..pl ease help me out wi th the c odi ng and the cod e expl anation .... I
am u sing Code vi sion avr fo r writing th e prog ram...
Th anks i n advance si r.. .!!!

LastOfflin
seen:
e 2 years
11 month s ago
Jo ined : 22/0 2/20 11
- 23 :15

RF Channel Simulator
Add Doppler, delay, fading, noise & interference to your test signals

Top

or to post c omments
Permalink

We d, 23/ 02/2 011 - 11 :47

dagakshay

GS M interfacing with 80 51
Offlin e

yo u can get the help fro m here its on 8 051 bu t you can con vert i t into A VR

Last
seen:
2

ht tp://www .eng ineersg arag e.co m/micro cont roller/8051 projects/gsmin terf ace-8051 -microcontroller-circu it-code

weeks 4 days ago


Jo ined : 10/1 0/20 10
- 08 :45

(http://www.engineers garage.com/ micr ocontroller /8051project s/gsminterface- 8051-microcontr oller-circuit-code)


ht tp://www .eng ineersg arag e.co m/micro cont roller/8051 projects/in terf acin ggsm-80 51-micro con troller-circuit -cod e

(http://www.engineers garage.com/ micr ocontroller /8051project s/inter facinggs m-8051-microcontroller- circuit -code)
ht tp://www .eng ineersg arag e.co m/micro cont roller/8051 projects/in terf acegsm-mo dule-805 1-micro cont roller-circuit-code

(http://www.engineers garage.com/ micr ocontroller /8051project s/inter facegs m-module-8051-microcont roller- circuit- code)
Top
Tue, 29/ 03/2 011 - 22 :37

www.engineersgarage.com/forums/avr/how-interface-gsm-modem-atmega16

or to post c omments
Permalink

1/6

11/11/2015

How to interface GSM modem TO atmega16


hardeep

I am n ot get ting h ow to
I am n ot getting h ow to in terface i t with A TMEGA16 ...p lz hel p me with the c odin g
part.. .!!!
Ho w to sen d the string to the modem u sing u sart and al l...
In divi dual ly my usart i s runn ing fi ne and GSM mo dem al so run ning fine...b ut i m
no t able to interfac e mod em to atmega16.. .!!!

LastOfflin
seen:
e 2 years
11 month s ago
Jo ined : 22/0 2/20 11
- 23 :15

Top

or to post c omments
Permalink

Thu, 31/ 03/2 011 - 10 :41

dagakshay

th e links i have p osted abo ve


Offlin e

th e links i have p osted abo ve sho ws how to interface gsm modem to 8051 ...

Last
seen:
2

let us kno w where exac tly you got struc t... are asking for alg o???

weeks 4 days ago


Jo ined : 10/1 0/20 10
- 08 :45

Top

or to post c omments

Thu, 31/ 03/2 011 - 19 :33 (R eply t o #5)

hardeep

Permalink

My GSM mod em and A VR usart


My GSM mod em and A VR usart are working fi ne ind ivi dual ly.. ..bu t when i
co nnec t modem to con tro ller,i

LastOfflin
seen:
e 2 years
11 month s ago
Jo ined : 22/0 2/20 11
- 23 :15

#i nclu de<avr/i o.h >


#i nclu de<u til/ del ay.h >
#d efin e F_CP U 1105 920 0UL
#d efin e USART_BA UDRATE 96 00 // Baud Rate val ue
#d efin e BAUD_PRE SCA LE ((( F_CP U / (USA RT_ BAUDRATE * 1 6UL) )) - 1)

#d efin e LCD_ DATA P ORTB //LCD data p ort


#d efin e ctrl P ORTD
#d efin e en PD2 / / enab le si gnal
#d efin e rw PD3 / / read /write si gnal
#d efin e rs PD4 / / regi ster select sig nal
vo id usart_p utstr(c har * s) ;
vo id LCD_cmd (unsign ed char cmd) ;
vo id ini t_LCD(vo id) ;
vo id LCD_wri te(u nsi gned c har data);
vo id usart_i nit( );
static void usart_ putch(u nsig ned ch ar send);
un sign ed int u sart_getch( );
vo id gotoxy( unsi gned char row,u nsig ned c har co lumn );
static void LCD_Strin g(ch ar *s) ;
in t main ()
{
un sign ed char valu e,i ;
DDRB=0 xff; / / LCD_ DATA port as outp ut port
PO RTB= 0x00 ;
DDRD|= 0xFC;
in it_LCD() ; //in iti alizatio n of LCD
_d elay_ms( 50); / / del ay of 50 milli secon ds
usart_ init(); // i nitiali zati on of US ART
go toxy(1,1 );
// char a[] = "AT";
ch ar b[] = "AT+CMGS= ";
ch ar no[ ]="+9195 959 5563 5";
ch ar bod y[] = "S uccessful";

{
// usart_pu tstr(a) ;
// _del ay_ms(5) ;
// u sart_putstr( "\r\n") ;
// _ delay_ms(100 );
usart_ putstr(b );
_d elay_ms( 100) ;
usart_ putc h('"');
// _ delay_ms(100 );
usart_ putstr(n o);
// _ delay_ms(100 );
usart_ putc h('"');
_d elay_ms( 100) ;
usart_ putc h('\ r') ;

www.engineersgarage.com/forums/avr/how-interface-gsm-modem-atmega16

2/6

11/11/2015

How to interface GSM modem TO atmega16


usart_ putc h('\ n') ;
_d elay_ms( 100) ;
usart_ putstr(b ody);
_d elay_ms( 100) ;
usart_ putc h(0x1A) ;

//
//
//
//
//

for (i= 0;i< 16;i ++)


{
value=usart_g etc h(); / / Call a function to get data fro m seri al po rt
_ delay_ms(100 );
LCD_w rite(val ue) ; // wri te data to LCD

// }
// g otoxy(2, 1);
}
return 0 ;
}
vo id ini t_LCD(vo id)
{
LCD_cmd(0x38); / / ini tial ization of 1 6X2 LCD in 8b it mod e
_d elay_ms( 1);
LCD_cmd(0x01); / / clear LCD
_d elay_ms( 1);
LCD_cmd(0x0E); / / cursor ON
_d elay_ms( 1);
LCD_cmd(0x80); / / ---8 go to fi rst li ne and --0 is for 0th p osition
_d elay_ms( 1);
return ;
}
vo id LCD_cmd (unsign ed char cmd)
{
LCD_DA TA=c md;
ctrl &=~ ( 1<<rs);
ctrl&= ~(1< <rw) ;
ctrl|= (1<< en); / / RS an d RW as LO W and EN as HIGH
_d elay_ms( 1);
ctrl &=~ ( 1<<rs);
ctrl&= ~(1< <rw) ;
ctrl&= ~(1< <en) ; // RS , RW , LOW and EN as LOW
_d elay_ms( 1);
return ;
}
vo id LCD_wri te(u nsi gned c har data)
{
LCD_DA TA= data;
ctrl |= (1 <<rs);
ctrl&= ~(1< <rw) ;
ctrl|= (1<< en); / / RW as LOW and RS, EN as HIGH
_d elay_ms( 1);
ctrl |= (1 <<rs);
ctrl&= ~(1< <rw) ;
ctrl&= ~(1< <en) ; // EN and RW as LOW and RS HIGH
_d elay_ms( 1); // d elay to get thing s exec uted retu rn ;
}

vo id usart_i nit( )
{
UBRRL = 0x47;
// UBRRL = ( unsi gned c har)BAUD_PRESCA LE;
// Load lo wer 8-bits o f the b aud rate val ue into the l ow byte of the UBRR register
// UBRRH = ( unsi gned c har)(BA UD_P RESCALE >>8) ; // Load upper 8-b its of the
baud rate valu e..
_d elay_ms( 1);
UCSRB |= ( 1 << RXE N) | (1 << TXEN); / / Turn o n the transmission an d
reception ci rcui try
UCSRC |= ( 1 << URS EL) | (1 <<USBS) | ( 1 << UCS Z0) | (1 < < UCS Z1);
// Use 8-b it character si zes
}
un sign ed int u sart_getch( )
{
wh ile (!(UCS RA & (1 << RXC) ) );
// Do noth ing un til data has been recei ved an d is ready to b e read from UDR
_d elay_ms( 1);
return (UDR); // return the byte
}
static void usart_ putch(u nsig ned ch ar send)
{
wh ile (( UCSRA & (1 << UDRE) ) == 0); / / Do nothing u nti l UDR is ready..
// for more data to be wri tten to it
UDR = send ; // Sen d the byte
}

voi d goto xy(u nsig ned c har ro w,un sign ed ch ar col umn)

www.engineersgarage.com/forums/avr/how-interface-gsm-modem-atmega16

3/6

11/11/2015

How to interface GSM modem TO atmega16


{
sw itch ( row)
{
case 1: LCD_cmd (0x8 0 + colu mn - 1) ; break;
case 2: LCD_cmd (0xc 0 + colu mn - 1) ; break;
defaul t: break;
}
}

static void LCD_Strin g(ch ar *s)


{
register ch ar c;
wh ile((c = *s++))
{
_ delay_ms(10 );
LCD_write( c);
}
return;
}
vo id usart_p utstr(c har * s)
{
w hil e(*s)
{
usart_ putc h(*s++);
}
}
am n ot rec eivi ng messag es.. .
Top

or to post c omments
Permalink

Sun, 03/ 04/2 011 - 22 :55

hardeep

Can anyo ne help me out w ith


Can anyo ne hel p me out w ith the pro gramming l ogi c ???

LastOfflin
seen:
e 2 years
11 month s ago
Jo ined : 22/0 2/20 11
- 23 :15

Top

or to post c omments
Permalink

We d, 18/ 05/2 011 - 17 :08

saahil agrawal

Sir,i want to in terf ace a


Si r,
i want to in terface a si m90 0 with atmeg a16 using serial communic ati on and i w ant
th e at,ega tp ch eck in spec ific time in terval wh ether there is any message in the
in box of the mod ule an d if yes i want to ddec ode it acco rdin gly. also i mu xt be
ab le to send sms.

LastOfflin
seen:
e 4 years 5
mo nths ago

than king i n advamce and i am eagerl y waiting for the solution as i am


nearimg the deadli ne of my project su bmissio n.

Jo ined : 18/0 5/20 11


- 17 :00

Top

or to post c omments
Permalink

Fr i, 19/ 08/2 011 - 17 :34

reza

(No subject)

LastOfflin
seen:
e 4 years 2
mo nths ago
Jo ined : 19/0 8/20 11
- 17 :10

Top
Fr i, 19/ 08/2 011 - 17 :18

www.engineersgarage.com/forums/avr/how-interface-gsm-modem-atmega16

or to post c omments
Permalink

4/6

11/11/2015

How to interface GSM modem TO atmega16


reza

hii thin k this p rogram is


hi
i th ink th is pro gram i s betet 4 u .
i di d it .th is pro gram i s working w ith pc ( in cod evi sion termi nal )b ut it d oesn t work
wi th gsm 3 00!!!

LastOfflin
seen:
e 4 years 2
mo nths ago
Jo ined : 19/0 8/20 11
- 17 :10

#i nclu de <mega16 .h>


#i nclu de <stdio. h>
#i nclu de <delay. h>
ch ar Enter=1 3;
ch ar dou ble_ quote=3 4;
ch ar Ctrlz=2 6;
vo id mai n(vo id)
{
PO RTD= 0x00 ;
DDRD=0 x00;
UCSRA= 0x00 ;
UCSRB= 0x18 ;
UCSRC= 0x86 ;
UBRRH= 0x00 ;
UBRRL= 0x33 ;
wh ile (1 )
{
if (P IND. 2== 0) {
p rintf("at%c ",En ter) ;
d elay_ms( 500 );
p rintf("A T+CMGF= 1%c",Enter) ;
d elay_ms( 500 );

pri ntf( "AT+CMGS =%c 0935 1563 176% c%c ",do uble_quo te, doub le_q uote,En ter) ;
d elay_ms( 100 );
p rintf("A VR Test 1%c ",Ctrlz) ;
d elay_ms( 500 );
};
};
}

Top

or to post c omments
Permalink

Thu, 01/ 11/2 012 - 11 :13

5HUJ4

By u sing GSM SIM 300M M odu le &


By u sing GSM SIM300M Modu le & Atmega8 Uc ,How to sen d SMS to 3 Different
person s when o ne of th e port pin of A tmeg a8 gets hig h ... Pl zz some body h elp me
in d is reg ard fo r "cod ing p art" . ...!!!!

LastOfflin
seen:
e 1 year 11
mo nths ago
Jo ined : 18/0 2/20 12
- 00 :22

Top

or to post c omments
Permalink

Tue, 22/ 07/2 014 - 12 :56

HA RESH

ho w to int reface gsm modem to


ho w to intreface gsm modem to avr micro control ler. .... ?
pl ease take it sourc e cod e with p rogramin g ... type i nsto lll .. ..

LastOfflin
seen:
e 1 year 2
weeks ag o
Jo ined : 09/0 7/20 14
- 11 :48

Top

or to post c omments

Lo g in or regist er to po st co mmen ts

www.engineersgarage.com/forums/avr/how-interface-gsm-modem-atmega16

5/6

11/11/2015

How to interface GSM modem TO atmega16

APPLICATIONS & TECHNOLOGIES


Learn ab out th e latest ap plic atio ns and i ndu stry trend s with tuto rial s and wh ite paper d esig n reso urces on vertic al markets.

(http://in.mouser .com/applications/automotiv e(http://in.mouser .co


(http://in.mouser .com/applications/energy_harvesting/)
applications/)
technology
/)
A u tomo tiv e
En ergy H arv estin g
ME MS Tec hnology

C opy right 2012 EngineersGarage. A ll rights reserved. Priva cy Po licy (http://www.engineer sgar age.com/privacy -policy ) | Refund Policy
(htt p:/ /www.engineersgarage.com/subscript ions -refund- policy) | About Us (http:// www.engineer sgarage.com/about- us)

www.engineersgarage.com/forums/avr/how-interface-gsm-modem-atmega16

6/6