Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:27 26 Nov 2024 Privacy Policy
Jump to

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.

Forum Index : Microcontroller and PC projects : PM: Watchdog HW question...

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9306
Posted: 11:05pm 06 Mar 2024
Copy link to clipboard 
Print this post

Hi all.

Just playing with this command, but I cannot make it work - the PM never resets itself.  PM firmware version 5.08.00

Code is extremely simple for testing purposes:


Print "GO!"
Print:Print

WatchDog HW 3500

Print 8/0


The code is designed to fall over with a divide-by-zero error - and it does - but the HW watchdog never resets the PM.

Standard software watchdog DOES reset the PM, but the HW one does not.

Am I doing something wrong?
I know the HW watchdog has a limit of 8.3 seconds, so I am not trying to exceed that.
Is the manual syntax correct? (page 135)

With the standard software watchdog, MM.WATCHDOG is true(1) at reset as you would expect, but using the HW option, as it never resets the PM, MM.WATCHDOG remains false(0).

Scratching head......
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9306
Posted: 11:12pm 06 Mar 2024
Copy link to clipboard 
Print this post

ADDITIONAL:

I can make the HW version of the command work, so long as I specify the time as 201ms or less, but that is pretty restrictive.

As soon as you specify 202ms or more, the HW watchdog times refuses to work.
Smoke makes things work. When the smoke gets out, it stops!
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 11:51pm 06 Mar 2024
Copy link to clipboard 
Print this post

Yes, replicated, also 5.08.00
> WatchDog HW 3500 : do : pause 9 : ? x : x=9/0 : loop
0
Error : Divide by zero
> '--------------------no reboot
> WatchDog HW 200 : do : pause 9 : ? x : x=9/0 : loop
0

HW Watchdog timeout

However it does work when there isn't an error.
> WatchDog HW 3500 : do : pause 9 : loop

HW Watchdog timeout
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9306
Posted: 02:45am 07 Mar 2024
Copy link to clipboard 
Print this post

It's good that it works inside a running no-error code, but if you get kicked to the console due to a syntax error, it would be nice if that also triggered the HW watchdog in the usual way that the software one does.

At least you have proven I am not imagining things!  
Smoke makes things work. When the smoke gets out, it stops!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 08:21am 07 Mar 2024
Copy link to clipboard 
Print this post

This is how I programmed it. Exiting a program cancels the watchdog. Otherwise in development you ctrl-C out of a program and before you have time to do anything the Pico resets. I could change this but you see the consequence - thoughts?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6098
Posted: 08:52am 07 Mar 2024
Copy link to clipboard 
Print this post

  matherp said  This is how I programmed it. Exiting a program cancels the watchdog. Otherwise in development you ctrl-C out of a program and before you have time to do anything the Pico resets. I could change this but you see the consequence - thoughts?

Watchdog while on the command line would be hell.
VK7JH
MMedit   MMBasic Help
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 12:36pm 07 Mar 2024
Copy link to clipboard 
Print this post

I might have the current behaviour of the PicoMite wrong but it should be:
- Exiting the program due to CTRL-C or END should cancel the watchdog.
- Exiting for any other reason should leave the watchdog running so it will trigger a restart.
- Starting the watchdog at the command prompt should trigger a restart when it expires.

The first is a deliberate action by the user/programmer, the second is an issue/fault in the program.  The third must be the user testing the command.

Geoff
Edited 2024-03-07 22:39 by Geoffg
Geoff Graham - http://geoffg.net
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9115
Posted: 01:54pm 07 Mar 2024
Copy link to clipboard 
Print this post

I'll change it so errors don't cancel the HW watchdog

b6 updated with the change
Edited 2024-03-08 00:04 by matherp
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9306
Posted: 09:10pm 07 Mar 2024
Copy link to clipboard 
Print this post

Awesome, thanks.  

I'll load up b6 later and try it out.
Edited 2024-03-08 07:15 by Grogster
Smoke makes things work. When the smoke gets out, it stops!
 
LouisG
Senior Member

Joined: 19/03/2016
Location: Australia
Posts: 124
Posted: 03:06pm 08 Mar 2024
Copy link to clipboard 
Print this post

Hi Grogster, what about the 202ms timeout limit you experienced?
Does your application need to work above or below that limit?
Am also looking to apply WDTs in my application.
... Louis
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9306
Posted: 10:48pm 08 Mar 2024
Copy link to clipboard 
Print this post

Haven't loaded up b6 yet to try it out, but plan to during the weekend.
I will let the thread know - I too was curious about that bit, but I figured I can just test it and see what happens, and report if that 202ms timeout is still an issue or not.  I have a feeling Peter may have addressed that at the same time.  Would not surprise me.
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024