Why Parallax Serial Terminal cannot do what fullduplexserial can
In the code below the fullduplexserial works, while the Parallax Serial Terminal, doesnt. Notice, there are two versions of the 'go' method.
What am I doing wrong?
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
long stack[10]
byte cog
OBJ
pst : "Parallax Serial Terminal"
debug : "fullduplexserial"
PUB start
cognew(go, @Stack)
{PUB go 'THIS WORKS
debug.start(31, 30, 0, 115200)
repeat
debug.str(string("-"))
waitcnt(clkfreq/5+cnt)}
PUB go 'THIS DOESN'T WORK
pst.start(115200)
repeat
waitcnt(clkfreq/5+cnt)
pst.str(string("+"))
What am I doing wrong?
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
long stack[10]
byte cog
OBJ
pst : "Parallax Serial Terminal"
debug : "fullduplexserial"
PUB start
cognew(go, @Stack)
{PUB go 'THIS WORKS
debug.start(31, 30, 0, 115200)
repeat
debug.str(string("-"))
waitcnt(clkfreq/5+cnt)}
PUB go 'THIS DOESN'T WORK
pst.start(115200)
repeat
waitcnt(clkfreq/5+cnt)
pst.str(string("+"))
Comments
You would be better to post this to the Propeller 1 forum.
To post code (and keep the formatting) enclose your code between (code) and (/code) tags where ( and ) are replaced with the square bracket versions.
So if you had run "Go" in cog 0, you won't have this problem. As it is, you're running "Go" in cog 1 and letting cog 0 die. The serial driver (either one) is likely running in cog 2.
Both PST and FDS start a new cog to run the PASM serial driver. Cog using PASM, don't require the stack scratchpad space like cogs running a Spin interpreter.
Here's a link to a thread where I tried to figure out how the stack space worked. I thought it was very interesting to watch the stack memory get used as different branches of the program were running.