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 microcontroller interface with GSM SIM 300 problem

Status
Not open for further replies.

DHANANJAYA L

Banned
Junior Member level 2
Joined
Jan 21, 2009
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
0
hello, I have tested the code microcontroller with pc (Computer) on hyperterminal, evrerything is OK. What are the commands? I have written the code it will send same commands but when I connected to PIC micro controller to GSM SIM SIM 300 its not working ...
 

Post your code.


. The following program works successfully when PIC16f877a is interfaced with HyperTerminal.


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
#define _XTAL_FREQ 4000000L
#define HIGH_SPEED 1
 
#if NINE == 1
#define NINE_BITS 0x40
#else
#define NINE_BITS 0
#endif
 
#if HIGH_SPEED == 1
#define SPEED 0x4
#else
#define SPEED 0
#endif
#define RX_PIN TRISC7
#define TX_PIN TRISC6
 
 
__CONFIG(XT & WDTDIS & PWRTEN & BORDIS & LVPDIS &
 DEBUGDIS & UNPROTECT );
#define LCD_PULSE() ((LCD_EN=1),(LCD_EN=0))
 
void wait(unsigned char msec);
void Tx_string(const char *string);
void Tx_byte(unsigned char byte);
void interrupt receive(void);
 
main()
{
TRISC=0b11000000;// Rx pin RC7 only i/p others o/ps including Tx pin
 PORTC=0b11000000;
SPBRG = 25;
 RCSTA = (NINE_BITS|0x90);
 TXSTA = (SPEED|NINE_BITS|0x20);
 
 Tx_string("AT");
 wait(100000);
 Tx_byte(0X0D);
 wait(100000);
 Tx_byte(0X0A);
 wait(100000);
 Tx_string("ATD944xxxxxxx;");
 wait(100000);
 Tx_byte(0X0D);
 wait(100000);
 Tx_byte(0X0A);
 wait(100000);
 while(1);
 }
 
void interrupt receive(void) // interrupt service routine
{
if(RCIE && RCIF)
{
RCIF = 0;
}
else if(ADIE && ADIF)
{
ADIF =0;
}
}
void Tx_string(const char *string)
{
   while(*string){
   TXREG=*string;
   while(TRMT==0);
   string++;
  }
}
void Tx_byte(unsigned char byte)
{
  while(TRMT==0); 
  TXREG=byte;
   
 }



please help me...
Thank you!
 
Last edited by a moderator:

1. Interfacing SIM300 GSM module with microcontroller PIC6f877a

following program works successfully when PIC16f877a is interfaced with HyperTerminal


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
#define _XTAL_FREQ 4000000L
#define HIGH_SPEED 1
 
#if NINE == 1
#define NINE_BITS 0x40
#else
#define NINE_BITS 0
#endif
 
#if HIGH_SPEED == 1
#define SPEED 0x4
#else
#define SPEED 0
#endif
#define RX_PIN TRISC7
#define TX_PIN TRISC6
 
 
__CONFIG(XT & WDTDIS & PWRTEN & BORDIS & LVPDIS &
 DEBUGDIS & UNPROTECT );
#define LCD_PULSE() ((LCD_EN=1),(LCD_EN=0))
 
void wait(unsigned char msec);
void Tx_string(const char *string);
void Tx_byte(unsigned char byte);
void interrupt receive(void);
 
main()
{
TRISC=0b11000000;// Rx pin RC7 only i/p others o/ps including Tx pin
 PORTC=0b11000000;
SPBRG = 25;
 RCSTA = (NINE_BITS|0x90);
 TXSTA = (SPEED|NINE_BITS|0x20);
 
 Tx_string("AT");
 wait(100000);
 Tx_byte(0X0D);
 wait(100000);
 Tx_byte(0X0A);
 wait(100000);
 Tx_string("ATD944xxxxxxx;");
 wait(100000);
 Tx_byte(0X0D);
 wait(100000);
 Tx_byte(0X0A);
 wait(100000);
 while(1);
 }
 
void interrupt receive(void) // interrupt service routine
{
if(RCIE && RCIF)
{
RCIF = 0;
}
else if(ADIE && ADIF)
{
ADIF =0;
}
}
void Tx_string(const char *string)
{
   while(*string){
   TXREG=*string;
   while(TRMT==0);
   string++;
  }
}
void Tx_byte(unsigned char byte)
{
  while(TRMT==0); 
  TXREG=byte;
   
 }




please help me..
Thank u...
 
Last edited by a moderator:

You want to dial a number or send SMS?

You can try this code.


Code C - [expand]
1
2
3
4
5
6
7
TRISC=0b10000000;// Rx pin RC7 only i/p others o/ps including Tx pin
PORTC=0b00000000;
 
Tx_string("AT\r\n");
wait(100000);
Tx_string("ATD944xxxxxxx;\r\n");
wait(100000);

 
Last edited:

Re: 1. Interfacing SIM300 GSM module with microcontroller PIC6f877a

Without a question you are asking for help???
 

GSM 300 with PIC16f877A microntroller problem

Hi please help me.. pic with GSm sim300
 
Last edited:

Re: 1. Interfacing SIM300 GSM module with microcontroller PIC6f877a

1. First the baud rate to communicate with SIM300 gsm module - 115200,8,N,1 (This is the default)
2. Wait till the GSM module sends "CALL READY" to the UART of the microcontroller. Untill you receive this do not send anything to the GSM module.
3. The module comes with default echo mode OFF...that means ATE0.. (this is for your info..to turn on echo use ATE1<ENTER>...)
4. Next send AT<ENTER> to the GSM module..
5. Wait for the response "\r\nOK\r\n"
6. Now test any AT command that you need.

Do not send the \n character to the gsm module after \r...
 

@Dhananjaya

Pls stop posting 3 or 4 postings on the same name with slight change...

Putting 3 or 4 posts on the same doesnt going to help you much...
 

Re: 1. Interfacing SIM300 GSM module with microcontroller PIC6f877a

thank u i will try..
 

Download and install winrar evaluation version. It can also be opened using WinZip. I am attaching the hex file for testing. Rename the file to .hex file. Edit the code and use your mobile number. If you use my .hex file then it will dial to me.

Edit: Hi - Tech Code attached. I have tested it and it is working. Maybe there is problem with modem and micro connections.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
void main() {
 
        TRISA = 0xFF;
        TRISB = 0x00;
        PORTB = 0x00;
        TRISC = 0x80;
        PORTC = 0x00;
        
        UART1_Init(9600);
        Delay_ms(200);
 
        while(1){
        
               UART1_Write_Text("AT\r");
               Delay_ms(1000);
               UART1_Write_Text("ATD9742453836;\r");
               Delay_ms(10000);
 
        }
}

 

Attachments

  • gsmDial.hex.txt
    1 KB · Views: 78
  • Hi Tech C.zip
    62.7 KB · Views: 95
Last edited:

Re: 1. Interfacing SIM300 GSM module with microcontroller PIC6f877a

Sir, i have tested same problem its coming..

- - - Updated - - -

Sir i have tested same problem is coming..
how to find "call READY" to microcontroller from GSM SIM 300 received how to check this using C progrmme from micro controller if you are having this code please post and i will try. because GSM send "call ready" to microcontroller is correct or not otherwise it will send some other garbage values so I have to find what it will send...

Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top