Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Microcontroller Based Electrical Switching Device via GSM

Status
Not open for further replies.

dijam014

Newbie level 4
Joined
Dec 14, 2010
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,346
Hi everyone, I need help about my project on the interfacing part of the GSM to the microcontroller(pic16f877), I need to control some switching devices(outlets using relays) to turn them on and off using text message(sms) via GSM. I am using mikrobasic as my programming language, and as a temporary replacement for the GSM I am using the mikrobasic usart terminal for testing some codes. Currently I am trying to figure out how to use the usart_data_ready command and I tried the code below. Can anyone kindly share with me some codes regarding this project and any advice or clarifications with the code below. Thanks in advance for the help :D

program readstring
dim txt, delim as char[20]

trisA= %000000

main:
porta = %000000
USART_init(9600)
delim = "ON"
while true
if Usart_Data_Ready = 1 then
Usart_Read_Text(txt, delim) ' read text until "OK" is received
Usart_Write_Text(txt) ' write back what has been read
delay_ms(400)
porta = %011011
else
'if not equal to ON then reply "invalidkeyword" the GSM will send a 'message invalid
end if
wend
end.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top