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.

problem of sending sms w 8051 and Siemens C55

Status
Not open for further replies.

cllunlu

Member level 4
Joined
Nov 21, 2006
Messages
76
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,900
Hi friends.I am student.And I have final project that is sending sms with 8051 and siemens C55.I can sending sms with hyperterminal succusfully via data cable.I have 3 schematics and I have codes.But I failed.Cellphone doesnt give me any response.

my codes are:

#include <REGX52.H>
unsigned char rcvd[2];
unsigned char j;
unsigned char k;
bit ok=0;
bit ok1=0;

void init() /// u put int() here
{
TMOD=0x20;
TH1=0xFD;
SCON=0x50;
TR1=1;
}

void sendString(unsigned char *a)
{
while(*a!='\0')
{
SBUF=*a;
while(TI==0);
TI=0;
a++;
}
}
void sendChar(unsigned char b)
{
SBUF=b;
while(TI==0);
TI=0;
}
unsigned char rcv()
{
while(RI==0);
RI=0;
return SBUF;
}
void checkOK()
{
for(j=0;j<2;j++)
rcvd[j]=rcv();
if(rcvd[0]=='O'&&rcvd[1]=='K')
ok=1;
else
ok=0;
}
void checkOKe()
{
k=rcv();
if(k=='>')
ok1=1;
else
ok1=0;
}

void main()
{
P2_0=0;
P2_1=0;
while(1)
{
if(P1_0==0)
{
init();
sendString("AT");
sendChar(0x0D);
checkOK();
if(ok==1)
{
P2_0=1;
sendString("AT+CMGS=19");
sendChar(0x0D);
checkOKe();
if(ok1==1)
{
P2_1=1;
sendString("079109459208003311000C910945664173350000AA05E8329BFD06");
sendChar(0x1A);
}
else P2_1=0;
}
else
P2_0=0;
}
}
}
 

please help me friends.Where is my mistake
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top