Hello.. I am doing one project in which msg from GSM is read and it is Displayed to LCD. but microcontroller 89v51 and GSM900A does not communicate every time.. sometimes it successfully happen that AT command from microcontroller is send to GSM and message from any no. to GSM is Displayed to LCD.. bt it's not happening everytime.. i am not getting the solution, Please help.. I have connect 12V,2A supply to GSM.. Microcontroller Rx pin connected to Tx of GSM.. Microcontroller Tx pin Connected to Rx of GSM.. and Ground to Ground.. Please help me. what may be the problem? and how should i fix that.
What he actually said was:
If [the responses from the module] indicate it is in the process of reading the SIM, or connecting to the network ..."
So you need to be reading the responses from the module, and acting accordingly.
The possible responses that the module might provide will be detailed in its documentation
i am reading the response in microcontroller bt i didn't display it to LCD so i don't know what response is getting... should i display it to LCD to know that GSM is giving correct response or not???? and if after doing so there is no correct or desires response then what should i do???
i am sending AT commands. and waiting for response.. sequence AT\r\n monitoring response ATEO\r\n monitoring response AT&W\r\n monitoring response AT+CMGF=1\r\n monitoring response AT+CNMI=2,2,0,0,0\r\n monitoring response displaying on LCD "COMMAND SEND" then as soon as msg will come it will display to LCD..
bt in actual LCD does not display COMMAND SEND. and msg can not be read.. and some time it display COMMAND SEND and msg is also displayed to LCD bt after this if i send another msg it does not displayed on LCD.. . connection is correct.. 12v ,2A supply is also given .. network is also available Sim.. then what is the problem??
Well, you need to understand what is actually happening in your systems.
If displaying stuff on an LCD works for you - then do it.
Other alternatives could be send stuff out of a serial port.
Or blink some LEDs
Or use a modern chip with on-board debug.
Maybe monitor the exchanges between the MCU and modem; eg, see "Debugging Serial Comms" here: www.avrfreaks.net/.../2416751
Or a combination of the above.
Debugging is a key skill in any form of development - hardware, software, whatever: www.avrfreaks.net/.../2418156
So basically not checking the registration state on the network, or if the modem has reached a point where sending/receiving SMS is viable.
Assume Proteus is a poor reflection of reality, if you want your system to work in the real world you're going to have to observe what is actually happening rather that walk through a script that shows no depth of understanding.
What does AT+CREG? report?
Thank you so much Andrew Neil.. I will try all the possible things you maintained... Hope it will definitely solve my problem . if i am having problem again i will again contact you.. thanks again for your guidance..
In putty software AT+CREG? +CREG: 0,1
OK it is the response
Ok, that's great but what does the interaction log look like when you automate that on the 89V51, and the SMS fails to send?
sorry for late reply. i can not read the response from microcontroller... or i have written the program to read data from RX pin .. and display it to LCD. and i am using that program to read response of gsm.. bt in proteus it itdisplys nothing on lcd .. .. another try.. i wrote program in that after sending every AT commnad and reading the respone i m displaying on LCD that "AT+*** send".. and i join lcd between the tx and rx wires i.e microcontroller RX -LED- GSM TX and Microcontroller Tx -LED- GSM Rx to know that are signals is passing between them.. then also no command send.. to check the LED is wroking or not i set my multimeter in continoty mode and cheak the LCD between Microcontroller Rx-LED- GSM Tx .. LCD glows.. as soon as i glows led twice LCD displays "AT+** send". and after 2nd time i glow led twice LCD displays about 2nd command"AT+** send" after giving this type of pulses every command send one by one.. then also msg is not read..
what may be problem???
Sounds like you need to pick a system that's easier to debug or instrument.
Perhaps you should start by coding your application/automation so it runs on a PC via the COM port, so your app talks in place of Putty/Terminal.
This way C code running on the PC can using printf, files, time, etc to debug and better understand the interaction. Unless you can program proficiently on a PC you're going to have an uphill battle programming on an embedded target with difficult/limited internal visibility.
hello Andrew Neil... i have tried almost all the suggestions you maintained in previous reply.. i tried to display it on lcd bt it shows nothing.. i tried to blink LEDs it didn't work.. and instead of tera term i do connection with putty.. i.e microcontroller to gsm and its connection to usb to ttl in putty.. nothing worked.. what i am doing wrong??
so u r saying instead of using proteus and the real hardware . i should interact the GSM with the PC using Serial communication. And not to use Putty!! & to understand completely the working of GSM connecting it with PC. Like how it responds and all using C. so please tell me any best software so that i can make communication of GSM nd PC and send commands by C CODE..
Is the Proteus approach working well for your programming/debugging style?
You'd use a Microsoft or GNU C compiler, the serial port access could be abstracted via a couple of subroutines so ostensibly the same core code could be run on the PC or 8051.
Get the automation and interaction figured out without the circus of a black box you have minimal internal visibility into.
Note that the uVision simulator can direct its simulated UART output to a COM port, and can receive input from a COM port into the simulation:
www.keil.com/.../uv4cl_sm_uartcommunication.htm
See: www.avrfreaks.net/.../2306116
And: www.avrfreaks.net/.../2417261