Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp and Gsm module — Parallax Forums

Basic Stamp and Gsm module

snake007snake007 Posts: 5
edited 2011-05-17 15:19 in BASIC Stamp
Hi, im triying to send txt msg with the gsm module and th BS-2. I already try usign the gsm module, from the computer and it works, but when i try from the BS-2, nothing happens, if anyone can helpme here its my code. I'll start with the first AT command, but i dont even get the OK response, i really dont understand what its going on.

' {$STAMP BS2}
' {$PBASIC 2.5}
BaudGSM CON 396 '32=19200/84=9600/188=4800/396=2400 bps (BS2&GSM)
TX PIN 3
RX PIN 4
txt VAR Byte(10)

Main:

SEROUT TX, BaudGSM, ["AT",CR] '
PAUSE 5000
SERIN RX, BaudGSM, [STR udp\10\CLS]
DEBUG STR txt

END


Thank you

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-05-01 14:47
    If this GSM works when connected directly to the PC, then I think that you ought to use an INVERTED baudmode (16780 for 2400bps.)

    As it stands, you're knocking out your "AT" and then you have a PAUSE for 5sec (5000ms).

    What's "udp" (it's undefined)

    [STR udp\10\CLS] is N.G.
    BaudGSM CON 16780 '
    TX PIN 3
    RX PIN 4
    txt VAR Byte(10)
    
    Main:
    
    SEROUT TX, BaudGSM, ["AT",CR]   '
    PAUSE 5000                      ' ???
    SERIN RX, BaudGSM, [STR txt\10]
    DEBUG STR txt\10
    
    END
    
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-01 14:54
    Review the description of the SERIN and SEROUT statements in the "Basic Stamp Syntax and Reference Manual" and the relevant sections of the "What's a Microcontroller?" tutorial.
  • snake007snake007 Posts: 5
    edited 2011-05-04 05:32
    PJ sorry, i forgot to delcare the udp var hahahaha, it would be a variable like your 'txt', and i use those 5 sec just to give time to the GSM module to respond, i'll try using that baud you give me thank you.

    Mike, i have read that section on the manual, but i still dont see the problem.

    Thank you, when it works, ill let you now...

    Carlos Romero
  • snake007snake007 Posts: 5
    edited 2011-05-04 12:17
    Still nothing works, i can find any example that works, im really frustared right now..
    Any help please :'(
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-04 12:50
    PJ's answer probably explains it. You send the AT command, the GSM module responds, but your program is still waiting in the long PAUSE and ignores the response. You may need to leave out the PAUSE completely. Remember that the SERIN will wait for the specified data (10 bytes as you've written the code).
  • snake007snake007 Posts: 5
    edited 2011-05-11 12:23
    Hey that could be true, ill try today and let you know...
    thanks xD!


    Carlos Romero
  • snake007snake007 Posts: 5
    edited 2011-05-17 15:11
    It dosent work either Mike :(.
    Dont know what else to do.

    Thank you anyway, let me know if you another solution...

    Carlos Romero
  • LeonLeon Posts: 7,620
    edited 2011-05-17 15:19
    Some GSM modules I've used receive data on TxD and transmit it on RxD. Check the data sheet carefully.
Sign In or Register to comment.