Shop OBEX P1 Docs P2 Docs Learn Events
BST - Debugging with the serial window? — Parallax Forums

BST - Debugging with the serial window?

adriadri Posts: 34
edited 2010-11-08 05:14 in Propeller 1
Hi

I'm running BST on mac and would like to send values of certain variables back to the BST serial terminal.

If I hadn't broken my EEE PC last night I'd be doing it using the Prop Tool and Parallax Serial Terminal.

Is it much the same using BST?

TIA

Adri

Comments

  • max72max72 Posts: 1,155
    edited 2010-11-06 06:07
    BST is even better..
    it has a terminal included, and it auto switches off and on when you upload code to the propeller.
    Moreover you can save as txt the terminal contents.

    Massimo
  • adriadri Posts: 34
    edited 2010-11-06 06:59
    Thanks. How for example would I send the value of variable 'x' to the BST terminal?

    Sorry for so many questions but it's been a good while since I propped.

    TIA

    Adri
  • max72max72 Posts: 1,155
    edited 2010-11-06 07:18
    Any code working with prop tool and the serial terminal works out of the box also with BST. So 90% of the obex demo code will have samples available.

    I like the "parallax serial terminal" object.

    in you code:
    Under "object" include
    dbg : "parallax serial terminal"
    

    in your main object start the serial cog, setting the speed
    dbg.start(57600)
    

    the send data to the teminal:
    Strings, numbers or chars:
    dbg.str(string("variable value: "))
    dbg.dec(value) 'converts decimal value to string
    dbg.char(13) ' new line
    
  • adriadri Posts: 34
    edited 2010-11-07 01:12
    Can't get it to work.

    I downloaded the "Parallax Serial Terminal" from obex

    Messing with the education kit code apart from sitching a LED I think this should output "variable value: " to the terminal but it doesn't.

    OBJ
    dbg : "parallax serial terminal"

    PUB LedOnOff

    dbg.start(57600)
    dbg.str(string("variable value: "))

    dira[16] := 1

    repeat
    outa[16] := 1
    waitcnt(clkfreq/4 + cnt)
    outa[16] := 0
    waitcnt(clkfreq/4*3 + cnt)
  • kuronekokuroneko Posts: 3,623
    edited 2010-11-07 03:30
    adri wrote: »
    Can't get it to work.

    Works for me. Make sure that
    1. you set _clkmode/_xinfreq as 57600 baud doesn't work with RCFAST
    2. the terminal is using the proper port/baud rate
    3. the terminal is actually connected (communicate.connect)
  • adriadri Posts: 34
    edited 2010-11-08 04:42
    Great. Got it working now.

    Thanks to all.

    Adri
  • dossicdossic Posts: 38
    edited 2010-11-08 05:14
    Hi!

    I find the bst terminal window very iseful for debugging programs.
    However, I am still unable to send control characters, e.g. ^T, ^V, etc.
    Sorry for disturbing you again, do you have this feature in your add-on list for bst?

    Thanks++

    Carlo
Sign In or Register to comment.