Cogs trampling over one another?
Hugh
Posts: 362
What are the possible ways that one cog could trample over others and stop them working? If I start a cog with COGNEW, '6' is returned (so I haven't run out of Cogs) but other processes in other Cogs appear to be halted/not start.
Both referencing the same pin?
Both referring to the same variables?
Anything else?
Thanks
Hugh
Both referencing the same pin?
Both referring to the same variables?
Anything else?
Thanks
Hugh
Comments
I have pared the declared stacks to the bone. Stack/Free is 4584 longs according to the F8 ObjectInfo (Program 2907 longs, Variables 697 longs)
Having started all of the cogs I need to, '6' is returned so I haven;'t run out of cogs.
I have deleted 50 longs worth of code.
Even having freed up more space, uncommenting the line marked 'This line' stops everything. In fact, even a waitcnt in that line stops things.
I have added the following PUB and called this via COGNEW before any other cogs are started:
The number returned by the last cog to start is still 6?
Is there a 'head-scratching' icon?
I've learned to make it a general policy to only set pins from a single cog.
Are you using any video display objects? I know there's at least one video object that doesn't declare all the memory it uses.
As usual, I agree with kuroneko. It would really help if you posted your code.
Having called COGNEW several times I forgot to take into account that 'FullDuplexSerial' (called twice) starts a new cog - there won't be one available.
Does anyone know if 'Simple_serial' starts a new cog (it doesn't say it does)?
Off to kick myself - hard!
Thanks
Hugh
No, it doesn't and everything works fine now.
Schoolboy error...