Shop OBEX P1 Docs P2 Docs Learn Events
Control Z of the AT command — Parallax Forums

Control Z of the AT command

HavocHavoc Posts: 7
edited 2009-07-24 18:43 in BASIC Stamp
hi,

Does anyone know what is the code·to send the control Z of the AT command in the basicstamp. Urgent need help!·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-22 05:38
    I don't know what you mean by the "control Z of the AT command". Control-Z is pretty straightforward. Control-@ is zero. Control-A is one. Control-B is two. Control-Z is 26. You just need to send a character whose value is 26. If you're using a SEROUT statement, you'd put:

    SEROUT <pin#>,<BaudValue>,[noparse][[/noparse] 26 ]
  • HavocHavoc Posts: 7
    edited 2009-07-22 05:47
    hello. thanks for your reply!
    here's my code, we are using the basic stamp to send the AT command to a GSM module.

    DEBUG "AT", CR
    PAUSE 2000
    DEBUG "AT+CMGF=1",CR
    PAUSE 2000
    DEBUG "AT+CSCA='+6596845999'",CR
    PAUSE 2000
    DEBUG "AT+CMGF=1",CR
    PAUSE 2000
    DEBUG "AT+CMGS='+6592332598'" ,CR
    PAUSE 2000
    DEBUG "Hello",$26,

    can you help to check what is wrong with my codes? thank you.
  • HavocHavoc Posts: 7
    edited 2009-07-22 05:47
    hello. thanks for your reply!
    here's my code, we are using the basic stamp to send the AT command to a GSM module.

    DEBUG "AT", CR
    PAUSE 2000
    DEBUG "AT+CMGF=1",CR
    PAUSE 2000
    DEBUG "AT+CSCA='+6596845999'",CR
    PAUSE 2000
    DEBUG "AT+CMGF=1",CR
    PAUSE 2000
    DEBUG "AT+CMGS='+6592332598'" ,CR
    PAUSE 2000
    DEBUG "Hello",$26,

    can you help to check what is wrong with my codes? thank you.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-22 12:21
    26 is not the same as $26

    One is decimal and one is hexadecimal
  • HavocHavoc Posts: 7
    edited 2009-07-22 14:49
    I put 26 or $26, I still get the error, can you help me check what wrong with my codes?
  • FranklinFranklin Posts: 4,747
    edited 2009-07-22 15:03
    Havoc said...
    I put 26 or $26, I still get the error, can you help me check what wrong with my codes?
    There is nothing wrong with your code as far as the stamp is concerned. What error are you talking about and what are you trying to send to your device? Have you been able to make this work sending the code from a terminal program?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • HavocHavoc Posts: 7
    edited 2009-07-22 15:16
    Basically we try the code on a hyper terminal to test whether the terminal program can send and it succeed, but when we write the codes into the basicstamp it cannot work as I don't know what is the code for the control z to tell the terminal program to send the message because in the hyperterminal we can press control z in our keyboard to send, but what to define of the control z to send in the code of basicstamp.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-22 15:27
    I can't help you. Control-Z is the byte value 26 and "DEBUG 26" will send that byte value. Some programs interpret particular control codes as special and they do something else rather than just send the byte value. I don't know what HyperTerminal does. The Stamp is doing what you tell it to do and, for some reason, that's not what the GSM module needs. The answer will be in the GSM module documentation and the HyperTerminal documentation.
  • PeterHPeterH Posts: 21
    edited 2009-07-23 06:10
    I think Mike is on to something right - the problem is not in the Basic Stamp.

    If you successfully send AT Z to a HAYES Compatible modem this will cause the modem to reset and that is not what you want it to do. There is a full description of AT commands here http://en.wikipedia.org/wiki/Hayes_command_set, but hopefully they are in your Manual also.
    But you have to distinguish between sending characters to the modem which it should modulate and transmit to another modem and Commands which the modem itself should act upon.

    When you write:
    DEBUG "AT", CR ( is the Comma correct ?)
    the modem should return an OK and this is a direct modem command.

    But when you write:
    DEBUG "Hello",$26,

    I guess you want the modem to transmit i.e modulate the "Hello" characters to a another modem, but you are still in command mode. That means you are issuing the "Hello" command to the modem which it does not understand
    To enter Command mode you normally send +++ but I cant remember how to exit command mode though it could be CR CR CR

    So your terminal program is exiting the Command Mode By control-Z but that is not a HAYES command and you have to find the HAYES command to exit command mode before you issue "Hello"

    HTH Peter

  • vaclav_salvaclav_sal Posts: 451
    edited 2009-07-23 18:59
    How do you manage to connect two applications to the same COM port same time?
  • HavocHavoc Posts: 7
    edited 2009-07-24 03:05
    Basically we download the code to the basicstamp using a RS 232 serial port and after downloading finished we plug out the serial port and plug in with the gsm terminal and basicstamp.
  • vaclav_salvaclav_sal Posts: 451
    edited 2009-07-24 18:43
    Ok, makes sense. I got the Hyperterminal to display your code but could not replicate it every time due to COM port "in use" messages.Just trying to find a simple way to troubleshoout "BASIC stamp not found" messages.
    Not makying much progress, but it is not my main project now.
    Cheers
    Vaclav

    ·
Sign In or Register to comment.