Parallax Serial Terminal - Are you connected?
MJHanagan
Posts: 189
I am trying to find a way to test if my Propeller is connected to a computer, and if connected is the computer running the Parallax Serial Terminal program (and in the enabled state). Essentially I want the Propeller to figure out if it should keep using the PST object or skip it because the computer isn't connected or listening.
My Propeller program stops running if the Parallax Serial Terminal isn't enabled on the computer. My guess is the PST's Tx buffer gets full so it sits in a waiting mode until empties. I don't see a TxCheck routine where I could send a small text string then query the Tx buffer to see if the characters went out and were received by the computer screen.
Any suggestions on a way to do a quick check of the PST's connection status?
My Propeller program stops running if the Parallax Serial Terminal isn't enabled on the computer. My guess is the PST's Tx buffer gets full so it sits in a waiting mode until empties. I don't see a TxCheck routine where I could send a small text string then query the Tx buffer to see if the characters went out and were received by the computer screen.
Any suggestions on a way to do a quick check of the PST's connection status?
Comments
Are you sure your Prop is powered during this time? IOW, if it's receiving power via USB and there's no connection, it may not be receiving power.
-Phil
I preface all of my PST statements with "if debugsw == true"
best regards
Stefan
I am still interested in figuring out if the computer is connected and the serial terminal program is running and enabled. I could gain another much needed cog if I'm not actively running the serial terminal debug routines.
Nice, that at least tells me if the USB cable is connected so I'm halfway there.
Any ideas on figuring out if the Parallax Serial Terminal program is enabled?
Don't think that's feasible. PST opens a comm port and waits for data to arrive (or for you to send data). Don't see any way the propeller can determine what the PC is doing at the other end.
I want to re-open the minds:
What do you want to do in the end? If you really need the last cog - How would you do some more serial debbuging if all cogs are engaged?
Give us an overview over your project. I guess there are other possabilities to save a cog.
What kind of debug-info do you need? Lot's of variable values or just "my program runs now method xy?"
Second could be made visible by 2 or 3 LEDs lighting them up in different combinations.
as stated above PST opens the comport and that's it.
If you would code a serial terminal on your own this prg could send a "hello is there a prop answering?" bytesequence so the prop has something to receive.
Of course you can do that by hand through typing in PST.
I'm not sure if this works: you could check the logic level of the IO-PINs before the serial object is started. Maybe there is a reproducable logic level on Rx Tx with PST closed
and another combination of low-high on Rx/Tx when PST opened the comport.
best regards
Stefan
Massimo