Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

gsm+8051+lcd interfacing

Status
Not open for further replies.

praveend329

Newbie level 2
Joined
Oct 13, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,308
hi im doing my project with 8051 controller and interface it with gsm modem to recieve the message and the message recieved by it has to be displayed in lcd.
Can any one please send the code for it..
 

You are posting as if someone is here with the code.Do try to do & we will surely help you along your way.
Regards,
Jerin.
 

    V

    Points: 2
    Helpful Answer Positive Rating
Just try to do man one by one.If you have doubts then do post it here & we will surely help you.
Regards,
Jerin.
 

#include <REGX51.H>

#define MYDATA P2

sbit rs=P3^2;
sbit rw=P3^3;
sbit en=P3^4;



unsigned char rval[76];
int fl=0;

void Delay(unsigned int itime)
{
unsigned int i,j;
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
}



int ldata;
void lcdcmd(unsigned char value)
{
ldata = value;
rs = 0;
rw = 0;
en = 1;
Delay(5);
en = 0;
return;
}

void lcddata(unsigned char value)
{
ldata = value;
rs = 1;
rw = 0;
en = 1;
Delay(5);
en = 0;
return;
}



void lcdinit()
{
lcdcmd(0x38);
lcdcmd(0x0c);
lcdcmd(0x01);
lcdcmd(0x80);
}

void init()
{
SCON=0x50;
TMOD=0X20;
TH1=0XFD;
TR1=1;
lcdinit();
}

void txs(unsigned char value)
{
TI=0;
SBUF=value;
while(TI==0);
}


void disp(unsigned char val)
{
lcddata(val);
}

void welcome()
{
lcdcmd(0x80);
disp('W'); disp('e');disp('l'); disp('c');disp('o'); disp('m');disp('e'); disp(' ');
}


unsigned char rxs()
{
unsigned int c=0;
while(RI==0)
{
if(fl==0)
{
if(P1_7==0)
{
}
}
c++;
if(c>40000)
break;
}
RI=0;
return SBUF;
}


void rxmo()
{
char i;
txs('A');txs('T');txs('+');txs('C');txs('M');txs('G');
txs('R');txs('=');txs('1');txs(13);
for(i=0;i<76;i++)
{
P1_6=!P1_6;
rval=rxs();
}
}
void del1()
{
char i;
txs('A');txs('T');txs('+');txs('C');txs('M');txs('G');
txs('D');txs('=');txs('1');txs(13);
for(i=0;i<13;i++)
{
P1_5=!P1_5;
rval=rxs();
}
}
void main()
{
unsigned char i=0,oc=0;
init();
txs('A');txs('T');txs('+');txs('I');txs('F');txs('C');
txs('=');txs('0');txs(',');txs('0');txs(13);
txs('A');txs('T');txs(13);
txs('A');txs('T');txs('+');txs('C');txs('M');txs('G');
txs('F');txs('=');txs('1');txs(13);
del1();
welcome();
while(1)
{
rxmo();
lcdcmd(0xc0);
for(i=72;i<=75;i++)
{
lcddata(rval);
}
}

}

the gsm modem is recieving the messages only one at a time and displaying if we send another the previous message is not marking as unread please do the need full.
 

how to send the new line character while giving AT command?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top