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.

Receiving sms using pic

Status
Not open for further replies.
Its ok with the hyperterminal. It doesnt need to configure CNMI. It was already set by default.and I ahvnt make any change. Here is the current configuration.+CNMI: 2,2,0,0,0
But one thing nw I am getting something on my LCD.So I think that part is ok. But What Iam getting is initial part of the message. +CMT: The other I am not getting. I tried to loop the reading . If I declare an array then nothing will be getting on my LCD.
 

the same thinngs happening
I am getting the msg on my hyperterminal
On lcd,I am getting Ringing when I ring to that number.But not the SMS
 

Nw I trace an error in recieving serial data. The controller recieves the serial data if I am sending characters one by one. If I am sending three or more characters at a time the controller stops recieving the serial data. That why Iam getting first part of SMS. Can you suggest any idea. I am using the PIC microcontroller .
 

#include<16f877a.h>
#include"pic1.h"
#include"lcd.h"
char ch;
void main()
{
lcdinit();
rc3=0;
printf("AT\n\r");
while(1)
{
ch=getch();
printc(ch);
delay_ms(200);
}
}
 

store the getch() in an array and then send it to LCD... and dont send character by character to lcd..
call print to lcd function after storing in the array. as the data speed is high and lcd cannot print that fast
 

Ya, I am connecting the signal GND too.
I am having problem in recieving side.
 

hi there,
I think we have the same project, but were using sim900.
can I ask for your codes in sending the sms?
just send it at sajo_christian@yahoo.com, tnx a lot.
by the way we're using mikroC in programming.
 

When a new message is received modem get at+CNMI indication (New Message Indication). You can Write program to send AT+CNMI and get response. when getting responseget it means new message is received. which will be stored in SIM, read the particular location.
If you dont know the location then clear the SIM messages then all incoming messages are stored in location 0. you can read that location and delete it so that all messages are stored in same location.

refer AT commands PDF for more details

Hi ckshivaram,
I found your instruction quite helpful. But the performance of my GSM module is quite strange. When I try to test what it replies after I send "AT\r\n", it just shows "AT". And I try to test the response of other commands like "AT+CMGF=1\r\n" it still replies "AT". So I thought maybe AT means OK, but when I tried some command which is not supposed to be replied of "OK" like "AT+CPIN?\r\n" it also replies "AT". I tried to google this problem but it seems nobody else has ever encountered this problem before. So what is your opinion on this problem?
BTW, I can receive sms successfully on my mobile phone although I got these weird responses.

Thx a lot!!
 

hi friend..
which compiler you r using here...i am using keil to program the 8051 to send and receive the messages..plz help me how to do that?
 

hi everyone...can anybody send me a picture of how pic16f877a connected to sim900d gsm modem.I really want to learn how to use gsm modem with PIC's.tnx a lot in advance....=')
 

plz anyone help me............i want to control home appliances through sms.................so i m interfacing gsm moodule sim300 with microcontroller ..........but i m not able to connect it................plz anyone send me a circuit diagram for the same
 

hi,
i am doing a project on a gps controlled vehicle. rite now i am stuck with receiving msg from sim900d module. if i connect sim900d with a pc using hyperterminal all of my AT commands work also when i send a msg a msg echo is produced. but when i send a msg to my sim900d module and try to read it via a microcontroller nothing is displayed. i built a test program in which my microcontroller sent AT to sim900d, sim900d rplied with AT OK which i displayed using 8leds. and now when i send a msg to sim900d it doesnot recognise the echo. plz help

i am using a ccs compiler and attachec is a part of my 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
#include <18F452.h>
#use delay(clock=10000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bi ts=8,stream=COM_B, ERRORS)
msgEcho[0] = 'C';
 
msgEcho[1] = 'M';
msgEcho[2] = 'T';
msgEcho[3] = 'I';
msgEcho[4] = ':';
msgEcho[5] = ' ';
msgEcho[6] = '"';
msgEcho[7] = 'S';
msgEcho[8] = 'M';
msgEcho[9] = '"';
msgEcho[10] = ',';
while (True){
recieved = 1;
delay_ms(4000);
if (kbhit(COM_B))
{
fputs("\nStarting...",COM_B);
delay_ms(2000);
a = fgetc(COM_B);
if (a == '+')
{
delay_ms(2000);
fputs("\nMessage Incoming...", COM_B);
for (i=0;i<11;i++)
{
fputs("\nType in:", COM_B);
delay_ms(3000);
a = fgetc(COM_B);
if(a != msgEcho[i])
{
recieved = 0;
break;
}
}
}
if (recieved == 1){
fputs("\nMessage recieved.", COM_B);
}
}
else{fputs("\nMessage NOT recieved.", COM_B);}
} 
}

 
Last edited by a moderator:

hi ckshivaram
i am having problem in receiving an sms using 8051..i do,nt know why i am not able to read the sms..
my code of receiving sms is here..
void wait_for_message()
{
wait:
//usart_puts("AT+CMGD=ALL\r");
while(serial_read()=='+');
for(count=0; SBUF!=','; count++)
{
string[count]=serial_read();
}
// usart_puts(string);
count1=count;
for(count; SBUF!='\r'; count++)
{
string1[count-count1]=serial_read();
}
if(string1[0]=='1' && string1[1]=='1' || string1[1]=='0'|| string1[1]=='2' || string1[1]=='3' || string1[1]=='4' || string1[1]=='5')
{
usart_puts("AT+CMGD=");
serial_send(string1[0]);
serial_send(string1[1]);
serial_send('\r');
goto wait;
}
else
{
usart_puts("AT+CMGR=");
serial_send(string1[0]);
serial_send('\r');
}
delay(500);
count=0;
count1=0;
ES=1; // enable serial interrupt
EA =1;
}
void read_message()
{
while(serial_read()=='+');
select=0;
for(count1=0; SBUF!='\r'; count1++)
{
string1[count]=serial_read();

}
count=count1;
select=1;
for(count1; SBUF!='!';count1++)
{
string[count1-count]=serial_read();
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top