Hello All,
I am working on a GSM based device control system based on the PIC16F876 and a SIM900 module from Rhydozlabs. The compiler i am using is the FED WIZ-C version 17.02.
I need to be able to control 4 devices but in the meant time just trying to make sure one works before i tackle the rest. The problem is that I want to turn on port RB4 using the command: TV ON with the code as shown below:
then the Device_A turns on. Without commenting out that line then it doesn't turn on. I need to use that line to test the various command strings for the four different devices.
You'll want to check which answers are actually received from the modem and why the comparison fails. This can be either done by operating the PIC16 under an in-circuit debugger or by sniffing the serial interface between processor and modem with dual channel RS232 interface and a suitable tool, e.g. docklight.
You'll want to check which answers are actually received from the modem and why the comparison fails. This can be either done by operating the PIC16 under an in-circuit debugger or by sniffing the serial interface between processor and modem with dual channel RS232 interface and a suitable tool, e.g. docklight.
I have already done that with tools like proteus and Hterm. I see the communication between the uC and the modem. However there are some blank spaces in the responses from the modem and I don't know how to handle such responses. Any help will be very much appreciated.
Thanks a lot FvM for the swift reply to my problem.
I have already done that with tools like proteus and Hterm. I see the communication between the uC and the modem. However there are some blank spaces in the responses from the modem and I don't know how to handle such responses. Any help will be very much appreciated.
In other words, you are stumbling upon wrong assumptions about the format of the modem response.
I presume that the SMS content itself is transmitted correctly. The problem is about the format of the "ReadSMS" (AT+CMGR) response. The correct solution is decode the response according to the at commands specification. At places where a variable number of blanks or other format variations can occur, you should be prepared for it. Instead of expecting the answer at a fixed string position, decode the delimiters.
You'll want to check which answers are actually received from the modem and why the comparison fails. This can be either done by operating the PIC16 under an in-circuit debugger or by sniffing the serial interface between processor and modem with dual channel RS232 interface and a suitable tool, e.g. docklight.
void ReadGsmLine (char*Buffer){unsignedchar receivedData;do{
receivedData = WaitRx ();// WaitRx() for serial *Buffer++= receivedData;}while(receivedData !='\n');}
When I used the Hterms to sniff the responses from the GSM modem, I then noticed that all the responses are sandwiched by the <CR><LF><Response><CR><LF> delimiters. I really need help on decoding the delimiters.
Any help please will be very much appreciated.
Thanks in advance.