Hi everyone, I am new here and I need some help with my project. I currently have a project which I need to interface the GSM module with the microcontroller which is PIC16F877. Im having a hard time figuring out how to use the usart commands specifically the usart_read/usart_read_txt and usart_write/usart_write_txt.
Using mikrobasic and its USART terminal that would act as the GSM module how can I call and use a text format to trigger specific ports of the microcontroller?
Ex. if text = "activate switch 1" then
port A = 0
port B = 1
end if
thanks for the response, but what I need to know is that when I send an SMS to the GSM and it will be sent to the microcontroller, how will i program this using mikrobasic? I just need any idea about this, The SMS that I will send may contain text or numbers? thanks for the help.
In the controller program, store the incoming data in a array or store it as string. Then read the complete array. use the command AT+CMGR=1,
and after doing this store it in an array.. the array size depends on your requirement.
As ckshivaram said, the command "AT+CMGR=1" means that you will read the SMS from location "1".
To receive your message in the controller, you need to know the size of the coming SMS.
The maximum number of characters contained in a single SMS is 160 characters. So, you are expecting a single SMS, then define an array of "Byte" of 160 elements and receive your SMS in this array.