EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / Finally i have changed my

Finally i have changed my

|

Microcontroller › AVR › By using GSM SIM 300M and Atmega8 , How to write coding for sending SMS to 3 Persons when any one the port pin gets high …? › Finally i have changed my

November 5, 2012 at 1:22 pm #8719
5HUJ4
Participant

Finally i have changed my controller .This time i am using 89s52 with [email protected] .I have compiled the below code sucessfully and checked the output on Keil UART terminal window . But when i have dumped the same code into the controller its not sending any SMS …….. Plz suggest me any solution …..waiting fot ur reply ….!!!

 

#include<at89x52.h>
#define key P2^0
void delay(int time);
void init();
void SMSString(unsigned char* text);
void tx0(unsigned char x);
void main()
{
   P2=0x00;
   init();
   while(1)
{
if(key==1)
{
  SMSString(“ATr”);
  delay(1000);
  delay(1000);
 
  SMSString(“AT+CMGF=1r”);
  delay(1000);
  delay(1000);

  SMSString(“AT+CMGS=”8080808080″r”);
  delay(1000);
 
  SMSString(“This is a test messag “);
  delay(1000);
  tx0(0x1A);
  delay(1000);
  delay(1000);
  delay(1000);
}
}
}

void delay(int time)        //This function produces a delay in msec.
{
    int i,j;
    for(i=0;i<time;i++)
    for(j=0;j<1000;j++);
}

void init()
{
  TMOD=0x20;
  SCON=0x50;
  TL1=0XFD; //9600 @ 11.0592
  TH1=0xFD;
  TR1=1;
}

void SMSString(unsigned char* text) //function to send SMS using GSM modem
{
  unsigned char count = 0;
  while (text[count])
{
 tx0(text[count++]);
}
}

void tx0(unsigned char x) //send data to serial port 0
{
 EA=0;
 SBUF=x;
 while(TI==0);
 TI=0;
 EA=1;
}

 

 

Important Note :From the GSM module i have removed Max 232 and using its 11 pin as TX and 12 pin as Rx pin  , conncting directly to the microcontroller in Cross fasion ( i mean  Tx 2 Rx and Rx to Tx and Gnd 2 Gnd )

 

 

 

 

RSS Recent Posts

  • Supply vs performance query February 7, 2026
  • wall transformer polarity February 7, 2026
  • Do i need a buffer? February 7, 2026
  • BPF February 7, 2026
  • Figgie International intercom 1998 era February 7, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise