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 /   Sorry for the delayed

  Sorry for the delayed

|

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 …? ›   Sorry for the delayed

November 8, 2012 at 6:18 pm #8728
AJISH ALFRED
Participant

 

 

Sorry for the delayed response. I hope your init() function is setting things properly. Now try exactly the following code with the hyperterminal and tell me whether it displays something on the terminal window.

 

 

#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();
 

  tx0 (‘h’);

  tx0 (‘a’);

  tx0 (‘i’);

  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);

 

  while ( 1 )

 {

     ;

  }

}

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;
}

RSS Recent Posts

  • Fixing board, Easy question HEX SCHMITT July 10, 2025
  • Can I make two inputs from one?? July 10, 2025
  • Display TFT ST7789 (OshonSoft Basic). July 9, 2025
  • Home Smoke detectors are all Beeping Batteries are not dead.??? July 9, 2025
  • The Analog Gods Hate Me July 9, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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