Too Simple?
Pliers
Posts: 280
in Propeller 1
I have successfully written code using multiple Cognew(s) before, but today I'm having difficulties.
The original program was more complicated, I was experimenting with DACs and ADCs. I got stuck when the Cognew would not launch.
So I took out all the other code until I was left with this, and it still does not launch.
If I launch the Pulser method, not in a cognew, the LED does pulse.
Thanks in advance for any help.
The original program was more complicated, I was experimenting with DACs and ADCs. I got stuck when the Cognew would not launch.
So I took out all the other code until I was left with this, and it still does not launch.
VAR long Stack[9] PUB Main Dira[0]~~ cognew(Pulser,@Stack) repeat waitcnt(cnt + 7000) ' Because I was not sure what the Main method would do if not terminated. PRI Pulser repeat waitcnt(cnt+1_000_000) !outa[0]
If I launch the Pulser method, not in a cognew, the LED does pulse.
Thanks in advance for any help.
Comments
I thought the DIRA[] were global.
There are some Prop details that should be in huge bold type in the documentation. On every page!
Alongside the # thing in PASM.
If the first method a cog runs returns, it automatically does a cogstop(cogid). However, if your cog 0 returns, it will crash since the very bottom of its stack got wrecked by the Pulser cog since the Pulser cog doesn't have a big enough stack.
That reminds me, that I need to add a comment about this into my standard code template. Sometimes months can go by before I write another program, and that is the only way that I can avoid learning the same lesson over and over. I take comfort in knowing that I am not alone.