8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Go to page  [1] 2 3 4
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
cllunlu
Tue Apr 22 2008, 08:10PM
 User Offline
Registered Member #7394
Joined: Tue Apr 22 2008, 07:29PM

Posts: 29
Thanked 0 times in 0 posts
hi friends.
I am trying to send sms with 8051(89c51rc2)and siemens C55.But I failed.I dont know why.When I try to send sms,cellphone turns off.
My schematic and C code here.where is my mistake.I dont know.
Also I can send sms by hyperterminal with data cable.And I simulated it by proteus succesfully.And it is project to pass the class.Plz help me firends.

/////////////////////////////////////////////////////////////////////////

that is C code:

///////////////////////////////////////////////////////////////////////////

CODE:
#include <t89c51Rx2.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");
//sms center no:+905429800033, destination number:+905466143753, message:"HELLO"
sendChar(0x1A);
}
else P2_1=0;
}
else
P2_0=0;
}
}
}


enson.rar





[ Edited Wed Apr 23 2008, 01:48AM ]

celalunlu
Back to top


shyam
Tue Apr 22 2008, 08:25PM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 710
Thanked 104 times in 100 posts
sendString("079109459208003311000C910945664173350000AA05E8329BFD06");
//sms center no:+905429800033, destination number:+905466143753, message:"HELLO"


what is this??
PDU??


doesnot the modem support text mesaging???


lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top


cllunlu
Tue Apr 22 2008, 09:10PM
 User Offline
Registered Member #7394
Joined: Tue Apr 22 2008, 07:29PM

Posts: 29
Thanked 0 times in 0 posts
yes it is pdu mode.Because my cellphone is siemens C55 and it supports only pdu mode.
I can send sms by hyperterminal with pdu mode.And I simulated it by proteus.Serial communication looks success.But it doesnt work when I do that schematic.Cellphone close itself.I dont know why?


celalunlu
Back to top


Ajay
Wed Apr 23 2008, 01:53AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3533
Thanked 646 times in 610 posts
problem seems here..
CODE:
void checkOK()
{
for(j=0;j<2;j++)
rcvd[j]=rcv();
if(rcvd[0]=='o'&&rcvd[1]=='k')
ok=1;
else
ok=0;
}


you are checking for small 'o' and small 'k' whereas phone sends capital 'O' and capital 'K'. so you variable ok is never 1. I hope you got my point.

So make the change in program as..
CODE:
if(rcvd[0]=='O'&&rcvd[1]=='K')
 


www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top



This post has been thanked 1 time
 cllunlu 
abbas1707
Wed Apr 23 2008, 02:13AM

 User Offline
Registered Member #383
Joined: Thu Jan 25 2007, 08:07AM

Posts: 414
Thanked 65 times in 52 posts
also you dont need to send all those commands...just try to send at+cmgs.and dont check OK.

A Thousand Miles Journey Starts With a Single Step.
Back to top


cllunlu
Wed Apr 23 2008, 02:19AM
 User Offline
Registered Member #7394
Joined: Tue Apr 22 2008, 07:29PM

Posts: 29
Thanked 0 times in 0 posts
I know.But I wanna check my pdu mode.So I have to know right communication.And my schematic is right?

celalunlu
Back to top


abbas1707
Wed Apr 23 2008, 02:27AM

 User Offline
Registered Member #383
Joined: Thu Jan 25 2007, 08:07AM

Posts: 414
Thanked 65 times in 52 posts
in schematic......try with DTR pin of mobile = high

A Thousand Miles Journey Starts With a Single Step.
Back to top


cllunlu
Wed Apr 23 2008, 02:39AM
 User Offline
Registered Member #7394
Joined: Tue Apr 22 2008, 07:29PM

Posts: 29
Thanked 0 times in 0 posts
But I dont understand DTR pin of mobile=high

how it will be.It necessary.And how?

celalunlu
Back to top


cllunlu
Wed Apr 23 2008, 02:43AM
 User Offline
Registered Member #7394
Joined: Tue Apr 22 2008, 07:29PM

Posts: 29
Thanked 0 times in 0 posts
this schematic is right too?



celalunlu
Back to top


abbas1707
Wed Apr 23 2008, 02:43AM

 User Offline
Registered Member #383
Joined: Thu Jan 25 2007, 08:07AM

Posts: 414
Thanked 65 times in 52 posts
do you know pin configuration of your mobile connector??you are not using datacable right?

A Thousand Miles Journey Starts With a Single Step.
Back to top


Go to page  [1] 2 3 4  

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems