PDA

View Full Version : BST - Debugging with the serial window?



adri
11-06-2010, 11:24 AM
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

max72
11-06-2010, 02:07 PM
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

adri
11-06-2010, 02:59 PM
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

max72
11-06-2010, 03:18 PM
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

adri
11-07-2010, 09:12 AM
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)

kuroneko
11-07-2010, 11:30 AM
Can't get it to work.

Works for me. Make sure that

you set _clkmode/_xinfreq as 57600 baud doesn't work with RCFAST
the terminal is using the proper port/baud rate
the terminal is actually connected (communicate.connect)

adri
11-08-2010, 12:42 PM
Great. Got it working now.

Thanks to all.

Adri

dossic
11-08-2010, 01:14 PM
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