NetBurner 3.5.6
PDF Version
Core Watchdog Timer (CWT)

Supported Platforms: MOD5441x, NANO54415, SB800EX

This example demonstrates how to enable the watchdog, set the timeout value, and service the watchdog. An interactive menu and status messages are displayed through the debug serial port. If the watchdog is not serviced before the timeout expires, events such as a system reset or interrupt service request (IRQ) can occur. The following watchdog timeout modes are supported by the 5441x processor:

  • System reset
  • IRQ only
  • IRQ on first timeout, then system reset on the second timeout
  • Windowed mode, this is an advanced mode of operation that processes a timeout in 25% increments. Please refer to the MCF5441X Users Manual for more information. This mode is not covered in the example.

Servicing the watchdog can be accomplished in a number of ways:

  1. A higher priority task that uses a timer, such as the Periodic Interrupt Timer (PIT). This is the most common method.
  2. In an Interrupt Service Routine (ISR). A drawback here is that interrupts can still occur, even if a specific task is not functioning correctly.
  3. Servicing throughout an application with specific function calls. This is very difficult to cover all of the edge cases.

A good system implementation would be to use the task and timer method, along with flags, counters or some other indication in each critical task that is evaluated in the watchdog service task to ensure the system is functioning properly.

The example includes code for both the task with timer method and interrupt method; you will only need one of these in your application.

Example Features:

  • Demonstrates 3 service methods: task with timer, interrupt and manual
  • Interactive menu on serial port provides options for enabling, disabling and servicing modes

This example does not enable the watchdog in the Flash memory system configuration so that a power cycle will reset the system with the watchdog disabled. This is done to make it easier to experiment with the various watchdog modes of operation. If you wish to have the watchdog persistently enabled through power cycles without explicitly enabling it in your application, the watchdog must be enabled in the configuration system.