hserin and sms controller


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default thx

    thx ioannis for idea, and i put a hex inverter (invert signal from phone twice) in tx phone to rx pic line and the program is now working. so it search letter A in first readed message in SM location and if it find it turn on led on portb.6
    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'konfigurisi AN pinove kao digital I/O
    anselh=$00
    
    
    ' Definisanje 
    define OSC 4
    DEFINE HSER_SPBRG 25
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_BAUD 9600
    DEFINE HSER_CLROERR 1
    DEFINE LCD_BITS 4
    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 5
    DEFINE LCD_LINES 2
    
    PORUKA VAR BYTE[16]
    
    I VAR BYTE
    
    HIGH PORTB.7
    PAUSE 2000
    LOW PORTB.7
    
    
    ' provjeri nove poruke
    
    pocetak:
    HSerout ["AT",13,10]' pocni komunikaciju
    
    HSERIN 2000,pocetak,[WAIT("OK")]
     LCDOUT $FE,1,"start"
     pause 1000
    
    textmod:
    HSerout ["AT+CMGF=1",13,10]'postavi text mod
    HSERIN 2000,textmod,[WAIT("OK")]
    
    LCDOUT $FE,1,"text mod" 
     pause 1000
    
    mem:
    HSEROUT["AT+CPMS=",34,"SM",34,13,10]' ciljana memory lokacija
    HSERIN 2000,mem,[WAIT("OK")]
    
    LCDOUT $FE,1,"mem loc"
    pause 1000
    
    IP:
    'HSEROUT["AT+CMGL=",34,"REC READ",34,13,10]' filter za query
    HSEROUT["AT+CMGR=1",13,10]' filter za query
    
    LCDOUT $FE,1,"query"
    
    HSERIN 5000,IP,[WAIT("REC READ"),skip 41, STR PORUKA\16\13] 
    LCDOUT $FE,1,"analizing"
    
    I=0
    
    WHILE I <> 13' count till 13 
            if poruka[i]=$41 THEN ' searc leterr A....
                GOTO UKLJUCI:
                ELSE
                GOSUB NAZAD:
          I=I+1
            ENDIF
    WEND
    
    goto ip:
    UKLJUCI:
    High PortB.6 ' turn on led
     end
    NAZAD:
    RETURN
    
    End

  2. #2
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default 1 question

    is there any way to get data fom hserin or hserout statement to lcd?????

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,172


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xxxxxx View Post
    is there any way to get data fom hserin or hserout statement to lcd?????
    Have you used LCD before?

    Ioannis

  4. #4
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    Have you used LCD before?

    Ioannis
    i'm learnig, the idea is to show string from hserout, like "AT+CMGL" on lcd????

    but not like this:

    LCDOUT $FE,1,"AT+CMGL"

    i want to catch up string and diplay it on lcd


    thx for helping!!

    --

    www.mtskola.com
    Last edited by xxxxxx; - 10th March 2009 at 14:34.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,172


    Did you find this post helpful? Yes | No

    Default

    If the string is in the array e.g. my_string and your array say is 16 bytes in length, then do this:

    LCDOUT $fe,$01,STR my_string\16

    Ioannis

    P.S. I suppose that all characters are in ASCII of course.

  6. #6
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    If the string is in the array e.g. my_string and your array say is 16 bytes in length, then do this:

    LCDOUT $fe,$01,STR my_string\16

    Ioannis

    P.S. I suppose that all characters are in ASCII of course.
    thx i'm gona try it tonight after work

  7. #7
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    If the string is in the array e.g. my_string and your array say is 16 bytes in length, then do this:

    LCDOUT $fe,$01,STR my_string\16

    Ioannis

    P.S. I suppose that all characters are in ASCII of course.
    and it's working i can list sms mesages and display it on lcd!!!! thx a lot ioannis

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,172


    Did you find this post helpful? Yes | No

    Default

    You are welcome!

    Ioannis

Similar Threads

  1. Replies: 11
    Last Post: - 19th August 2009, 16:23
  2. problem with the GSM controller
    By Dariolo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th May 2009, 21:33
  3. Replies: 0
    Last Post: - 21st May 2009, 01:58
  4. parsing string from hserin
    By xxxxxx in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 2nd April 2009, 19:42
  5. Reading a SMS to an array
    By KA5MAL in forum GSM
    Replies: 3
    Last Post: - 17th June 2008, 18:24

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts