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 / Requires complete code for wireless notice board

Requires complete code for wireless notice board

|

Microcontroller › 8051 › Requires complete code for wireless notice board

  • This topic has 4 replies, 3 voices, and was last updated 11 years, 6 months ago by AJISH ALFRED.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • April 13, 2013 at 10:00 am #2266
    RUBEN KURIAKOSE
    Participant

    Hi friends,

                     I am doing a project entitled ‘Wireless notice board’ using GSM and LCD witout PC. I got the program of interfacing of GSM modem and LCD from engineers garage. But require the complete code so that message send from a phone to GSM modem will display in the LCD. Please upload the complete code.

     

    April 19, 2013 at 4:56 am #9521
    Jason Jordon
    Participant

    what type of LCD are you using for the board? 16X2?? Is it 8051 based?

    April 20, 2013 at 3:23 am #9530
    RUBEN KURIAKOSE
    Participant

    I am using a 20*4 LCD display and an AT89S52 mc.

    The codes in engineers garage will only interface the LCD and GSM modem. But i want to send message from a phone which is supposed to be displayed on LCD

    April 20, 2013 at 4:26 am #9533
    RUBEN KURIAKOSE
    Participant

    The c program i used is given below. But while compiling it there shows an error ‘DATA SEGMENT EXEEDS’. When i decrease the size of array a[161] it shows no error. But the loop works on 161.

     

    #include <REGX51.H>
    sbit rs=P1^0;
    sbit rw=P1^1;
    sbit en=P1^2;
    void lcd_command(unsigned char);
    void lcd_data(unsigned char);
    void string(unsigned char *disp);
    void delay(unsigned int);
    void read(char*);
    void newline();
    void display (char);
    void send();
    void serial();
    void nextline(unsigned char);
    void nextline1(unsigned char);
    void nextline2(unsigned char);
    sfr chdata=0xA0;
    void lcdnewline();
    char a[161];
    char b[13];
    int i,j,z,k,l,f=0;
    void main()
    {
    P0=0x00;
    P1=0x00;
    P2=0xFF;           
    delay(100);               
    lcd_command(0x38);
    delay(100);
    lcd_command(0x80);
    delay(100);
    lcd_command(0xc0);
    delay(100);
    lcd_command(0x0e);
    delay(100);
    lcdnewline();
    serial();
    read(“AT”);
    newline();
    read(“AT+CMGF=1”);
    newline();
    lcdnewline();
    read(“AT+CMGD=1”);
    newline();
    lcdnewline();
    while(1)
    {
    lcd_command(0x83);
    string(“NOTICE BOARD”);
    for(i=0;i<=13;i++)
    {
    while(RI==0);
    b=SBUF;
    RI=0;
    }
    lcdnewline();
    string(“Command Signal”);
    if((b[2]==’+’)||(b[3])==’+’)
    {
    if((b[3]==’C’)||(b[4])==’C’)
    {
    if((b[4]==’M’)||(b[5]==’M’))
    {
    if((b[5]==’T’)||(b[6])==’T’)
    {
    if((b[6]==’I’)||(b[7])==’I’)
    {
    lcd_command(0xC4);
    string(“received”);
    lcdnewline();
    //delay(300);
    read(“AT+CMGF=1”);
    newline();
    read(“AT+CMGR=1”);
    newline();
    newline();
    //newline();
    //newline();
    for(l=0;l<=161;l++)
    {
    while(RI==0);
    a[l]=SBUF;
    RI=0;
    }
    for(l=60;l<=161;l++)
    {
    f=1;
    if(a[l]==’a’)
    {
    k=0;
    do
    {
    k++;
    l++;
    if(k<=20)
    {
    lcd_data(a[l]);
    }
    if((k>20) && (k<=40))
    {
    nextline(f);
    lcd_data(a[l]);
    f++;
    }
    if((k>40) && (k<=60))
    {
    nextline1(f);
    lcd_data(a[l]);
    f++;
    }
    if((k>60) && (k<=80))
    {
    nextline2(f);
    lcd_data(a[l]);
    f++;
    }
    } while(a[l]!=’$’);
    l=162;
    break;
    }
    //break;
    }
    delay(65000);
    }
    }
    }
    }
    }
    }  /* while end here*/
    }  /* MAIN ends here*/
    /* PROTOTYPE FUNCTIONS */
    void lcd_command(unsigned char value)
    {
    chdata=value;
    rs=0;
    rw=0;
    en=1;
    delay(100);
    en=0;
    }
    void lcd_data(unsigned char value)
    {
    chdata=value;
    rs=1;
    rw=0;
    en=1;
    delay(150);
    en=0;
    }
    void read(char *ch)
    {
    int i;
    for(i=0;ch
    !=’’;i++)
    {
    display(ch
    );
    }
    }
    void display(char c)
    {
    SBUF=c;
    send();
    }
    void send()
    {
    while(TI==0);
    TI=0;
    }
    void newline()
    {
    SBUF=’r’;
    while(TI==0);
    TI=0;
    SBUF=’n’;
    while(TI==0);
    TI=0;
    }
    void delay(unsigned int num)
    {
    unsigned int k,q;
    for(k=0;k<num;k++)
    {
    for(q=0;q<num;q++);
    }
    }
    void lcdnewline()
    {
    lcd_command(0x01);
    delay(100);
    lcd_command(0x02);
    delay(100);
    }
    void serial()
    {
    SCON=0x50;
    TMOD=0x20;
    TH1=0xFD;
    TR1=1;
    }
    void string(unsigned char *disp)
    {
    int x;
    for(x=0;disp[x]!=0;x++)
    {
    lcd_data(disp[x]);
    }
    }
    void nextline(unsigned char v)
    {
    if(v==1)
    {
    lcd_command(0XC0);
    }
    }
    void nextline1(unsigned char v)
    {
    if(v==21)
    {
    lcd_command(0X94);
    }
    }
    void nextline2(unsigned char v)
    {
    if(v==41)
    {
    lcd_command(0XD4);
    }
    }

     

     

    November 7, 2013 at 12:17 pm #10582
    AJISH ALFRED
    Participant

    Hi Ruben,

    “DATA SEGMENT EXEEDS”

    That simply meansd your microcontroller don’t have enough memory to store that much number of variables. Even if you go for advanced microcontrollers you can’t create an array more than 500 bytes long.

    So what you have to understand is that this is not a proper method of coding.

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

RSS Recent Posts

  • LED circuit for 1/6 scale diorama May 14, 2025
  • Can I use this charger in every country? May 14, 2025
  • Electronic board faulty?!? May 13, 2025
  • using a RTC in SF basic May 13, 2025
  • An Update On Tarrifs May 13, 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