SEROUT2 to GSM Modem


Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Aug 2006
    Posts
    6

    Unhappy SEROUT2 to GSM Modem

    Hi,

    I am using a GM862-QUAD GSM modem from Roundsolutions, via AT commands generated from a PIC16F74 running picbasic pro.

    here is my simplified code:

    'Initialising Variables
    TXPIN VAR PORTD.3 'TX PIN
    RXPIN VAR PORTD.2 'RX PIN

    RL1 VAR PORTB.2 'RELAY OUTPUT
    STAT VAR PORTB.1 'STATUS LED

    BAUD CON 396 'BAUD RATE = 2400 N 8 1

    RELAYFLAG VAR BYTE

    ADCON1 = 6

    DEFINE OCS 4

    START:

    pause 3000 ' start up delay

    'first command is to set the text mode
    SEROUT2 TXPIN, BAUD, ["AT+CMGF=1",13] '-- answer 'OK'

    PAUSE 2000 ' 2 second delay to allow modem more than enough
    ' time to respond

    'text setup
    SEROUT2 TXPIN, BAUD, ["AT+CSMP=17,167,0,0",13] '-- answer 'OK'

    PAUSE 2000 ' allow modem to respond

    'send a message without saving
    SEROUT2 TXPIN, BAUD, ["AT+CMGS=",34,"xxxxxxxxxxx",34,13] '--answer '>'
    PAUSE 500 'short delay

    ' add the body of the message ending with ctrl-z
    SEROUT2 TXPIN, BAUD, ["WORK",26]

    PAUSE 500 'short delay
    HIGH STAT 'completion indicator


    STOPLABEL:

    ' stay here when complete
    GOTO STOPLABEL

    The code started life out listening for the responses before continuing - but as I wasn't having much luck with it I stripped all this out!

    Ok, so whats happening or not happening.

    I have setup hyperterminal to send out these exact same commands and this works fine. I also have the luxary of a serial data analyser so I can monitor the data being sent and received. When send these commands via hyperterminal the modem sends the code to the number (note xxxxxxxxxxx - for privacy!) and all is well.

    I then disconnect hyperterminal and instead connect my PIC circuit and let the code above run. I monitor the results on my serial analyser and the commands send to and received from the GSM modem look indentical! BUT THE MESSAGE AINT SENT! I cannot fathom what is going wrong!?

    both the code and hardware seem to function because I get the same serial data - apart from hyperterm generated works and PIC generated doesnt!?

    Can anyone advise.

    Thank you and Regards

    Tom
    Last edited by tommyers; - 9th August 2006 at 07:30.

Similar Threads

  1. Interface Pic --> Max232 --> GSM Modem
    By SangkiMangki in forum GSM
    Replies: 1
    Last Post: - 28th September 2013, 12:57
  2. Serout and 18F87J50
    By Glenn_Webber in forum Serial
    Replies: 8
    Last Post: - 20th November 2009, 14:26
  3. SLOW Serin2 and Serout2
    By dragons_fire in forum General
    Replies: 3
    Last Post: - 26th June 2009, 02:38
  4. Replies: 10
    Last Post: - 14th April 2007, 04:34
  5. PIC18F2550 and GSM modem
    By zach in forum GSM
    Replies: 7
    Last Post: - 28th November 2006, 09:01

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