Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Interface SIM900 module with 16F877A

Status
Not open for further replies.

tharaka.nw

Newbie level 3
Joined
Oct 3, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,331
Hi All,
I want to interface SIM900 module with 16F877A micro-controller to send some data to my server using GPRS. When I programed MCU to send some AT simple commands like ATD to module through serial interface, it works fine. Although I can send commands to module I can't get any out from module when I control it using MCU. However when it interface to PC using MAX232 it works fine and I got out put from it. I,m sure that module send it response data. Why MCU cannot receive data from module. Actually, I want to send commands to module after considering it response like OK, ERROR.
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
one reason may be the tx and rx pins of serial cable may have to be swapped...
other reason might be if you are using same power supply for both and the power is not enough.
or the program or code may have mistakes

connect the pic board to hyperterminal and see if it responds to your response from terminal...

So instead of modem the response is typed from hyperterminal and see if it receives the response properly.....
 

tharaka.nw

Newbie level 3
Joined
Oct 3, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,331
one reason may be the tx and rx pins of serial cable may have to be swapped...
other reason might be if you are using same power supply for both and the power is not enough.
or the program or code may have mistakes

connect the pic board to hyperterminal and see if it responds to your response from terminal...

So instead of modem the response is typed from hyperterminal and see if it receives the response properly.....

Fist thanks for your reply
I didn't use serial cable to connect these two divices and thy are connected using copper path of PCB and I'm sure that it is correct. However I have used same power supply to both of them and supply flow through the 500mA fuse and it works fine.
I connected MCU to hyperterminal and it reponds to me when I send some reponse as module to it through the therminal. Therefore my programme should be correct and I want to mention that MCU can send commands to module and I have succesfully programed it to do activities like calling and sending SMS. The problem is MCU cannot detect the response of module. Today I connected Tx of module to PC as well as MCU and terminal shows response of module according to programed commands of MCU, but it shows some garbage data also. However module responds to command of MCU correctly, but MCU doesn't receive any resonse. I think it can be problem of logic level of these devices. What is your idea? How can I fix this.
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
check the tx and rx connections. check the baud rate also.. garbage means either the baud rate is not correct or the power supply is not enough.... modem needs more current when doing network operations. check if tx is connected to rx of modem and viceversa....
 

abhichaotic

Member level 1
Joined
Aug 23, 2010
Messages
36
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
noida, india
Activity points
1,479
@ tharaka.nw: I had also encountered the same problem, you should short pin 6 and pin 7 of DB9 connector at the GSM end . I have made a cable for this and it works fine.

---------- Post added at 09:22 ---------- Previous post was at 09:22 ----------

@ ckshivaram: hi, i have properly interfaced the sim900 modem with pic16F877A. When I send command for message, message is also delivered to the destination but "AT+CMGS="0123456789" also comes with this message, I want to avoid this thing.
Could you guide me??
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
with respect to message the number, time stamp, sms center and other information also comes... what is the meaning of avoid....... if you want to avoid , then it has to be at application level, where you discard the number and show only the message......

or tell your requirement properly....
 

abhichaotic

Member level 1
Joined
Aug 23, 2010
Messages
36
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
noida, india
Activity points
1,479
Actually the message at the recipient mobile is like" AT+CMGS= "+919891XXXXXX" fault no.2 ". It should only send the message in the sms body, i don't understand why the commands are going in the message body.

---------- Post added at 11:37 ---------- Previous post was at 11:19 ----------

Earlier i had tried with sim300 modem and it was working, as i advanced to sim900 this problem starts coming?? I have programmed baud rate 9600.
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
Does it happen when you do it with hyperterminal also... check if the end of the character is (0x0a & 0x0d) or it is (ctrl+z).. i think its waiting for some character which it is not getting.....
 

abhichaotic

Member level 1
Joined
Aug 23, 2010
Messages
36
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
noida, india
Activity points
1,479
On Hyper Terminal there is no problem sir, this problem is coming when i am interfacing pic. please have a look at my code.
 
Last edited:

abhichaotic

Member level 1
Joined
Aug 23, 2010
Messages
36
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
noida, india
Activity points
1,479
When i press ctrl z in hyperterminal it waits for some time and then gives "ok", i think i should provide that much delay after each message.
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
use a cro to see how much delay the module takes to respond... and insert that same delay.. as trial and error will give you success or not.. you may be wasting much time...
 

arc987

Newbie level 3
Joined
Jun 28, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
hi all

could you please tell me what is DB9?
i have this problem and im too angry from this problem please tel me
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
DB9 is the connector with 9 pins.. It is also called serial port of the PC. It is called DB9 because it is in the shape of 'D'.

for serial communication you need serial cable with both ends as DB9 connector. the one you have in the USB to serial cable...

if it is DB9 connector then it is called serial cable.... you connect one DB9 pin 2 to pin 3 of other DB9. same pin 3 to pin 2 of other. pin 5 to pin5... and try.. if i does not work then change 2 and 3 connection at one connector end.......
 

arc987

Newbie level 3
Joined
Jun 28, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
tanks to you mr ckshivaram for your fast replying and im going to test it
 

arc987

Newbie level 3
Joined
Jun 28, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
hi all
please tell me which pin for sim900 must be short instead of short pin 6 and 7 db9
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top