coginit vs cognew
atirage
Posts: 2
Hello!
Just one quick question:
If you start a cog and then you stop it, can you restart it without loading the same piece of code again into that cog?
The documentation says about coginit that it can be used to restart a cog, but it does not specificy if it reloads the code also in this case.
Thx!
Just one quick question:
If you start a cog and then you stop it, can you restart it without loading the same piece of code again into that cog?
The documentation says about coginit that it can be used to restart a cog, but it does not specificy if it reloads the code also in this case.
Thx!
Comments
But, another way, if you can spare that cog, is to dedicate a pin, and use WAITPNE. Let the COG sit there until another COG toggles the pin.
When you stop a COG, the cog ram is cleared. You must reload said cog to run it again.
-Parsko
I have a cog which loads a number of bytes from an external eeprom into hub memory using i2c and I have to use this cog a lot of times, so it would have been a good idea to just stop and restart it... something like a thread in the PC's. Anyway I guess I can use that pin toggling idea or even some locks.
Thx again!
Attila
Graham