Shop OBEX P1 Docs P2 Docs Learn Events
hyperterminal and basic stamp integration — Parallax Forums

hyperterminal and basic stamp integration

James2010NGJames2010NG Posts: 10
edited 2010-07-28 17:51 in BASIC Stamp
We were wondering how we can put hyperterminal results into the DEBUG terminal for basic stamp 2. We are inputting AT commands to HyperTerminal and we want to display the "OK" in the debug terminal. Any help? Thanks in advance.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2010-07-22 18:02
    The first answer is "you can't" -- your PC only allows ONE program at a time to control the serial port, and if Hyperterminal is controlling the serial port, then the DEBUG window can't control the serial port.

    The second answer is "you'll need some more hardware" -- if you have a second serial port on your PC, or add one with another USB to Serial converter, you can then add a TTL to RS232 adapter card ($12 or so from Kronos Robotics) to use some other pin on your BS2 as a serial port.
  • James2010NGJames2010NG Posts: 10
    edited 2010-07-22 18:05
    So, we couldn't use a SEROUT to the HyperTerminal followed by a SERIN from HT to BS2?
  • FranklinFranklin Posts: 4,747
    edited 2010-07-22 18:53
    If the only terminal you have connected is Hyperterminal then you can talk both ways the stamp will send to HT and HT can send to the stamp. What allenlane3 was saying is you can't then display the response in the debug screen but the stamp will know what was sent and can act on the response. They make usb to ttl cables in both 5v and 3.3v.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • James2010NGJames2010NG Posts: 10
    edited 2010-07-22 19:16
    Any idea on how I can write the code so that when I SERIN from the GM862, the "OK" s are shown in the DEBUG terminal if the HT is closed? BTW, I have A GSM Module - GM862 bread boarded to the basic stamp 2 and we want to eventually get the messages from the SIM card on the DEBUG Terminal, but first we have to get an "OK".
  • FranklinFranklin Posts: 4,747
    edited 2010-07-23 03:45
    Provide your circuit, links to the parts you are using and your code so we can see the big picture.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • James2010NGJames2010NG Posts: 10
    edited 2010-07-27 13:55
    Okay so we have a Telit GM86-2 quad and a BS2.
    GM862 documentation: www.gm862.com/en/products/gsm-gprs.php?p_id=12&p_ac=show&p=4

    http://www.gm862.com/en/products/gsm-gprs.php?p_id=12&p_ac=show&p=4 (if I messed the above one up)

    On the GM862:
    TXD PIN 1
    RXD PIN 2

    thats all we need.

    For starting off, we want to debug an "OK"
    so we have:

    response VAR Byte(5)

    SEROUT TXD, 84, [noparse][[/noparse]"AT", CR]
    SERIN RXD, 84, [noparse][[/noparse]STR response\5\CR]
    DEBUG STR response


    what happens is that this will display on hyperterminal, it will show
    AT
    OK
    but we cannot transmit the "OK" from HT to DEBUG. The DEBUG stays blank?
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-07-27 14:29
    It looks like the "SERIN" is stopping when it recieves the <CR> character after the AT -- which is what you've told it to do with that "CR" there at the end of the SERIN instruction.
    So, to get the OK, you'll need:
    SERIN RXD, 84, [noparse][[/noparse]STR Response\5\CR, STR Res2\5\CR]

    Or, you could just remove the "\CR" from the end and get it all. Note the STR modifier terminates a string with a "NULL" ( CHR(0) ) character, so you'll need Byte(6), not Byte(5).
  • James2010NGJames2010NG Posts: 10
    edited 2010-07-27 14:47
    Thank you sooooooooo much!
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-07-27 18:07
    Glad it works for you.
  • James2010NGJames2010NG Posts: 10
    edited 2010-07-28 17:51
    You wouldnt happen to know how to read JUST the message from the SIM card in the GSM? Any ideas. We have

    ...
    ...
    serout Tx,84,[noparse][[/noparse]"AT+CMGR=1", CR]
    serin Rx, 84, [noparse][[/noparse]WAIT("xxxx"STR response\25, command] the xxxx is the last 4 digits of phone number
    debug str response

    we are sending a text message containing one letter that we want to initialize a new subroutine, thus the command variable.
    we have then if command = "blank" then do
    "blank"
    and so on. But we only get random symbols with the WAIT("") command. If we take it out we get the first 20 ish characters of what shows in the HT. We cant JUST read the message.
Sign In or Register to comment.