Discussion in "Embedded GSM Development" started by    kirangowle    Nov 20, 2010.
Wed Dec 15 2010, 04:55 pm
#61
Hi Mojaka,

My keil is evaluation copy 2K limit.
And above links are not opening.
I have done as per your steps.


On LCD is showing 'R' due to its waiting for new msg indication.
When new msg arrives it will display 'I' and then 'Z'.

Program is like this
main()
SMSString("AT\r"); // AT commands to initialize gsm modem
delay(50);

SMSString( "ATe0\r"); // turn off echo
delay(50);

SMSString( "AT&W\r"); // save settings
delay(50);

SMSString( "AT+CMGF=1\r"); // select text mode for sms
delay(50);
  
SMSString( "AT+CNMI=2,1,0,0,0\r"); // notification of new sms
while(1)
{
IE=0x90;
k=0;
lcdcmd(0xd4);
lcddata('R');
delay(100);
while(!NewMessage);
{
	IE=0x00;
lcdcmd(0xd4);
lcddata('I');
delay(10);
NewMessage = 0;
read_notification();
IE=0x90;
}
//New msg indication.
// +CMTI: "SM",3

}

}


For your information i have run the simulation in keil and stopped after few secs. the program is stopping each time in

while(!NewMessage);

line only.
If i write any thing on protues virtual terminal its not getting detected.! i dont know why?


Wed Dec 15 2010, 09:36 pm
#62
hi kirangowle

My keil is evaluation copy 2K limit.


it may be the big cause of ur problem
download complete from here
1) http://ifile.it/rtkzpg4
or
2) http://ifile.it/rtkzpg4/keil.rar
install complete version product key is inside the setup folder

And above links are not opening.


if not opening by this site then copy from it and paste in address bar and press enter

For your information i have run the simulation in keil and stopped after few secs. the program is stopping each time in
while(!NewMessage);


it will stop here until new message will not come is new message indication is come in Proteus it will goto next when NewMessage=1 it will only 1 when modem respond with indication

If i write any thing on protues virtual terminal its not getting detected.! i dont know why?


when proteus in runing right click on hyper terminal and tick the option
"echo character display"
then u will see as u write by keyboard on hyper terminal
there is also a option of hex mode if u tivk that then u will see every thing in hex that mode is useful when values not an ascii
hyper terminal display only 9 only when 0x39 will come if 0x09 come it will not display then if u change mode to hex then it will display 0x09 this mode is useful there
in code remove braces below while(!NewMessage);that may cause a problem
do it as
while(!NewMessage);  // wait here for notification
IE=0x00;
lcdcmd(0xd4);
lcddata('I');
delay(10);
NewMessage = 0;
read_notification();
IE=0x90;

all new message notification is done in interrupt portion
u will see that in hyper terminal
use COMPIM physical model in Proteus and connect modem to ur pc serial port now Proteus will send a real data to ur pc port it will received by modem now modem send data back u will also see this in Proteus on hyper terminal
use 2 hyper terminal one of tx and one for rx with compim
in this way u will seen real simulation
chill with Proteus....
Fri Dec 17 2010, 09:28 pm
#63
send +CMTI:"SM",1 [enter]

and see if you get something
Sat Dec 18 2010, 10:40 am
#64
Hi

Majoka and Ajay thanks for your replys.

I have entered CMTI: "SM",1[enter]

its reseting the controller as you can see in the image. when is send that command to virtual terminal of proteus its entering into the read notification loop, After that its again sending AT, ATe0 nd all.But s per code i have given while(1)
void main ()
{

clear();
	lcdinit();
	lcdcmd(0xd4);
	lcddata('K');
	delay(10);
	init();
SMSString("AT\r"); // AT commands to initialize gsm modem
delay(50);

SMSString( "ATe0\r"); // turn off echo
delay(50);

SMSString( "AT&W\r"); // save settings
delay(50);

SMSString( "AT+CMGF=1\r"); // select text mode for sms
delay(50);
  
SMSString( "AT+CNMI=2,1,0,0,0\r"); // notification of new sms
while(1)// used to stay in loop but its
//coming out of loop as u can see in image
{
IE=0x90;
k=0;
lcdcmd(0xd4);
lcddata('R');
delay(100);
while(!NewMessage);
{
	IE=0x00;
lcdcmd(0xd4);
lcddata('I');
delay(10);
NewMessage = 0;
read_notification();
IE=0x90;
}
//New msg indication.
// +CMTI: "SM",3

}

Same thing is happening in hardware also.


}



Sat Dec 18 2010, 03:08 pm
#65
hi kirangowle
its better u see it in debug mode with Proteus and hardware then u will find a point where exact the error is
Sat Dec 18 2010, 04:08 pm
#66
Hi mojaka,

Proteus and hardware.!! how shall i connect My Controller serial port is connected to GSM modem. then how do i connect to system.Pls help.

In keil debugg mode i have connected proteus but i cant able to find where the problem is because it doesnt run in step/step over mode, it will be repeating in checkbusy() while loop only.
Sat Dec 18 2010, 04:36 pm
#67
Hi,

I did one more test, i removed read_text(msg1,rec_no,time_date) from the read_notification(). Then its working well.
void read_notification()
{

	lcdcmd(0x01);
	lcdcmd(0xd4);
lcddata('Z');
delay(50);
	clear();

	SMSString("AT+CMGR=");
        tx0(MyBuff[12]);
        SMSString("\r");
        IE=0x90;
        delay(100);
       // read_text(msg1,rec_no,time_date);
	clear();
// clear MyBuff[] so that next index no can be stored. 
	clear_mybuff();
}


But i need to display msg on LCD, So Afterwards i placed read_text() in main program. The same problem occurs.
Sat Dec 18 2010, 07:53 pm
#68
Hi

Let us try with only msg display on LCD. I need small funtion of that pls help me out.

void read_msg()
{
unsigned char temp[20],i,j;
i=0;
j=0;
do
{
i++;
}while(msg1[i]!='+');
do
{
 i++;
}while(msg1[i]!='+');
do
{
i++;
}while(msg1[i]!='\n');
do
{
 temp[j++]=msg1[i++];
}while(msg1[i]='\r'); 
	
lcdcmd(0x80);           
lcdstr(temp);            // array having message
delay(20);
return; 
}  


Is this correct.

Sat Dec 18 2010, 09:40 pm
#69
hi
according to ur message do it as
void read_msg()
{
unsigned char temp[20],i,j;
i=0;
j=0;
do
{
i++;
}while(msg1[i]!='+');
do
{
 i++;
}while(msg1[i]!='\n');
do
{
 temp[j++]=msg1[i++];
}while(msg1[i]='\r');
       
lcdcmd(0x80);          
lcdstr(temp);            // array having message
delay(20);
}  

upload ur Proteus file then i edit that to interface with ur hardware
Sun Dec 19 2010, 09:45 am
#70
Hi mojaka,

read_msg() is not displaying the msg on LCD.
here is my code and proteus file.
But in this new read_msg() also the same controller reset problem is occuring.


Get Social

Information

Powered by e107 Forum System

Downloads

Comments

PeterGem
Thu May 16 2024, 06:27 am
Timothywalay
Thu May 16 2024, 04:40 am
Timothypet
Wed May 15 2024, 06:14 pm
RandyBence
Wed May 15 2024, 02:00 pm
JordanDic
Wed May 15 2024, 01:55 pm
DavidDeelf
Wed May 15 2024, 11:16 am
ytaletjkca
Wed May 15 2024, 09:45 am
MildredWoumb
Wed May 15 2024, 04:07 am