____________________________________________________

External Programmable Watchdog Timer Using MSP430™
MCUsIntroduction
Watchdog timers (WDTs) are particularly useful
because they detect if a microcontroller is in an invalid
software state and initiate a reset if needed. These
invalid software states can be caused by anything froma software bug to electromagnetic interference. In
general, a WDT resets the system when it does notreceive a regular pulsed signal from the hostprocessor.
In critical systems, such as smoke detectors and otherindustrial applications, an invalid software state could
be catastrophic. In these instances, an external WDT
would be imperative. The external WDT has aseparate clock source providing redundancy andmaking the system more robust.
This solution presents a configurable external
watchdog timer that accepts watchdog time-out values
ranging from 1 to 2 seconds, in increments of 200 ms.
A shorter time-out interval could be achieved, ifneeded, by changing the values in the timeout array tomatch the application specifications. This example has
been optimized for lowest code size, fitting in a lowcost 0.5KB MSP430FR2000 microcontroller (MCU). It
also utilizes the MSP430™ ultra-low-power operatingstates by going into low-power mode 3 (LPM3) when
not executing a WDT-specific operation. To getstarted, download project files and a code example
demonstrating this functionality.
Implementation
This solution uses an MSP430FR2000 MCU and any
external host processor with UART, reset, and GPIO
capability. This allows the reset line of the hostprocessor to be controlled by the low-cost
MSP430FR2000 MCU with 0.5KB of memory.

SLAA789 – September 2017
Submit Documentation Feedback

The reset pulse duration, initialized to 1 ms, is user
configurable inside of the source code by changing theReset_Cycles value. The watchdog interrupt (WDI)
input is a signal generated by the host processor to
notify the external WDT that it is working properly. A
high-to-low transition within every n seconds (specifiedby the timeout selection value) keeps the external
WDT from resetting the host processor. As a typicaldefault, the time-out value is initialized to 1.6 seconds.
The backchannel UART of the MSP-FET or eZ-FET on
an MSP430 LaunchPad™ development kit is used for
the UART communication with a terminal program on
the PC to send the commands for selecting each timeout value. Figure 1 shows how the MSP430FR2000
MCU can be connected to an MCU to act as anexternal WDT.

Figure 1. External Watchdog Timer Hardware Block
Diagram
The external WDT uses interrupts to wake up fromlow-power mode to execute specific functions.
Figure 2 shows how the software works with thehardware to reliably monitor a host processor.

External Programmable Watchdog Timer Using MSP430™ MCUsCopyright © 2017, Texas Instruments Incorporated

1

www.ti.com

Figure 3. Logic Analyzer Output When Addressing
and Not Addressing the WDT
In the top screenshot in Figure 3, the WDI input
toggles every 500 ms, thus meeting the default timeout requirement and not causing the reset to be sent.
In the bottom screenshot in Figure 3, the WDI input isheld low, thus breaking the timing requirement andcausing the reset line to pulse low for the default timeof 1 ms.
To take advantage of the backchannel UART on theMSP-FET or the eZ-FET, use a terminal program on
the PC set to 9600 baud, no parity, and 1 stop bit toselect the time-out values. There are six acceptablevalues, selectable by sending hex values from 0 to 5.
Table 1 lists the valid UART commands.
Table 1. Valid UART Watchdog Time-out Values
UART Command (Hex)Figure 2. External Watchdog Timer Software
Flow Chart
To run the demo on a PC, connect the LaunchPad kit
or target development board to the PC, load the code
into the device, allow the device to run, and end thedebug session. The MSP-TS430PW20 target
development board already includes the correctconnections for the UART TXD and RXD on the MSPFET connector as long as JP14 and JP15 arepopulated (leave JP13 unconnected).
At start-up, the code continues to send reset pulse
signals from P1.3 unless it sees the watchdog being
addressed by the WDI pin. Figure 3 shows the logic
analyzer output from P1.3 when the WDT is and is not
being addressed.

2

Time-out Value (Seconds)

01

1

1.2

2

1.4

3

1.6

4

1.8

5

2An invalid UART command results in no change of thetime-out value.
Performance
If a larger MSP430 microcontroller were used, thenmore features could be added to the solution. The
current solution uses the internal reference oscillator
running at 32768 Hz as the source for Timer_B, but anexternal crystal could be used to improve timing
accuracy and decrease power consumption. Morememory could allow a specific sequence or UART
communication protocol to address the external WDT.
Additional memory would also allow the user toprogram more time-out values into the external WDT,
in addition to the six programmed in the providedexample.

External Programmable Watchdog Timer Using MSP430™ MCUs
Copyright © 2017, Texas Instruments Incorporated

SLAA789 – September 2017
Submit Documentation Feedback

www.ti.com

Table 2. Device Recommendations

Using only the low-cost 0.5KB MSP430FR2000 MCU,
this solution reliably monitors the state of a hostprocessor and works to protect it from hanging up in
an invalid loop.

Part Number

