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] Query related to GSM module - SIM800 (interfacing with PIC18F4550 controller)

Status
Not open for further replies.

htcompany

Junior Member level 2
Joined
Feb 2, 2016
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
220
Hello,

i am using SIM800 GSM modem to interface with PIC18F4550 Controller for the sending and receiving msg/call. But here, i am unable to receive simple AT command also, so plz help me for the Code.

For the reference i am pasting my code plz help me out asap. Thanks in advance.


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
#include <xc.h>
#include "uart.h"
#include "lcd.h"
 
unsigned char data;
 
 
void delay(unsigned int t)
{
    int p,q;
    
    for(p=0;p<t;p++)
        for(q=0;q<2000;q++)
        {}
}
 
 
 
void main()
{
    ADCON1 = 0x0F;      
    TRISB =  0xF0;    
 
    INTCON2bits.RBPU = 0;  
    
    lcd_on();   // initialisation of LCD
    
    lcd_command(CLRSCR); // to clear LCD
    
  
    uart_init();
    TRISA = 0;
    PORTA = 0xFF;
 
    lcd_command(CLRSCR);            //    Clear LCD screen
    delay(5);
   lcd_write_string("Tx:");
   
    tx_data('A');              // Sending 'A' to GSM module
                       
    tx_data('T');            // Sending 'T' to GSM module
    
   lcd_data('A');
   lcd_data('T');
   
   delay(2);
    
     tx_data(0x0D);          // Sending carriage return to GSM module            
     delay(2);
  
  
    delay(1);
    
    tx_data('A');     // ATE0 is gsm command 
    tx_data('T');    // to disable echo in receiver */
    tx_data('E'); 
    tx_data('0'); 
    
    tx_data(0X0D);    // Hex value for "Enter"
    
   
    lcd_write_string_xy(9,0,"Rx:");//space();
     
   
    while(1)
    {          
 
    data = rx_data();
        delay(10); 
    
        if((data=='O') || (data=='K') || (data=='A') || (data== 't'))
        {
            delay(2); 
            lcd_data(data); 
                
        }
     }
}

 
Last edited by a moderator:

i am unable to receive simple AT command also, so plz help me for the Code

It is not clear how long is the delay(10) at the main loop, neither the use of this, but it is likely the reason for loose data.
 

When you send AT command you have to send like "AT\r". Using your UART send character function make a send string function and send the AT\r command as a string and check for \r\nOK\r\n response.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top