Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
 

Hi to all...
I am doing a project in which i will be interfacing a gsm modem with PIC microcontroller(16f877).. when i connect the gsm modem with PC i can able to send and read the messages in the sim using AT commands in hyperterminal...Then i iniatized UART in PIC send and received data to PC through hyperterminal its working properly...
When i interfaced PIC with GSM Modem i can able to send AT command to GSM modem but the reply "OK " from GSM modem to PIC is not received by PIC...

Example:

AT (Enter)-----In Hyperterminal
OK ------Message from GSM Modem

Compiler:MikroC
Baud Rate:9600 bps
GSM MOdem:Wavecom HT-W2101

I can able to send AT and Enter command from UART to PIC... But i cant able see the reply from GSM modem... but it works well when i interface GSM modem with PC hyperterminal...

Help me...
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top