Key Features

MSP430FR2000 0.5KB FRAM, 0.5KB RAM, eComp
MSP430FR2100 1KB FRAM, 0.5KB RAM, 10-bit ADC, eComp

Device Recommendations

MSP430FR2110 2KB FRAM, 1KB of RAM, 10-bit ADC, eComp

The device used in this example is part of the MSP430
Value Line Sensing portfolio of low-cost MCUs,
designed for sensing and measurement applications.
This example can be used with the devices shown inTable 2 with minimal code changes. For more
information on the entire Value Line Sensing MCU
portfolio, visit www.ti.com/MSP430ValueLine.

MSP430FR2111 3.75KB FRAM, 1KB RAM, 10-bit ADC, eComp

MSP430, LaunchPad are trademarks of Texas Instruments.
All other trademarks are the property of their respective owners.
SLAA789 – September 2017
Submit Documentation Feedback

External Programmable Watchdog Timer Using MSP430™ MCUs
Copyright © 2017, Texas Instruments Incorporated3

IMPORTANT NOTICE FOR TI DESIGN INFORMATION AND RESOURCES
Texas Instruments Incorporated (‘TI”) technical, application or other design advice, services or information, including, but not limited to,reference designs and materials relating to evaluation modules, (collectively, “TI Resources”) are intended to assist designers who aredeveloping applications that incorporate TI products; by downloading, accessing or using any particular TI Resource in any way, you(individually or, if you are acting on behalf of a company, your company) agree to use it solely for this purpose and subject to the terms ofthis Notice.
TI’s provision of TI Resources does not expand or otherwise alter TI’s applicable published warranties or warranty disclaimers for TI
products, and no additional obligations or liabilities arise from TI providing such TI Resources. TI reserves the right to make corrections,enhancements, improvements and other changes to its TI Resources.
You understand and agree that you remain responsible for using your independent analysis, evaluation and judgment in designing yourapplications and that you have full and exclusive responsibility to assure the safety of your applications and compliance of your applications(and of all TI products used in or for your applications) with all applicable regulations, laws and other applicable requirements. You
represent that, with respect to your applications, you have all the necessary expertise to create and implement safeguards that (1)anticipate dangerous consequences of failures, (2) monitor failures and their consequences, and (3) lessen the likelihood of failures thatmight cause harm and take appropriate actions. You agree that prior to using or distributing any applications that include TI products, youwill thoroughly test such applications and the functionality of such TI products as used in such applications. TI has not conducted any
testing other than that specifically described in the published documentation for a particular TI Resource.
You are authorized to use, copy and modify any individual TI Resource only in connection with the development of applications that include
the TI product(s) identified in such TI Resource. NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE TOANY OTHER TI INTELLECTUAL PROPERTY RIGHT, AND NO LICENSE TO ANY TECHNOLOGY OR INTELLECTUAL PROPERTYRIGHT OF TI OR ANY THIRD PARTY IS GRANTED HEREIN, including but not limited to any patent right, copyright, mask work right, orother intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information
regarding or referencing third-party products or services does not constitute a license to use such products or services, or a warranty orendorsement thereof. Use of TI Resources may require a license from a third party under the patents or other intellectual property of thethird party, or a license from TI under the patents or other intellectual property of TI.
TI RESOURCES ARE PROVIDED “AS IS” AND WITH ALL FAULTS. TI DISCLAIMS ALL OTHER WARRANTIES OR
REPRESENTATIONS, EXPRESS OR IMPLIED, REGARDING TI RESOURCES OR USE THEREOF, INCLUDING BUT NOT LIMITED TO
ACCURACY OR COMPLETENESS, TITLE, ANY EPIDEMIC FAILURE WARRANTY AND ANY IMPLIED WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUALPROPERTY RIGHTS.
TI SHALL NOT BE LIABLE FOR AND SHALL NOT DEFEND OR INDEMNIFY YOU AGAINST ANY CLAIM, INCLUDING BUT NOTLIMITED TO ANY INFRINGEMENT CLAIM THAT RELATES TO OR IS BASED ON ANY COMBINATION OF PRODUCTS EVEN IFDESCRIBED IN TI RESOURCES OR OTHERWISE. IN NO EVENT SHALL TI BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL,COLLATERAL, INDIRECT, PUNITIVE, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES IN CONNECTION WITH ORARISING OUT OF TI RESOURCES OR USE THEREOF, AND REGARDLESS OF WHETHER TI HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
You agree to fully indemnify TI and its representatives against any damages, costs, losses, and/or liabilities arising out of your noncompliance with the terms and provisions of this Notice.
This Notice applies to TI Resources. Additional terms apply to the use and purchase of certain types of materials, TI products and services.
These include; without limitation, TI’s standard terms for semiconductor products http://www.ti.com/sc/docs/stdterms.htm), evaluation
modules, and samples (http://www.ti.com/sc/docs/sampterms.htm).

Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2017, Texas Instruments Incorporated