Discussion in "Embedded GSM Development" started by    turker1    Aug 10, 2008.
Sun Aug 10 2008, 08:31 pm
#1
Hi again. I connected T290i with pc. I get "OK" from hyperterminal.And I connect phone to mcu.
#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.
#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.
Tags 16f628delay msms 40output pinxmit
Mon Aug 11 2008, 02:38 am
#2
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?
Tags mcuresistors
Mon Aug 11 2008, 01:51 pm
#3
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.
Tags correct responsecharsmodemnok
Mon Aug 11 2008, 04:33 pm
#4
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.
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");
}
Wed Aug 13 2008, 11:31 am
#5
Hi,
Remove \n after AT \r. Please use only \r
Fri Nov 21 2008, 04:39 pm
#6
Hello

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

I dont understand the purpose of ATD8091

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

ChrisLub
Tue Apr 23 2024, 05:21 pm
Davidbab
Tue Apr 23 2024, 10:41 am
Richardrit
Tue Apr 23 2024, 09:54 am
HenryLaf
Mon Apr 22 2024, 03:50 pm
bleradrar
Mon Apr 22 2024, 06:38 am
ppu-pro_ka
Sun Apr 21 2024, 07:39 pm
Infewow
Sun Apr 21 2024, 06:30 pm
HumanTak
Sun Apr 21 2024, 12:26 pm