![NXP Semiconductors LPC43Sxx Скачать руководство пользователя страница 1102](http://html1.mh-extra.com/html/nxp-semiconductors/lpc43sxx/lpc43sxx_user-manual_17218271102.webp)
UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2015. All rights reserved.
User manual
Rev. 2.1 — 10 December 2015
1102 of 1441
NXP Semiconductors
UM10503
Chapter 38: LPC43xx/LPC43Sxx Windowed Watchdog timer (WWDT)
•
The WWDT uses the IRC as a fixed clock source.
38.4 Applications
The purpose of the Watchdog Timer is to reset the microcontroller within a reasonable
amount of time if it enters an erroneous state. When enabled, a watchdog event will be
generated if the user program fails to feed (or reload) the Watchdog within a
predetermined amount of time. The Watchdog event will cause a chip reset if configured
to do so.
When a watchdog window is programmed, an early watchdog feed is also treated as a
watchdog event. This allows preventing situations where a system failure may still feed
the watchdog. For example, application code could be stuck in an interrupt service that
contains a watchdog feed. Setting the window such that this would result in an early feed
will generate a watchdog event, allowing for system recovery.
38.5 Description
The Watchdog consists of a fixed divide-by-4 pre-scaler and a 24-bit counter which
decrements on every clock cycle. The minimum value from which the counter decrements
is 0xFF. Setting a value lower than 0xFF causes 0xFF to be loaded in the counter. Hence
the minimum Watchdog interval is (T
WDCLK
256
4) and the maximum Watchdog
interval is (T
WDCLK
2
24
4) in multiples of (T
WDCLK
4). The Watchdog should be used
in the following manner:
•
Set the Watchdog time-out value in TC register.
•
Setup the Watchdog timer operating mode in MOD register.
•
Set a value for the watchdog window time in WINDOW register if windowed operation
is required.
•
Set a compare value for the watchdog warning interrupt in the WARNINT register if a
warning interrupt is required.
•
Enable the Watchdog by writing 0xAA followed by 0x55 to the FEED register.
•
The Watchdog must be fed again before the Watchdog counter reaches zero in order
to prevent a watchdog event. If a window value is programmed, the feed must also
occur after the watchdog counter passes that value.
When the Watchdog Timer is configured so that a watchdog event will cause a reset and
the counter reaches zero, the CPU will be reset, loading the stack pointer and program
counter from the vector table as in the case of external reset. The Watchdog time-out flag
(WDTOF) can be examined to determine if the Watchdog has caused the reset condition.
The WDTOF flag must be cleared by software.
When the Watchdog Timer is configured to generate a warning interrupt, the interrupt will
occur when the counter matches the compare value defined by the WARNINT register.
38.5.1 WWDT behavior in Debug mode
If code execution is halted in Debug mode, the WWDT stops counting until code execution
resumes.