free 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

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
say2paul
Sat Aug 02 2008, 07:39AM
 User Offline
Registered Member #8461
Joined: Tue Jun 17 2008, 10:56AM

Posts: 123
Thanked 6 times in 6 posts
I am trying to send an SMS with Wavecom modem using the following code from 8051 uController:

CODE:

printf("AT+CMGS=\"98xxxxxxx8\"");
printf("%c", 13);
printf("This is a test msg");
printf("%c", 26);

delay();
scanf("%s", response);

delay();
LCD("Done: ");

delay();
LCD(response);
 


The SMS is sent successfully, but the response returned by modem is always displayed as AA on the LCD display. But the response should be OK instead as the modem returns the following response when the SMS is sent successfully:

CODE:
+CMGS: 132

OK
 


I tried sending the SMS from hyperterminal with modem using the same command i.e. AT+CMGS, after sending the SMS the modem returns

CODE:
+CMGS: 132

OK
 


Then why the same is not returned in case of 8051??

I also tried to debug by interfacing 8051 to the hyperterminal. The command sent by 8051 display successfully on hyperterminal, when I send something in response to the command from hyperterminal then the same is displayed properly on the LCD.

Then what is the problem with Wavecom modem and 8051, why the response sent by modem is not displayed properly on the LCD?

Can anyone please help me on this!




[ Edited Sat Aug 02 2008, 11:17AM ]
Back to top


say2paul
Sat Aug 02 2008, 08:38AM
 User Offline
Registered Member #8461
Joined: Tue Jun 17 2008, 10:56AM

Posts: 123
Thanked 6 times in 6 posts
I added the following line to the code to stop echo:
printf("ATE0\r\n");

CODE:

printf("ATE0\r\n");
delay();

printf("AT+CMGS=\"98xxxxxxx8\"");
printf("%c", 13);
printf("This is a test msg");
printf("%c", 26);

delay();
scanf("%s", response);

delay();
LCD("Done: ");

delay();
LCD(response);
 


Now the LCD displays ">" instead of "AA"

[ Edited Sat Aug 02 2008, 11:18AM ]
Back to top


say2paul
Sat Aug 02 2008, 11:25AM
 User Offline
Registered Member #8461
Joined: Tue Jun 17 2008, 10:56AM

Posts: 123
Thanked 6 times in 6 posts
This will eat my head for sure...

Now when I added one more scanf("%s", response); the following code is now displaying "+MSG" instead of ">"

CODE:

printf("ATE0");
printf("%c", 13);
delay();

printf("AT+CMGS=\"9872808428\"");
printf("%c", 13);

printf("This is a test msg");
printf("%c", 26);
printf("%c", 13);

scanf("%s", response);
scanf("%s", response);

delay();
LCD("Done ");

delay();
LCD(response);
 


But how..? I am so much confused....

Lets assume everything is going fine, but still it should return +CMGS instead of +MGS.

And in case of "EROR" is displayed instead of "ERROR".

The second character is never show and disarded...

What is happening.. can anyone help..!
Back to top


sashijoseph
Sun Aug 03 2008, 08:03PM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 650
Thanked 141 times in 134 posts
Hi Paul,
I would suggest creating a custom function for serial RX/TX instead of printf/scanf.
Since printf is working OK(sms sent successfully) you could try writing a serial rx function for now.
Else try scanf with hyperterminal,just to confirm...

Let there be music........
Back to top


Shailesh NAYAK
Mon Aug 04 2008, 03:31AM

 User Offline
Registered Member #2498
Joined: Mon Jul 23 2007, 01:20AM

Posts: 39
Thanked 9 times in 7 posts
Hi,
+GMGS: 132 is counting of messages sent from the modem, It will be last upto 255 and will start again from "0" as it complete 255. You can either ignore this and can only rely on OK.

Best Regards

Shailesh S. NAYAK
Back to top


say2paul
Mon Aug 04 2008, 04:24AM
 User Offline
Registered Member #8461
Joined: Tue Jun 17 2008, 10:56AM

Posts: 123
Thanked 6 times in 6 posts
I understand your point but my point is that instead of +GMGS: the LCD is showing +MGS:

But if I watch output on Hyperterminal it is +GMGS:

Can anyone guide me through this!
Back to top


shyam
Mon Aug 04 2008, 08:27AM

 User Online

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

Posts: 725
Thanked 108 times in 104 posts
may be it is indeed +CMGS instead of +MGS

and may be it sends OK instead of AA

what i mean is I will prefer that portion os the code when u are displaying the scanned response!


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


say2paul
Tue Aug 05 2008, 12:30AM
 User Offline
Registered Member #8461
Joined: Tue Jun 17 2008, 10:56AM

Posts: 123
Thanked 6 times in 6 posts
Yes it is +CMGS when watching output on hyperterminal but +MGS with LCD..

shyam wrote ...

what i mean is I will prefer that portion os the code when u are displaying the scanned response!


Prefer means??
Back to top


Ajay
Tue Aug 05 2008, 09:07AM
Rickey's World Admin

 User Offline

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

Posts: 4042
Thanked 753 times in 712 posts
he mean that he want to see the code where you have displayed the response on lcd

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


 

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