Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9755
Posted: 11:34pm 24 Mar 2019
Copy link to clipboard
Print this post
Hi all.
If you are executing a C routine, and it crashes inside the routine, if you have the WATCHDOG command set, will the processor still be restarted by it?
IE: If the C routine crashes and never returns to the interpreter, does the watchdog still reboot the core? I am just wondering if the WATCHDOG command acts on the PIC32 watchdog, or is is just a routine running in the back of the interpreter?
If the latter, and a C routine makes the chip fall over, then it would never return to the interpreter, and so then the watchdog would never operate.
Hopefully you can see what I am getting at.Smoke makes things work. When the smoke gets out, it stops!
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572
Posted: 08:12am 25 Mar 2019
Copy link to clipboard
Print this post
No: if a CFunction starts looping then it can only be recovered by a H/W reset. You would need to use an external watchdog to overcome this.
CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171
Posted: 09:51am 25 Mar 2019
Copy link to clipboard
Print this post
Ah! that is interesting.
Having worked with PICs in the 16F and 18F families for ages, I had made the mistake of assuming that the MMBasic watchdog was based around the hardware WDT.
Important to know this - although, touch wood, I haven't had a problem like Grogs describes.
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10572
Posted: 10:08am 25 Mar 2019
Copy link to clipboard
Print this post
Sorry - should have been more specific.
You can't guarantee it will work - depends on the CFunction and whether the timer interrupt is disabled or has been compromised. Some CFunctions that do time specific activities disable the timer interrupt. Others don't, some hook into the timer routine and so could stop the watchdog even if the interrupt isn't disabled.
No, it is based on a counter in the main timer interrupt
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9755
Posted: 06:58am 26 Mar 2019
Copy link to clipboard
Print this post
Thank you for the reply, Peter.
I have not been having any issues, but I was wondering what would happen IF that event.....eventuated.
For some reason, I thought that the MMBASIC WATCHDOG command set the PIC32 hardware WDT, not just a background timer. Good to know going forward.Smoke makes things work. When the smoke gets out, it stops!
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1646
Posted: 09:13am 26 Mar 2019
Copy link to clipboard
Print this post
Hi Grogster,
If the above means that you are going to do a re-run of your Watchdog boards please save some for me.