That is correct.Now corredct me if i'm wrong the pic will not pass the second line of the code(SERIN2 PORTC.7,16468,[WAIT ("OK")]) unless it received OK is that coreect?
That is correct.Now corredct me if i'm wrong the pic will not pass the second line of the code(SERIN2 PORTC.7,16468,[WAIT ("OK")]) unless it received OK is that coreect?
Dave
Always wear safety glasses while programming.
Thanks a lot for the response.
Here is the latest i was able to receive a text messege,TIME, caller id(C_ID) and dispaly the exact length of the message.
I don't know why but it seems that the modem is responding with the commands i send first then the answer for ex :
SEROUT2 PORTC.6,16468,["AT+CMGR=1",13,10]
the modem will respond AT+CMGR=1 THEN the rest (+CMGR: "REC........"), I found that by making LCDATA var byte(80) and display all 80 chars received(max chars in my 20x4 lcd), But the modem will not do that with hyperterminal if you enter AT+CMGR=1 in hyperterminal the response will be ERROR if no messages or +CMGR:....., So i decided to just look for READ after AT+CMGR=1 and... and it worked.rs232 at the modem side is 4=6 and 7=8 before i tried 1=4=6 but the modem didn't respond at all.
************************************************** **************
MAIN:
serout2 PORTC.6,16468, ["AT",13,10]
SERIN2 PORTC.7,16468,[WAIT ("OK")]
SEROUT2 PORTC.6,16468,["AT+CMGR=1",13,10]'read messaage at SIM #1
SERIN2 PORTC.7,16468,[wait ("READ"),SKIP 4,STR C_ID\11,SKIP 4,STR TIME\17,SKIP 6, STR LCDATA\20\10]
LCDOUT $FE,1
LCDOUT $FE,2
LCDOUT STR TIME\17 'display date and time
FOR J=1 TO 20
IF LCDATA(J)=13 THEN' wait for 13 char then put in LA where la is length of the message
LA=J
GOTO GOTLA
ENDIF
NEXT J
GOTLA:
LCDOUT $FE,$C0
LCDOUT "SMS LA=", DEC LA ' display the length of the message
LCDOUT $FE,$D4
LCDOUT STR LCDATA\LA'display the message
END
************************************************** ****************
since i got the WAIT command to work and i used it to read the messages, I don't care if it is read or unread for now i only sent one message and i try to read it. Still having problem with the connection between the pic and the modem with the above setup will work but when i turn the power off it may work or not then i try again and it will work, I don't know if it's a speed problem as you mention before or just a loose connection(breadboard)...
Once again thank for any help
Best regards,
Joe
Bookmarks