thank you ... am sorry but i am a beginner ...
when interfaciing pic with the gsm do i need to use zigbee/xbee ... (is it a must)
i am just testing and trying to send from the gsm to the PIC to turn on a light
No, you don't need Zigbee/XBee. You send SMS to GSM modem with SIM card. Then say at every 5 seconds you read the say first message (message index of your SMS) and then parse the message and extract the command you sent through SMS like *Device Off*. Based on this command you control the device (using Relays).
yes am done with the configuration and i've sent a test msg from the MCU through the GSM to another mobile device but now i want to send a command to the MCU through the GSM
i can see that all i need is a relay because am controlling an LED not an appliance
Save all messages in your SIM to memory and then delete all messages so that message index is 0. Now send SMS to the GSM modem. The message will be stored at index 1. Now send READ message 1 command from MCU to modem and use ISR and ring buffer to read in the modem response. The modem response will be dumped into the buffer. Now parse the message and extract the SMS message you sent. Now use a if condition to test if message received is xyz then turn ON/OFF LED.
If you need further help then post the image showing the Modem response for AT+CMGR=1 command in hyperterminal .
Before that you need to do some initialisation regarding the SMS commands..
1. AT+CMGF=1 ///SET THE MESSAGE FORMAT
2. AT+CNMI //USE THIS FOR SMS MESSAGE INDICATION..IF THIS IS NOT SET THERE WILL NO NOTIFICATION FROM THE GSM ON YOUR MCU..
3. In the interrupt capture the responses given by the GSM module...
4. Validate the responses in your main routine..
5. If SMS received indication comes, then send AT+CMGR=1<ENTER> get the response captured in UART interrupt..
6. Now take the action in the main routine...based on the SMS...
See attached project. Simulation video inside .rar file. Change message index to your message index in AT+CMGR=45 and AT+CMGD=45 commands. My index was 45.Send 2 SMS like "*LED ON*#" or "*LED OFF*#" to your mobile and then issue AT+CMGL="ALL" command and note down the message index of the SMS. Use this index in code in the above mentioned two commands. Now send SMS like above and test the working.