EasyManuals Logo

Texas Instruments MSP430 Student Guide

Texas Instruments MSP430
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #183 background imageLoading...
Page #183 background image
(Optional) Lab 4b Exploring the Watchdog Timer
For the watchdog lab using different divisor values, we got the following results, of: 1, 9, 589
(respectively) … did you wait all the way to 589 before giving up?
Keep it Running
20. Add the function call that will keep the CPU running without a watchdog reset.
Add the line of code to the while{} loop our answer to question # in this lab that will reset
the watchdog and keep the program running.
WDT_A_resetTimer(WDT_A_BASE);
Hint: You may want to change the clock divisor back to WDT_A_CLOCKDIVER_64 to
make it easier to see the change. Then, if the count goes past “1” you’ll know the
watchdog is being serviced.
21. Build and run the program to observe the watchdog resetting the MSP430.
How many times will it run now? _______________________________________________
22. When done playing with the program, terminate your debug session close the project.
Extra Credit Try DriverLib’s Watchdog Example (#3)
The driverlib library contains an example for ‘watching’ the watchdog timer. Give it a test to watch
every time the watchdog rolls-over.
23. Import the wdt_a_ex3_watchdogACLK project using the CCSv5 Resource Explorer.
If you cannot remember how to import a project using Resource Explorer, please refer back
to the beginning of Lab3b Reading a Push Button. We started that lab by importing the
EmptyProject example project.
24. Examine the source file in the project.
Notice how they utilize the GPIO pin. Every time the program re-starts it toggles the GPIO
pin.
If you look in the User Guide for your MSP430 device, you can see that while the PDIR (pin
direction) register is reset after a Power-Up Clear (PUC), the POUT value is left alone. This is
the trick used to make the pin toggle after every watchdog reset.
Note, PUC was described during this chapter, while the GPIO pins were discussed in
Chapter 3.
25. Build and run the program to observe the watchdog resetting the MSP430.
26. When you’re done, close the project.
MSP430 Workshop - MSP430 Clocks & Initialization 4 - 57

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals