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.

pic interface with gsm

Status
Not open for further replies.
yes,I have written code to read the message using GSM it worked but the problem is how to display that message in hyperterminal or else in LCD.please guide me

---------- Post added at 14:08 ---------- Previous post was at 14:02 ----------

yes,i hjave written code to read the message using GSM it worked how to display the message in hyperterminal or in LCD..
 

connect the controller board to pc hyperterminal and run the program... send the gsm commands to terminal instead of modem connected... you should see commands printed in terminal window. and from hyperterminal you type the response as OK instead of modem. and see if the controller sends next command... so in this way you give response your program when it waits for response from modem and check if the program flow is correct and the same behaviour should be seen when you connect modem to your controller board....
 

i checked with this but the problem is that it works with two hyperterminal connect one is for GSM but when we connect the GSM with the Hyperterminal the at commands itself gets displayed and it does not go to next at command it displays first command itself what is the problem please guide me..
I checked the modem also whether the modem is not responding to the at command it is working properly...
 

ok stay cool...... i cant understand your english at all.... go from basics..

forget modem.... connect the controller board to hyperterminal and see if you get the commands on terminal and whether the controller receives your response ( which you type as OK on terminal) and proceed to next command and displays it on terminal window,.....

or send snapshot of terminal window output so that we can look into it.
 

yes i did it. It works then what we have to do.
In this I have used cmgl command as it reads the last message whether this may cause any problem
 
Last edited:

use the same cable and connect modem to hyperterminal and check if modem works???????

---------- Post added at 16:06 ---------- Previous post was at 16:03 ----------

dont use controller board now.... only modem and same cable which you used for testing controller board and terminal....
 

I did it. It works properly then?
 

modem and max is connected using male to male connector (rs232 cable) and terminal and max are connected using male to female connector cable. how to do it.
 

Now that make or buy a serial cable which is male to female...
if you tested individually then ... it makes your project 90 % complete... Makeself or buy one...
if you make it by soldering yourself, then it is good .. connect pin 2 to 2, 3 to 3 and 5 to 5. if it does not work then change pin 2 and 3 connection at one end of cable...
 

use the same cable and connect gsm modem and controller board... use different power supply for gsm and controller board, and test again....

sir,

I can able to send and receive sms, ring tone from/to GSM Modem SIM300 and mobile. All SMS commands works fine. But, when I issue "AT+CLCC" and "AT+CMGR=1" Commands, it also works but program hanged. I have to switch-off the power and restart to do next process. Can you pl help me to locate the issue and guide me to solve this problem.

PIC16F877A
HI-TECH C Compiler
SIMCOM300 GSM Modem

Code:

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include <stdio.h>
#include <htc.h>
#include "usart.h"
#include "lcd.h"
#include "string.h"
 
__CONFIG(HS & WDTDIS & UNPROTECT &  LVPDIS);
 
static unsigned char gsmInput[45];
 
void showGSM_DATA(char GSM_DATA[]){ 
//to show the GSM INPUT after eliminating the chars '\r' and '\n'
    
    if (strcmp(GSM_DATA, "RING") ==0){
        strcpy(&GSM_DATA[0], "");
        strcpy(&gsmInput[0], "");
        puts("AT+CLCC");
        putch(0x0D);
    }
   
    else{
        
        lcd_clear();
        if (strlen(GSM_DATA) > 4){
            lcd_goto(0);
            for(i=0;i<16;i++){
                    lcd_putch(GSM_DATA[i]);
                }
            if (strlen(GSM_DATA) > 16){
                lcd_goto(0x40);
                for(i=16;i<32;i++){
                    lcd_putch(GSM_DATA[i]);
                }
            }
       }
       else{
            lcd_goto(0);
            lcd_puts(GSM_DATA);
       }
    }
   
    strcpy(&GSM_DATA[0], "");
    strcpy(&gsmInput[0], "");
 return;
} // end function showGSM_DATA
 
int main(int argc, char* argv[]){
 
    unsigned char input;
       
    INTCON=0;   // purpose of disabling the interrupts.
    
    lcd_init();
    
    init_comms();   // set up the USART - settings defined in usart.h
        
    puts("ate0");
    putch(0X0D);
    
    puts("AT+CMGF=1");
    putch(0X0D);
    
    while(1){
            
        input = getch();    // read a response from the GSM
    
        switch(input){
            
            case '\x0A': // if line feed detected in the GSM output i.e. '\n'
                        break;
            case '\x0D': // carriage return detected i.e. '\r'
                        
                        gsmInput[i] = '\x00';
                        lenOfGSMInput = strlen(gsmInput);
                        
                        if (lenOfGSMInput > 0){
                  
                            i=0;
                            lenOfGSMInput = 0;
                            showGSM_DATA(gsmInput);
                        }
                        break;
            case '\x3E': // if greater-sign (in order to send SMS)
                        break;
            
        default: // if characters received
                gsmInput[i] = input;
                i++;
                break;
        }//end brace for switch
    } //end brace for while loop
   
 return 0;
}//end brace for main




Dont post your requirement in others thread.........
start a new thread or follow this thread
.
 

the problem in my communication is when i connect all the hyperterminal displays at itself what is the problem
 

sorry i dont understand your english at all.... Your name seems to be indian but your english is different and i cant understand it. let us hope someone helps you out...

if i can understand you better i can give some suggestions.........
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top