gsm modem with 16f877a


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Nov 2007
    Location
    sri lanka
    Posts
    24

    Default Re: gsm modem with 16f877a

    Mr.Ioannis

    I HAVE FIND SOME CODE ABOUT AND I WROTE SOME CODE "AT+CMGD"
    I SEND TO MODEM TO SMS "A" BUT NOT TURN ON PORTB.6

    WHAT'S THE WRONG THIS CODE HELP ME
    ' Def
    define OSC 4
    DEFINE HSER_SPBRG 25
    DEFINE HSER_TXSTA 20h
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_BAUD 2400
    DEFINE HSER_CLROERR 1

    sms VAR BYTE[16]

    I VAR BYTE

    'Check sms

    begin:
    HIGH PORTB.7
    HSerout ["AT",13,10]' start comm
    HSERIN 2000,begin,[WAIT("OK")]
    LOW PORTB.7


    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]
    HIGH PORTB.5
    PAUSE 200
    LOW PORTB.5
    I=0

    WHILE I <> 13' count until 13
    if sms[i]=$44 THEN ' searching for letter A ?
    GOTO turnon:
    ELSE
    GOTO back
    I=I+1
    ENDIF
    WEND
    turnon:
    High PortB.6
    pause 1000
    HSerout ["AT+CMGD=1",13,10]
    low portb.6
    GOTO QUERY
    back:
    HIGH PORTB.4
    HSerout ["AT+CMGD=1",13,10]
    PAUSE 100
    LOW PORTB.4
    GOTO QUERY
    END

    xxxxx.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,175

    Default Re: gsm modem with 16f877a

    Are you sure the x y z modem that you have not study yet, is working at 2400 ?

    I am sorry but cannot guess. Nor I have the magic ball to tell me what you have, how it must be set-up. It is your job to do it.

    Ioannis

  3. #3
    Join Date
    Feb 2010
    Posts
    17

    Default Re: gsm modem with 16f877a

    Hi,
    First make sure you connect the pic rx and tx trough 10k resitor to the modem's rx and tx pin, Then you need to tie the handhaking pins together on the modem side.
    Start with pin 7 and 8 tied together and see if u get some data if not then tie pins 4 AND 6.Most modems required handshaking by tieing these pins the modem will be always ready to send and receive other wise it will sit and wait. Good luck hope this will help.

  4. #4
    Join Date
    Nov 2007
    Location
    sri lanka
    Posts
    24

    Default Re: gsm modem with 16f877a

    my sms project
    Name:  DSC05877.JPG
Views: 5049
Size:  35.2 KB
    3 input and 3 out put

  5. #5
    Join Date
    Nov 2007
    Location
    sri lanka
    Posts
    24

    Default Re: gsm modem with 16f877a

    HI.
    how to get tower infomation modem,anybody help me.
    thank you
    kumara

  6. #6
    Join Date
    Nov 2007
    Location
    sri lanka
    Posts
    24

    Default Re: gsm modem with 16f877a

    CHECK:
    portb=%11110000
    HSEROUT ["AT",13]
    HSERIN 5000, ERR, [WAIT("OK")]
    pause 200
    PORTb=%00000000
    HIGH PORTB.4
    PAUSE 15000
    HSEROUT ["at+cmgs=",34,"07xxxxxxxxx",34,13]
    PAUSE 100
    HSEROUT ["SYSTEM OK",26]
    HSERIN 5000, ERR, [WAIT("OK")]
    HSEROUT ["at+cmgs=",34,"0719099795",34,13]
    PAUSE 100
    HSEROUT ["SYSTEM OK",26]
    HSERIN 5000, ERR, [WAIT("OK")]
    low portb.4

    'get initial status
    PortDStatus.0 = PORTD.0
    PortDStatus.1 = PORTD.1
    PortDStatus.2 = PORTD.2
    BEGIN:
    HIGH PORTB.7
    PAUSE 200
    LOW PORTB.7
    if PORTD.0 != PortDStatus.0 then 'sensed change in PORTD.0
    pause 10 'debounce 10 ms
    PortDStatus.0 = PORTD.0 'save new status for PORTD.0
    if PORTD.0 = 1 then
    gosub SEND_SMS0 'send new status report
    else 'PORTD.0 = 0
    gosub SEND_SMS2
    endif
    endif
    if PORTD.1 != PortDStatus.1 then 'sensed change in PORTD.1
    pause 10
    PortDStatus.1 = PORTD.1 'save new status for PORTD.1
    IF PORTD.1 = 1 then
    gosub SEND_SMS1
    else 'PORTD.1 = 0
    gosub SEND_SMS3
    endif
    endif
    if PORTD.2 != PortDStatus.2 then 'sensed change in PORTD.1
    pause 10
    PortDStatus.2 = PORTD.2 'save new status for PORTD.1
    IF PORTD.2 = 1 then
    gosub SEND_SMS4
    else 'PORTD.1 = 0
    gosub SEND_SMS5
    endif
    endif
    PAUSE 10

  7. #7
    Hero000's Avatar
    Hero000 Guest

    Default Re: gsm modem with 16f877a

    Quote Originally Posted by kumara View Post
    my sms project
    Attachment 6608
    3 input and 3 out put
    kumara"" I'm highly interested about it, please tell me about its working formula, efficiency etc.

Members who have read this thread : 0

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