Microcontroller › 8051 › Requires complete code for wireless notice board
- This topic has 4 replies, 3 voices, and was last updated 10 years, 11 months ago by AJISH ALFRED.
-
AuthorPosts
-
April 13, 2013 at 10:00 am #2266RUBEN KURIAKOSEParticipant
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 #9521Jason JordonParticipantwhat type of LCD are you using for the board? 16X2?? Is it 8051 based?
April 20, 2013 at 3:23 am #9530RUBEN KURIAKOSEParticipantI 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 #9533RUBEN KURIAKOSEParticipantThe 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!=’