something wrong with "coginit" command
ispear
Posts: 20
I have attached the code. I am trying to launch 2 cogs to start the following tasks. The pub ledinit works great, the pub lcdinit does not work at all.
inithelp.spin
What am i doing wrong?
thanks for the help,
-Isaac
inithelp.spin
What am i doing wrong?
thanks for the help,
-Isaac
Comments
the only difference between cognew and coginit ist that you the user determine the number of the cog. All other details stay the same.
If you look through all the objects in the object-exchange - the easy and the high sophisticated ones you will allways find the command cognew.
Almost never coginit.
As long as you always use cognew the propeller-chip itself takes care of finding a free cog.
As soon as you use only a single coginit you the programmer take over the full responsability of starting and stopping for all eight cogs!!!
Regardless if you use coginit or cognew for the rest of the cogs.
Coginit disturbs the automatic of the chip-hardware. If very experienced coders avoid using coginit whenever they can why should you use it?
It is almost black and white: Coginit causes a lot of trouble. Cognew just works without thinking about details.
All 8 cogs are completely identical. If you don't believe write a testprogram that starts cogs by cognew and stops them again thousands of times and see it working flawlessly.
best regards
Stefan
Thank you for the advice. I am just getting started with the propeller platform so I really appreciate all your help.
It worked just like you said.
jazzed,
your explanation made perfect sense. thanks
-Isaac