I need help soon.I have a problem with gsm control

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
siemens c55 problem tx rx

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 my schematic:

https://obrazki.elektroda.pl/10_1208886865.jpg


that is C 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;
}
}
}
 

gsm controler

Hi,
Are you sure about the pin numbers of the phone to which you have directly connected the controller pins? How did you manage to connect to these pins of the phone? Unfortunately, my Tinycad is not able to open your cable diagram, may be due to version difference. Since your phone is working with PC, it would have been easy to connect your controller to the same cable through a MAX 3232 chip on your controller board and bringing out the signals on a 9pin male connector exactly matching the pin connections as per PC's connector.
While I have not yet fully gone through the document, assuming the phone pins are correct, your TX connection to the phone will give problem. The R6 resistor which you have connected with a good intention will reduce the voltage level below required Hi level since TX output of the controller is from a high pull up resistor. You can remove R6 and connect a 3.6 V zener there, with anode to ground. Also, since the phone output is already low, you could remove the resistor in the the controller's RX path.

Regards,
Laktronics
 

thnks laktronics.
but I didnt understand almost it.

your first advise is using max232 then db9 connector and data cable?

second advise has a problem tx,rx connection.How will I do redraw my schematic.Can you draw.I didnt understand.

please help me...
 

Hi,
I was asking you how could you connect to TX/RX pins of the phone without using a data cable.
The data cable you used to connect the phone to PC has an RS232 voltage coverter to change the TTL levels of the phone to +/-12V levels used in RS232. So I was suggesting you to use such a level converter on your microcntroller board and using the same data cable connect microcntroller pins after MAX232 to the phone.

However, if you are sure of the pins of the phone presently connected, then I thought you could as well try that also without going back to the above suggestion of using the data cable. In this case, you have used an R6 resistor, shown in your JPEG diagram, in the TX path of the micrcontroller, which reduces the TX signal very much. You should replace it with a 3.6V zener diode and see if your present set up works with this change. If you find it difficult to understand, please take the help of a local Electronics guy, as therwise I find it difficult to communicate.

Regards,
Laktronics
 

friends please help me
 

Hi,
You have still not answered my question as to how you have idetified the pins of the phone and how you are connecting directly to those almost invisible pins. The cable would have taken care of all those problems and bring out a proper signal to match with the connector of the PC, whose pins are clearly defined. If you make any mistake in idetifying the pins of the phone or in direct connections to those miniature pins, it may cost you the phone.

Now as regards the new schematic, you need to make the following changes:

1. R3 is not required, short across the pins of R3.

2. Connect the ground of the micro controller to the ground of the phone.

Otherwise, it appears ok to me.

Regards,
Laktronics
 

    cllunlu

    Points: 2
    Helpful Answer Positive Rating
ok.I have done what you said.And my code is correct?.And I have another schematic.

this is my new schematic that is you said me...
 

I have another schematic with max232.

8051------>>>max232----->>>DB9male coonector----->>>Data cable(data cable has a female connector) siemens C55.

my another schematic is here:
 

Hi,
I suggest you to do one thing at a time and give up only if you can not make it work.
So, after making the changes in the shematic what have you observed?
Regarding the code, you have to take care of all the language specific issues yourselves, I may not be able to help you in this area.

For testing purpose, reduce your code, to send string " AT '' followed by 0x0d and check if you get "ok". This will show if the interface is working or not. Also for first testing, use only character level send receive functions.

Also note the following regarding your code:

After determining the switch is closed, and finishing the subsequent functions, you need to also wait for the switch to be opened as other wise for the same single closing, the functions may be done many times.

You also have to clear ok and ok1 after they are tested true.

I suppose you need to assign the strings to be sent to a character array to get '\0' character added at the end.

Regards,
Laktronics
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…