thx in advance, i use pic 16F887 and 4 MHz XT osc, i can send msg, delet it, but with reading is not going well, i noticed that teh voltage on rx line of pic is about 2.3 - 2.4 V, and i asume that is not sufficient. i tried with this code but nothing happends!
Code:'**************************************************************** '* Name : UNTITLED.BAS * '* Author : [select VIEW...EDITOR OPTIONS] * '* Notice : Copyright (c) 2009 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 20/02/2009 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** ansel=$00 anselh=$00 OUTPUT PORTB PORTB=%00000000 ' Def define OSC 4 DEFINE HSER_SPBRG 25 DEFINE HSER_TXSTA 24h DEFINE HSER_RCSTA 90h DEFINE HSER_BAUD 9600 DEFINE HSER_CLROERR 1 sms VAR BYTE[16] I VAR BYTE HIGH PORTB.7 PAUSE 2000 LOW PORTB.7 ' check sms begin: HSerout ["AT",13,10]' start comm HSERIN 2000,begin,[WAIT("OK")] textmod: HSerout ["AT+CMGF=1",13,10]'set text mod HSERIN 2000,textmod,[WAIT("OK")] mem: HSEROUT["AT+CPMS=",34,"ME",34,13,10]' mem location HSERIN 2000,mem,[WAIT("OK")] query: 'HSEROUT["AT+CMGL=",34,"REC READ",34,13,10]' filter for query HSEROUT["AT+CMGL=",34,"REC READ",34,13,10]' filter for query HSERIN 5000,query,[WAIT("REC READ"),skip 41, STR sms\16\13] I=0 WHILE I <> 13' count until 13 if sms[i]=$44 THEN ' searching for letter A ? GOTO turnon: ELSE GOSUB back: I=I+1 ENDIF WEND goto query: turnon: High PortB.6 pause 1000 low portb.6 return back: RETURN End




Bookmarks