benajad
Newbie level 2

I have implemented a code for pic16f877a that sends at commands to a modem (gl 6100). I have seen the commands sended by the pic in the hyperterminal and they are right. Also I cand send commands from the hyperterminal to the pic generating an interruption in the pic.
When I send those commands through the hyperterminal the modem responses and send the message.
Im not recieving any signal from the modem. The connections are basicly the next: One 10k resistor from rx pin to 5 V. One resistor from tx pin to 5 V. Those pins are conected to a max 232 and the output to the serial conector to the modem.
The code for the pic is:
Sorry for my english. Thank you very much.
When I send those commands through the hyperterminal the modem responses and send the message.
Im not recieving any signal from the modem. The connections are basicly the next: One 10k resistor from rx pin to 5 V. One resistor from tx pin to 5 V. Those pins are conected to a max 232 and the output to the serial conector to the modem.
The code for the pic is:
Code:
#include <16f877A.h>
#FUSES XT,NOWDT, NOPROTECT,NOLVP
#USE delay( clock = 4000000)
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#use rs232(baud=9600, xmit=pin_c6, rcv=pin_c7, RESTART_WDT, bits=8)
char string[30];
#int_rda
void serial_isr() {
gets(string);
}
void main() {
enable_interrupts(int_rda);
enable_interrupts(global);
delay_ms(1000);
// lcd_putc("Inicia");
while(1){
printf("AT");
printf(0x1a);
printf(0x0d);
// delay_ms(2000);
// printf("recibio... %s",string);
delay_ms(1000);
puts("AT+WIPCFG=1");
delay_ms(1000);
puts("AT+WIPBR=1,6");
delay_ms(1000);
puts("AT+WIPBR=2,6,11,\"internet.movistar.com.co\"");
delay_ms(1000);
puts("AT+WIPBR=2,6,0,\"movistar\"");
delay_ms(1000);
puts("AT+WIPBR=2,6,1,\"movistar\"");
delay_ms(1000);
puts("AT+WIPBR=4,6,0 ");
delay_ms(5000);
puts("AT+WIPCREATE=2,1,\"190.84.22.50\",4420");
delay_ms(2000);
puts("AT+WIPDATA=2,1,1");
delay_ms(2000);
printf(" \Recibio...");
delay_ms(1000);
printf("+++");
delay_ms(1000);
puts("AT+WIPCLOSE=2,1");
delay_ms(1000);
puts("AT+WIPCFG=0");
delay_ms(5000);
}
}
Sorry for my english. Thank you very much.