Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

What is a windowed WDT?

Pommie

Well-Known Member
Most Helpful Member
I'm currently using the Pic18F26K40 and it has a windowed Watch Dog Timer.
To Quote from the datasheet,
The Windowed Watchdog Timer has an optional Windowed mode that is controlled by the WDTCWS
Configuration bits and WINDOW bits. In the Windowed mode, the CLRWDT instruction must occur within
the allowed window of the WDT period. Any CLRWDT instruction that occurs outside of this window will
trigger a window violation and will cause a WWDT Reset, similar to a WWDT time out.

What does this mean? A WDT, by definition is a windowed device - if you don't clear it within the specified time a reset occurs. What is this window?

I just want the WDT to reset the device if I don't "kick the dog" within 0.25 seconds. They talk about the "Window" being open/closed - I just want it off - is that open or closed?

Thanks,

Mike.
 
I'm not sure I understand the purpose of the window mode where there's a min time, but if you want it to just function as a normal WDT leave CONFIG word 3 (0x30005) set to 0xFF.
 
I'm not sure I understand the purpose of the window mode where there's a min time, but if you want it to just function as a normal WDT leave CONFIG word 3 (0x30005) set to 0xFF.
Config word 3 is as follows,
// CONFIG3L
#pragma config WDTCPS = WDTCPS_31 // ->Divider ratio 1:65536; software control of WDTPS
#pragma config WDTE = SWDTEN // WDT operating mode->WDT enabled/disabled by SWDTEN bit

// CONFIG3H
#pragma config WDTCWS = WDTCWS_7 // WDT Window Select bits->window always open (100%); software control; keyed access not required
#pragma config WDTCCS = SC // WDT input clock selector->Software Control
This was by the MCC (Code Configurator).
If I knew what Window Open (100%) meant then it might be what I want.

Thanks,
How is that any different to a normal WDT?
I know what a WDT does I want to know what a WWDT does which that page doesn't answer or if it does it's gobbledegoop.

Mike.
 
How is that any different to a normal WDT?
I know what a WDT does I want to know what a WWDT does which that page doesn't answer or if it does it's gobbledegoop.
With a windowed watchdog timer, there is a minimum time as well as a maximum time. A normal WDT only has a maximum time.

The timer is reset when the watchdog timer reset command is executed. This is the same as a normal WDT

If the timer gets to the maximum time, the processor is reset. This is also the same as a normal WDT

If a second watchdog timer reset command is executed before the minimum time, the processor is reset. That is not the same as with a normal WDT.
 
With a windowed watchdog timer, there is a minimum time as well as a maximum time. A normal WDT only has a maximum time.

The timer is reset when the watchdog timer reset command is executed. This is the same as a normal WDT

If the timer gets to the maximum time, the processor is reset. This is also the same as a normal WDT

If a second watchdog timer reset command is executed before the minimum time, the processor is reset. That is not the same as with a normal WDT.
OK, I can see there is a difference now but I just can't see a use for it - why would you need a minimum time? Or why it should reset if you kick the dog too quickly - maybe an animal rights issue:D. And I still don't know if Window Open is on or off.

Thanks for the info. Guess my (old) brain cells aren't able to process this.

Can't check now as currently don't have the chip.

Mike.
 
If the software execution takes longer or shorter than expected, the WWDT issues a reset of the microcontroller
 
OK, I can see there is a difference now but I just can't see a use for it - why would you need a minimum time? Or why it should reset if you kick the dog too quickly - maybe an animal rights issue:D.
I'm not sure, but many software architectures have a schedule, where each section is run at a predetermined rate, for example every 10 ms, and then it would be normal to reset the watchdog timer at the same rate. If the timer were reset much sooner, that could be because the scheduler has gone wrong and it missing out some sections or something.

Automotive control modules often use System Basis Chips, SBCs, which contain the power supplies and the CAN or LIN interfaces. The microcontrollers typically communicate with the SBC using SPI, and it's quite common for the SBC to have a watchdog timer, so that if the communication with the microcontroller, doesn't happen, the microcontroller gets reset. I have also seen the option of a window watchdog timer on an SBC. It was the NCV7471 made by ON semiconductor if anyone wants to look it up.
 
If I knew what Window Open (100%) meant then it might be what I want.
"Window Open" is the time when it's ok to use a CLRWDT instruction, so if it's 100% then it's always ok.
If it's set to 75%, then the first 25% is "Window Closed", and in WWDT mode a CLRWDT will reset the device.
 
A WWDT can be used during a startup or after a discharge event to make sure the connected device has time to recharge (minimum time) before answering. But a maximum time to wait if the connected device doesn't answer. The WWDT concept is used in Bluetooth Low Energy to prevent constant waiting for a connection to a beacon if a beacon. The beacon may only broadcast every 10 seconds or more so you'd want to wait at least the minimum update time.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top