Shop OBEX P1 Docs P2 Docs Learn Events
Parallax Serial Terminal — Parallax Forums

Parallax Serial Terminal

Vega256Vega256 Posts: 197
edited 2012-07-04 16:15 in Propeller 1
Hey,

I've been using the Propeller Tool for a while now; I suppose about two years. I always opened up the serial communicator, but not really knowing what it was for. I knew I could reset the Prop from the PC, but that was it. I see now that there is a serial communications object here for comm between the Prop and the serial terminal in the Prop Tool. Could this be used for debugging?

Comments

  • turbosupraturbosupra Posts: 1,088
    edited 2012-07-02 17:42
    Absolutely, I'm not sure how you debugged without it?

    You can not only receive serial data to it, but you can also send to it if you write code to handle the received bytes.

    To write to the terminal you have to attach the pst object that I've attached to this post as an object in your code
    OBJ
    
        pst : "Parallax Serial Terminal"
    


    then you start the object like so
    pst.Start( 115_200)  or the baudrate of your choice that matches the terminals settings
    


    then to write strings it is
    pst.str(string("string here"))
    


    for characters it is
    pst.char(3)
    


    for numbers it is
    pst.dec(11111)
    


    for hex it is
    pst.hex(hexVariable, 32)
    


    for binary it is
    pst.bin(binVariable, 32)
    


    and for a carriage return it is
    pst.char(13)
    


    How have you debugged in the past?
  • Vega256Vega256 Posts: 197
    edited 2012-07-02 17:49
    I haven't been...
    I guess I've been just struggling in the dark. Thanks; this just might make things a lot easier.
  • turbosupraturbosupra Posts: 1,088
    edited 2012-07-02 18:21
    I think that is an understatement. Post here if you have any questions, the pst is invaluable even though I wish there was a debugging method more like visual studio's debugging method, the pst is going to make life much easier then what you have been doing.

    I've made all of the mistakes that you could possibly make, so post here if you have questions.

    Vega256 wrote: »
    I haven't been...
    I guess I've been just struggling in the dark. Thanks; this just might make things a lot easier.
  • turbosupraturbosupra Posts: 1,088
    edited 2012-07-02 19:49
    A few more things.

    Under preferences, I bump the max buffer lines to 8192 so that I can go further back when the code is scrolling 100 lines a second. I also uncheck the box to automatically disable/close port when inactive. This unfortunately removes the functionality that allows the pst to wait up to 10 seconds after clicking the enable button, for the IDE to finish sending the code to the chip, but however it allows you to run the pst when the pst is not the foreground. This second suggestion is purely a suggestion and something I like, but it's subjective of course.

    This also allows me to use 2 pst windows at the same time, as you can launch more then one copy of the application if you are debugging 2 propellers simultaneously. There are other options under preferences as well and other functions under the pst object.
  • photomankcphotomankc Posts: 943
    edited 2012-07-02 19:55
    Vega256 wrote: »
    I haven't been...
    I guess I've been just struggling in the dark. Thanks; this just might make things a lot easier.

    Good lord yes. I write such God-awful code that I can't exist without constant care and feeding from the serial terminal. If you ever get to the point that you need to debug multiple cogs at the same time then SerialMirror is an awesome object that can be included in multiple cogs and allow them all to write data to the terminal window.
  • prof_brainoprof_braino Posts: 4,313
    edited 2012-07-04 16:15
    Vega256 wrote: »
    I haven't been...
    I guess I've been just struggling in the dark. Thanks; this just might make things a lot easier.

    Sounds like you've been putting together a jigsaw puzzle in the dark.

    You want easier, try propforth with teraterm. The whole things is from the command line, and interactive. This should feel more like putting together a jigsaw puzzle with bright lights, and a picture of the solution in front of you.
Sign In or Register to comment.