Author Topic: Backup Watchdog Timer module in M5225X  (Read 9317 times)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Backup Watchdog Timer module in M5225X
« on: January 28, 2009, 06:04:15 PM »
Hi All

The M5225X devices include a Backup Watchdog Timer (BWT) module.
This module is not included in the M5223X devices but is in the M5222x and M5221X chips.

The reason why this is interesting is due to its improved features over the Core Watchdog module which is the only internal watchdog in the M5223X family.

The deficiency of the Core Watchdog timer in the M5223X is that it relies on an interrupt service routine to handle watchdog timeouts. If the interrupt service routine can not respond correctly (eg. the interrupt vectors have been trashed in RAM by runaway code) there is no guarantied recovery possibility. A run away software can cause a board to lock up in a state which requires a HW reset or power cycle to restart operation. For this reason it is always good advice to add an external watchdog circuit to the M5223X in applications which require a guarantied recovery mechanism.

The BWT resolves these deficiencies by generating a soft reset on timeout. Its control registers are one-time writable after a power on reset and so ensure reliable operation once configured.

For this reason the BWT support has been integrated into the project for use by the M5225X and M5222X/M5221X devices if desired.
The define BACKUP_WATCHDOG_TIMER_AVAILABLE is valid if the selected device contains this module and, by defining BACKUP_WATCHDOG_TIMER in app_hw_m5223x.h, it will be activated in preference to the Core Watchdog module.
A timeout period of up to about 6s is possible when running from an 80MHz PLL. Alternatively the internal relaxation oscillator (8MHz) can also be specified as clocking source for the BWT to enable longer periods, should they be required.

The forthcoming service pack will also contain a user configuration example showing how the source and timeout period can be simply defined.

Finally, the uTasker simulator has been prepared to simulate the BWT so that it can assert resets when code doesn't correctly re-trigger it.

Regards

Mark