Watch dog cog
msiriwardena
Posts: 301
in Propeller 1
Hello All,
I am trying to write code for a watch dog cog for my project.I have tested the code and it runs with no issues. What it does is
it monitors Ina[21] and if it is "0" for more than 5.0 secs - it does try to correct it.
code starts with a "Repeat while Ina[21] == 0 " statement.When I start a new cog - cognew statement,the rest of the project works but
the watch dog cog does not seem to seem work although I have LED attached to pin 21 and is off for more than 5 secs.
I have placed the method in many other parts of the program.When placed in a method with a "Repeat loop" the watch dog method work s
but it will not execute the rest of the loop even if I make Ina{21] == 1.
I cannot figure out the problem and any help is appreciated.
Thank you
Siri
I am trying to write code for a watch dog cog for my project.I have tested the code and it runs with no issues. What it does is
it monitors Ina[21] and if it is "0" for more than 5.0 secs - it does try to correct it.
code starts with a "Repeat while Ina[21] == 0 " statement.When I start a new cog - cognew statement,the rest of the project works but
the watch dog cog does not seem to seem work although I have LED attached to pin 21 and is off for more than 5 secs.
I have placed the method in many other parts of the program.When placed in a method with a "Repeat loop" the watch dog method work s
but it will not execute the rest of the loop even if I make Ina{21] == 1.
I cannot figure out the problem and any help is appreciated.
Thank you
Siri
Comments
Thanks,
Siri
Siri
REPEAT
in the first line and indent the rest of it.
Since it is supposed to be a watchdog you do not want to run this just one time, don't you?
Enjoy!
Mike
No luck and watchdog do not work. Any other idea.
Siri
anything like as much power.
Also, can you describe exactly what you want the code after the "Repeat 2 ' Correct 2 times" statement to do.
You are right,the watchdog cog is suppose to monitor pin21 and set it high if it has been low for more than 5 secs.
After "Repeat2" statements- the code is suppose to continue as the the problem is corrected.To continue with this
code running in another cog(Valve timing code)- see below
I hope this helps to solve the issue.
Thanks for the Help.
Siri
The watch dog cog issue still remains unsolved.I am in need of solution so please give it
a little effort.
Thanks,
Siri
Thank you helping me. I tried your changes to the code but still it does not work
The only other cog that sets the P21 is in the following code that runs in a another cog I am using only 4 other cogs
When put the code in ValveControl loop it works but then VaalveControl stops working - only the watchdog code works
continuously.
Itried with and with out the "quit" - still no luck.
Thanks kwinn
Siri
Thanks for the help.
Siri