Microchip® Advanced Software Framework

Reset WDT in window mode

In this use case, the WDT is configured for:

  • Window mode
  • Timeout period of 16 ms

The use case enables the WDT in window mode, and resets it after 10 ms to prevent system reset before window timeout after 8 ms and after time out period of 16 ms.

Setup steps

Prerequisites

For the setup code of this use case to work, the following must be added to the project:

  1. Busy-Wait Delay Routines

Example code

Add to application initialization:

Workflow

  1. Set timeout period to 16 cycles or 16 ms:
  2. Enable WDT:
  3. Set window period to 8 cycles or 8 ms:
  4. Enable window mode:

Usage steps

Example code

Add to, e.g., main loop in application C-file:

Workflow

  1. Wait for 10 ms to not reset the WDT before window timeout:
  2. Reset the WDT before the timeout period is over to prevent system reset: