Sign In

Trouble To Send Number From Micro Pic 16f877a To Mobile Through GSM Moudle

Salah salahoo100@yahoo.com Sudan

Hardware: Micro Pic16f877a Software: Mikroc Porgram

The micro send text SMS but when I use it to send number it didn't send number I use the code
UART1_Init(9600); // Initialize Serial Port at 9600 baud rate
Delay_ms(2000);
PORTB=0b10000000;
UART1_Write_Text("ATE0rn"); // AT command for Echo OFF
Delay_ms(1000);
UART1_Write_Text("ATrn");
Delay_ms(1000);
UART1_Write_Text("AT+CMGF = 1rn");
Delay_ms(1000);
UART1_Write_Text("AT+CMGS="0123888888"rn"); // repeet with or diffrint no.
delay_ms(500);
IntToStr(CNT, CNTS);
UART1_Write_text("CNT,CTS rn"); // repeet with or diffrint no.
delay_ms(1000);
UART1_Write(26);
The message I received is CNT,CTS
Please try to help me as far as you could
Regards

Images

Program

UART1_Init(9600);   // Initialize Serial Port at 9600 baud rate
Delay_ms(2000);
PORTB=0b10000000;
UART1_Write_Text("ATE0rn");   // AT command for Echo OFF
Delay_ms(1000);
UART1_Write_Text("ATrn");
Delay_ms(1000);
UART1_Write_Text("AT+CMGF = 1rn");
Delay_ms(1000);
UART1_Write_Text("AT+CMGS="012388778"rn");  // repeet with or diffrint no.
delay_ms(500);
   IntToStr(CNT,CTS);
UART1_Write_text("CNTS rn");      //  repeet with or diffrint no.
delay_ms(1000);
UART1_Write(26);

Replies

R Avinash Gupta
2016-06-07 04:16:08
attach a picture of the SMS as received on your mobile phone ...
R Salah
2016-06-07 05:40:36
Good morning please help I think the code can be written in this way :
UART1_Write_text(CNTS" rn");
Regards
Salah
UART1_Write_text(CNTS"      rn"); 
R Salah
2016-06-07 06:51:20
CNT,CNTS This the SMS which I receive in my phone .
R Avinash Gupta
2016-06-08 04:22:10
In place of line 13 write like this



IntToStr(CNT,CTS);//convert CNT to a string and store in CTS
strcat(CTS, " rn");// append CR LF
UART1_Write_text(CTS);      //  send it to modem
R Salah
2016-06-08 06:28:29
Good morning thank I will try and inform you.
R Salah
2016-06-09 11:54:23
Good day sir
Thank for your replay but the GSM module send nothing. I make the modification as you say
IntToStr(CNT,CNTS);//convert CNT to a string and store in CTS
strcat(CNTS, " rn");// append CR LF
UART1_Write_text(CNTS); // send it to modem
Please can you try help
Regards
  IntToStr(CNT,CNTS);//convert CNT to a string and store in CTS
strcat(CNTS, " rn");// append CR LF
UART1_Write_text(CNTS);      //  send it to modem
R Avinash
2016-06-09 14:09:42
Be sure to give the slash before r and n. They are not getting shown in here in the code.

Post a reply to Salah

Think you can help Salah ? Then post your thoughts that might help Salah . You will earn a lot of reputation in the technical community.

If your program is in multiple files, then ZIP the entire folder and attach below

Images and Screenshots

These helps other better understand your suggestion.