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
turker1
Sun Aug 10 2008, 08:01AM

 User Offline
Registered Member #6471
Joined: Wed Mar 05 2008, 11:52PM

Posts: 69
Thanked 0 times in 0 posts
Hi again. I connected T290i with pc. I get "OK" from hyperterminal.And I connect phone to mcu.
CODE:
#include <16F628.h>
#use delay(clock=4000000)
#use rs232(baud=9600,parity=N,xmit=PIN_A2,rcv=PIN_A1,bits=8)

void main()
{
printf("AT\r\n");
delay_ms(1000);
printf("ATD8091\r\n");
}
 

This code calling 8091 . i tried it is ok.
But when i want to get result a command , i cant.
CODE:
#include <16F628.h>
#use delay(clock=4000000)
#use rs232(baud=9600,parity=N,xmit=PIN_A2,rcv=PIN_A1,bits=8)

void main()
{
printf("AT\r\n");
if (getc()=='O') output_high(PIN_A0);
}

For this code I sent "AT" .So the message "OK" came. The first letter "O". The mcu doesnt output PIN_A0 high.
I think the problem is speed. MCU or phone is faster than the other one. How can i solve this problem.
Thanks for advice.



electronic lover
Back to top

16f628   delay ms   ms 40   output pin   xmit   


turker1
Sun Aug 10 2008, 02:08PM

 User Offline
Registered Member #6471
Joined: Wed Mar 05 2008, 11:52PM

Posts: 69
Thanked 0 times in 0 posts
Hi.One more thing , if i use max232 i cant send commands. first codes doesnt work if i use max232.
maybe i must use resistors with mcu and phone?

electronic lover
Back to top

mcu   resistors   


Ajay
Mon Aug 11 2008, 01:21AM
Rickey's World Admin

 User Online

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

Posts: 4042
Thanked 752 times in 711 posts
you dont get OK as it is.. modem sends string in this way..

\r\nOK\r\n

so you need to check for the above received chars for correct response.

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

correct response   chars   modem   nok   


turker1
Mon Aug 11 2008, 04:03AM

 User Offline
Registered Member #6471
Joined: Wed Mar 05 2008, 11:52PM

Posts: 69
Thanked 0 times in 0 posts
With this code sometimes nothing appears on LCD, sometimes 'e' appears, sometimes 'ATe' appears. What is the problem?I used "lcd_putc("e");" to see what happens.
CODE:
include <16F628.h>
#use delay(clock=4000000)
#define use_portb_lcd TRUE
#include <LCD.C>
#use rs232(baud=9600,parity=N,xmit=PIN_A2,rcv=PIN_A1,bits=8)
char s[30];
void main()
{
lcd_init();
printf("ATE0\r\n");
delay_ms(1000);
printf("AT\r\n");
gets(s);
printf(lcd_putc,s);
lcd_putc("e");
}


electronic lover
Back to top


Shailesh NAYAK
Tue Aug 12 2008, 11:01PM

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

Posts: 39
Thanked 9 times in 7 posts
Hi,
Remove \n after AT \r. Please use only \r

Best Regards

Shailesh S. NAYAK
Back to top


Izzal
Fri Nov 21 2008, 03:09AM
 User Offline
Registered Member #5690
Joined: Sat Jan 26 2008, 01:59AM

Posts: 12
Thanked 0 times in 0 posts
Hello

Why you using printf("ATD8091\r\n");

I dont understand the purpose of ATD8091

Izzal
sheikhizzal@gmail.com
(679)9211622
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