GSM Modem Interfacing with PIC Microcontroller

Status
Not open for further replies.
I have a PIC16F877A which contains program of rreceving sms and sending status to mobile. i have lost the program code. can i get it from PIC by usin any software. iam a newbie. please tell clearly
 

I have problem to send email from plc(s7-200) via gprs modem (simcom-300).
Can you help me what should i have?
Best regards.
 

please, i need the circuit diagram of this project. i would also like to know if a usb port could be connected directly to the RX and TX pins of pic16f877a

- - - Updated - - -

please, i need the circuit diagram of this project. i would also like to know if a usb port could be connected directly to the RX and TX pins of pic16f877a.
Thanks.

iykedapotential@gmail.com
 

I am facing the same problem man...I could not receive ok fro PIC16F877A. baudrate:9600; OSC:11.0592; SBRG: 71? if you found solution please help me..It has been a week I am trying to correct this issue. Thanks for your time
 

i hope when u read my code, u'll figure it out
this code work in atmega128 and the compiler is codevision avr. But i guest it just need to change a little bit.
This code will send next at command when the response is OK. When the response is 'ER' ( i mean error), it will loop back.
Ouw, i'm using LCD 2x16 to screen the response of the modul.

First thing u need to do is connect the modul to PC. And send this at command with hyperterminal
ATE0&W
It's for enable short response and saves the setting into memory SIM900. So u just do that once. Then connect the gsm to your microcontroler.

If the local echo is enable,
Transmit :AT\r
Receive AT\r\r\nOK\r\n

But when the local echo is disable;
Transmit:AT\r
Receive\r\nOK\r\n


It's all in SIM900 datasheet.

Then i wrote this code and it work find.
Code:
unsigned char O;
unsigned char K;
unsigned char IP[12];
unsigned char HTTP[20];
int i,j;
while (1)
      { 
        lcd_puts("welcome");delay_ms(200);lcd_clear();
        delay_ms(6000);
        putsf("AT\r");
        while(getchar()!='\r'); while(getchar()!='\n');
        O=getchar();K=getchar();
        lcd_gotoxy(0,0); lcd_putchar(O);lcd_putchar(K);delay_ms(2000);//u can put away this delay. I put this delay because if i put it away, the screen is to fast. It just for testing.
reload:              
        while(getchar()!='\n');
        putsf("AT+CGATT=1\r");
        while(getchar()!='\r');while(getchar()!='\n');
        O=getchar();K=getchar();
        lcd_clear();lcd_gotoxy(0,1); lcd_putchar(O);lcd_putchar(K);delay_ms(2000);
if(O!='O' && K!='K') goto reload;
        while(getchar()!='\n');     
        puts("AT+CSTT=\"telkomsel\",\"wap\",\"wap123\"\r");
        while(getchar()!='\r');while(getchar()!='\n');
        O=getchar();K=getchar();
        lcd_clear();lcd_gotoxy(0,0); lcd_putchar(O);lcd_putchar(K);delay_ms(2000);
if(O!='O' && K!='K') goto reload;                 
        while(getchar()!='\n');
        puts("AT+CIICR\r");
        while(getchar()!='\r');while(getchar()!='\n');
        O=getchar();K=getchar();
        lcd_clear();lcd_gotoxy(0,1); lcd_putchar(O);lcd_putchar(K);delay_ms(2000);
if(O!='O' && K!='K') goto reload;                  
        while(getchar()!='\n');
        puts("AT+CIFSR\r");
        while(getchar()!='\r');while(getchar()!='\n');
        for(i=0;i<13;i++){IP[i]=getchar();}
        lcd_clear();lcd_gotoxy(0,1); lcd_puts(IP);delay_ms(2000);
if(IP[0]=='E' && IP[1]=='R') goto reload;                    
while(1);   
      }
 
Last edited:

why did u use this loop

for(ctr=0;ctr<3;ctr++)
{
PORTB=0x01;
Delay_ms(500);
PORTB=0;
Delay_ms(500);
}
?????????????????????
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…