Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:06 24 Dec 2025 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 : Watchdog does not work

Author Message
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 34
Posted: 10:26am 23 Dec 2025
Copy link to clipboard 
Print this post

Hi,

I am desperately trying to set the watchdog, but without success.
The Pico (RP2040) does not restart.


> option list
WebMite MMBasic RP2040 Edition V6.01.00
OPTION AUTORUN  ON
OPTION COLOURCODE ON
OPTION CPUSPEED (KHz) 200000
OPTION DISPLAY 50, 230
OPTION WIFI ***, *********, ***
OPTION TELNET CONSOLE ON
>
>
> list
WatchDog 10000
Print 10/0
>
>
> run
[2] Print 10/0
Error : Divide by zero
>
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10741
Posted: 10:35am 23 Dec 2025
Copy link to clipboard 
Print this post

The watchdog is nothing to do with error handling and errors cancel the watchdog. To cause a restart after an error use ON ERROR RESTART in a program. If you set the watchdog and do nothing it will restart the processor after the timeout has expired
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4176
Posted: 10:37am 23 Dec 2025
Copy link to clipboard 
Print this post

Doesn't look a valid test of Watchdog.

edit: Peter beat me to it!

John
Edited 2025-12-23 20:39 by JohnS
 
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 34
Posted: 10:44am 23 Dec 2025
Copy link to clipboard 
Print this post

Thanks for the info, but the “Watchdog Timer” section in the documentation states that the watchdog continues counting and restarts the CPU when an error occurs and the program returns to the command prompt.
Or have I misunderstood?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10741
Posted: 10:53am 23 Dec 2025
Copy link to clipboard 
Print this post

The phrasing in the manual perhaps needs changing. The watchdog is intended to deal with the situation where a program has gone rogue e.g. in a tight loop. Errors cancel the watchdog so that you can see what the error was. ON ERROR RESTART deals with the production use of error detection when the program is, in theory, error free.
 
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 34
Posted: 11:02am 23 Dec 2025
Copy link to clipboard 
Print this post

  matherp said  The phrasing in the manual perhaps needs changing. The watchdog is intended to deal with the situation where a program has gone rogue e.g. in a tight loop. Errors cancel the watchdog so that you can see what the error was. ON ERROR RESTART deals with the production use of error detection when the program is, in theory, error free.


Oh, ok. Thanks for info. I'll try that.
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025