T290i with Pic16f628
Discussion in "Embedded GSM Development" started by turker1 Aug 10, 2008.
Sun Aug 10 2008, 08:31 pm
Hi again. I connected T290i with pc. I get "OK" from hyperterminal.And I connect phone to mcu.
This code calling 8091 . i tried it is ok.
But when i want to get result a command , i cant.
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
#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.
Mon Aug 11 2008, 01:51 pm
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
\r\nOK\r\n
so you need to check for the above received chars for correct response.
Mon Aug 11 2008, 04:33 pm
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"); }
Fri Nov 21 2008, 04:39 pm
Hello
Why you using printf("ATD8091\r\n");
I dont understand the purpose of ATD8091
Why you using printf("ATD8091\r\n");
I dont understand the purpose of ATD8091
Powered by e107 Forum System