1. I've bought a GSM Modem, containing SIM900 module and successfully able to send AT Commands to it through my PC using Hyperterminal.
2. I also have an 8051 circuitboard with Serial interface and programmed it in C to receive/send(exclusively) strings serially though UART. I'd like to control the state of an led(On/Off) on the circuit board as per the message received. i. For reception of strings(what the program does): a. If the string contains 'On', it should turn on the led. b. If the string contains 'Off', it should turn on the led.
ii. For sending strings: Sends AT commands to the modem.
3. I have written a Java program to send AT commands to hte modem and receive and display the responses from the modem on the console which works perfectly.
4. I interfaced the modem and the 8051 circuit board using RS232 and found that it wouldn't work. Sending On/Off message wouldn't trigger the action to put On/Off respectively the led. So I tried to send AT command to delete the message stored at location '1'(AT+CMGD=1) to the modem, but neither would this work.
5. Hence, in order to troubleshoot the problem I developed another Java program to communicate with my 8051 board. So essentially this 2nd Java rogram of mine simulates the modem. The sending program in 8051 sends the strings and are captured by my Java program and displayed on the console. The response strings from my modem(with the message content) that was captured by my earlier JAva program, I've exactly used them in my 2nd program with the carriage return and line feed characters. This time my C program in 8051 seems to be able to capture the input string properly and take the correct action, i.e turning On/Off the led according to the input.
6. i. PC-GSM MOdem connection: 9600 baud, 8 Data bits, No Parity, 1 Stop bit. Flow Control: None
ii. PC-8051 Board connection: 9600 baud, 8 Data bits, No Parity, 1 Stop bit. Flow Control: None
Kindly suggest what the missing link could be? Why is 8051 not able to communicate with the modem and vice versa? Please do let me know if any more details are required.
yes, Per I missed that
OP: did you use the same cable for PC-modem, PC-your board, and your board-modem?
Have you consider to use a NULL modem cable ?
Since each device communicates with the PC, this means that each device connects as DCE(and the PC is DTE). When two DCE devices have to communicate to each other then the NULL modem cable is the solution(It turns a DCE to be like DTE).
en.wikipedia.org/.../Null_modem
If the connection uses just 3 wires (TX, RX, GND), then
connect TX to RX, RX to TX and GND to GND between the 2 devices
Of course, serial settings must be the same, baudrate, databits, parity, XON/OFF settings.
...
Unless the two units are "PC" and the OP already is using a null-modem cable. Then a straight or cross-over cable isn't the answer to the problem.
TX connected to TX is one of all the things that would show up if looking at an oscilloscope or using a multimeter because of the fight to control the signal levels - while RX connected to RX would show up as a quite idle signal line.
And if the communication - quite unlikely - is set up to expect RTS/CTS or DSR/DTR then it would be really silent on all signals. But the voltage levels would indicate the incorrect state of the handshake.
Those old communication testers with LEDs for each signal line really did help a lot when quickly indicating cabling issues. Simple, but very effective: www.artekit.eu/.../