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 / Topics / about gsm interfacing

about gsm interfacing

|

Microcontroller › 8051 › about gsm interfacing

  • This topic has 10 replies, 7 voices, and was last updated 14 years ago by Syed Aameer.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • May 9, 2011 at 6:57 pm #917
    goutam
    Participant

    hello

     i have a doubt about one of the sample projects you have put up on your website. am talking about the one titled “interfacing a gsm module with 8051 without using pc”.

    the code which u have given as sample, wat does it do exactly??? does it display an ‘AT’ that is sent to the gsm module?? does it also show the reply that the gsm module gives??? like “OK”!

    May 10, 2011 at 6:08 am #6130
    dagakshay
    Participant

    hello gautam… send the link where you following this project

    May 11, 2011 at 2:20 pm #6154
    romel emperado
    Participant

    post here the specific blocks of code you want to ask.. maybe we can help..

    May 14, 2011 at 5:19 pm #6203
    goutam
    Participant

    http://www.engineersgarage.com/microcontroller/8051projects/interfacing-gsm-8051-microcontroller-circuit-code

    this is the link….

    i built the circuit as given in the circuit diagram and used the same given code….but am not getting any output on the led… its blank :O

     

    May 17, 2011 at 5:11 am #6253
    dagakshay
    Participant

    hey goutam,

    led or LCD any ways, are you getting some boxes on LCD or its completly blank.

    if you getting boxes then check you connection again. and if its completely blank check the supply for LCD

    May 17, 2011 at 12:55 pm #6257
    goutam
    Participant

    hello

    i passed that hurdle….am getting the response now…i modified the code to suit my needs now…. instead of sending AT i modified it to send, ATD phoneno the code is as follows….

                                                 //

    #include<regx51.h>
    #define port P1
    #define dataport P2                // Data port for LCD
    sbit rs = port^2;
    sbit rw = port^3;
    sbit en = port^4;
    int count,i;
    unsigned char check,str[15];
    bit check_space;

    void init_serial()            // Initialize serial port
    {
        TMOD=0x20;            // Mode2
        TH1=0xfd;            // 9600 baud
        SCON=0x50;            // Serial mode=1 ,8-Bit data,1 Stop bit ,1 Start bit, Receiving on
        TR1=1;                // Start timer
    }
    void delay(unsigned int msec)        // Function for delay
    {
        int i,j;
        for(i=0;i<msec;i++)
            for(j=0; j<1275; j++);
    }

    void lcd_cmd(unsigned char item)        // Function to send command on LCD
    {
        dataport = item;
        rs= 0;
        rw=0;
        en=1;
        delay(1);
        en=0;
        return;
    }

    void lcd_data(unsigned char item)        // Function to display character on LCD
    {
        dataport = item;
        rs= 1;
        rw=0;
        en=1;
        delay(1);
        en=0;
        return;
    }
            
    void lcd_data_string(unsigned char *str)    // Function to display string on LCD
    {
        int i=0;
        while(str!=’’)
        {
           lcd_data(str
    );                  
           i++;
           delay(10);                                          
           }
        return;
    }
    void lcd()
    {
        lcd_cmd(0x38);                          // For using 8-bit 2 row LCD
        delay(5);                                      
        lcd_cmd(0x0F);                           // For display on cursor blinking
        delay(5);                                     
        lcd_cmd(0x80);                          // Set the cursor on first position of LCD
        delay(5);                                      
    }

    void transmit_data(unsigned char str)    // Function to transmit data through serial port
    {
        SBUF=str;                  //Store data in SBUF
        while(TI==0);                 //Wait till data transmits
        TI=0;              
    }

     void receive_data()  interrupt 4    // Function to recieve data serialy from RS232 into microcontroller
     {    
        RI=0;
        str[++count]=SBUF;            //Read SBUF
        
     }
     
    unsigned char byte_check()         // Function to check carraige return and new line character
    {
        switch(str[0])
        {
            case 0x0a:
            {                // Return 0x00 for new line
            return 0x00;
            break ;
            }
            case 0x0d:
            {                // Return 0x01 for carriage return
            return 0x01;
            break ;
            }
            default :return 0x02 ;        // Return 0x02 for characters except new line and carriage return
        }
    }

    void main()
    {
        lcd();                                // Initialize LCD
        init_serial();                            // Initialize serial port
        count=(-1);
        delay(500);
        lcd_data_string(“Ready”);
        delay(10);                                 
        lcd_cmd(0x01);    
        IE=0x94;
        transmit_data(‘A’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘T’);                     // Transmit ‘T’ to serial port
        delay(1);
        transmit_data(‘D’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘ ‘);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘9’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘5’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘3’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘8’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘0’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘9’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘8’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘2’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘4’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘9’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(‘;’);                      // Transmit ‘A’ to serial port
        delay(1);
        transmit_data(0x0d);                     // Transmit carriage return to serial port
        delay(50);
        while(1)
        {
            if(count>=0)
            {
                check=byte_check();                 // Check the character
                if(check!=0x00)
                {            
                    if(check==0x01)
                    {
                        if(check_space==1)         // Check previous character
                        {
                            lcd_data(0x20);
                            check_space=0;
                        }
                    }
                    else    
                    {
                        lcd_data(str[0]);
                        check_space=1;
                    }
                }
                count–;                   
                for(i=0;i<count;i++)              // Shift the whole array to one left
                {
                    str
    =str[i+1];
                }
            }
        }
    }

     

     

    but the problem is the lcd keeps displaying ready over and over again. sometimes it displays ATD, but doesnt make the call….

    help plz…what am i doing wrong??? some problem with the code??

    August 20, 2011 at 8:27 am #6615
    ahmad mustafa
    Participant

    i think im a ltl late at replyiing… u probably might hv figured this out… 

     

    u r giving a space character after ATD… delete that and u will be done…

    October 7, 2011 at 11:07 am #6684
    k.n.sreekumar
    Participant

    HAI everyone,

                          i am a beginner  of 8051 based systems design, now i am trying to interface gsm modem with 8051 microcontroller,actually my problem is i received the replay from the modem but the it is displayed in LCD at different format[unknown character] some of the characters are in right format[if suppose RING willbe received means it will displayed #$I# #$I#] how can i decode it pls help me….

    February 8, 2012 at 4:39 am #7120
    Devanshu
    Participant

    hey all, are u sure to check the baud rate of your computer while starting the hyperterminal, it asks for baud rate and com port… i suggesat you to get it checked…

     

    February 8, 2012 at 4:39 am #7121
    Devanshu
    Participant

    hey all, are u sure to check the baud rate of your computer while starting the hyperterminal, it asks for baud rate and com port… i suggesat you to get it checked…

     

    February 10, 2012 at 11:52 am #7135
    Syed Aameer
    Participant

    Hey Goutam,

     i think you try to write similar program as given in this site  by increasing the buffer size set the Str[40]and check..hope you will get OK for AT command

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Variable audio oscillator February 8, 2026
  • Do i need a buffer? February 8, 2026
  • ANOTHER OLD PROJECT REDO February 7, 2026
  • wall transformer polarity February 7, 2026
  • Supply vs performance query 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