Watchdog Timer

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Watchdog Timer

Post by medelec35 »

If auto clear watchdog is selected in project options, does this mean we don't have to place any C icons with clear_wdt();?

I was asking because in help file it just mentions component macros.

If watchdog is enabled with program config, and just use a 10 second delay icon in a flowchart, will watchdog timer time out?
I am guessing it will, so if I require a delay longer than watchdog time out, then I will need to use a count loop with ms delay within it?
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Watchdog Timer

Post by Benj »

Hello

The Auto Clear Watchdog functionality does the following.

Any call to a component macro automatically adds a clear watchdog C code call.
Any call to a delay breaks the delay up into sections and automatically adds a clear watchdog C code call between each section.

So in answer to your question.
If watchdog is enabled with program config, and just use a 10 second delay icon in a flowchart, will watchdog timer time out?
No the timer should not time out.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Watchdog Timer

Post by medelec35 »

Thanks Ben.
I was asking because watchdog timed out during a 3 second delay while auto clear watchdog was enabled. I had to do the delay with ms and loop instead of seconds, to avoid watchdog reset.
That function is a very good idea though.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Watchdog Timer

Post by Benj »

Hello

Are you sure that seems very odd to me.

The second delay actually calls the millisecond delay a thousand times every second and the millisecond delay resets the watchdog timer.

In your programs compiled C code can you make sure the delay is generating this "Wdt_Delay_S()" and not this "delay_s()"

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Watchdog Timer

Post by medelec35 »

I have created a different test using a 10 second timer, and does indeed work the way you have described it should work.
Thanks again Ben.
Martin

Post Reply