LPC2000 watchdog timer

As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount of MCU error time. If watchdog is enabled and if after some time watchdog timer doesn't reload due correct program flow, then it generates a system reset.

Watchdog unit consists of four registers:

  • WDMOD – Watchdog mode register where is watchdog mode and status saved. There are three watchdog modes available in LPC2000: Debug mode – allows to debug code with watchdog active but without WD reset; Watchdog Interrupt mode – generates interrupt when WD timer overflows; Watchdog Reset mode – reset MCU when WD timer overflows.

  • WDTC – Watchdog timer constant register where time out value is saved. Timeout value can be determined by formula: Period=Pclk·WDTC·4. While WDTC value can be in range from 256 to 2^32, then timeout when Pclk=60MHz can vary from 17.066us to 5min.

  • WDFEED – watchdog feed sequence register. Writing 0xAA followed by 0x55 wil reset Watchdog to WDTC value.

  • WDTV – watchdog timer value register holds current watchdog timer value which can be read.

When started watchdog timer must get regular feed sequence in order to avoid reaching zero and reset.

Leave a Reply

Your email address will not be published. Required fields are marked *