Defines | Functions
wdt.h File Reference

Go to the source code of this file.

Defines

#define __MSP430_HAS_WDT_A__
#define WDT_CLOCKSOURCE_SMCLK   (WDTSSEL_0)
#define WDT_CLOCKSOURCE_ACLK   (WDTSSEL_1)
#define WDT_CLOCKSOURCE_VLOCLK   (WDTSSEL_2)
#define WDT_CLOCKSOURCE_XCLK   (WDTSSEL_3)
#define WDT_CLOCKDIVIDER_2G   (WDTIS_0)
#define WDT_CLOCKDIVIDER_128M   (WDTIS_1)
#define WDT_CLOCKDIVIDER_8192K   (WDTIS_2)
#define WDT_CLOCKDIVIDER_512K   (WDTIS_3)
#define WDT_CLOCKDIVIDER_32K   (WDTIS_4)
#define WDT_CLOCKDIVIDER_8192   (WDTIS_5)
#define WDT_CLOCKDIVIDER_512   (WDTIS_6)
#define WDT_CLOCKDIVIDER_64   (WDTIS_7)

Functions

void WDT_hold (unsigned int baseAddress)
void WDT_start (unsigned int baseAddress)
void WDT_resetTimer (unsigned int baseAddress)
void WDT_watchdogTimerInit (unsigned int baseAddress, unsigned char clockSelect, unsigned char clockDivider)
void WDT_intervalTimerInit (unsigned int baseAddress, unsigned char clockSelect, unsigned char clockDivider)

Define Documentation

#define __MSP430_HAS_WDT_A__
#define WDT_CLOCKSOURCE_SMCLK   (WDTSSEL_0)
#define WDT_CLOCKSOURCE_ACLK   (WDTSSEL_1)
#define WDT_CLOCKSOURCE_VLOCLK   (WDTSSEL_2)
#define WDT_CLOCKSOURCE_XCLK   (WDTSSEL_3)
#define WDT_CLOCKDIVIDER_2G   (WDTIS_0)
#define WDT_CLOCKDIVIDER_128M   (WDTIS_1)
#define WDT_CLOCKDIVIDER_8192K   (WDTIS_2)
#define WDT_CLOCKDIVIDER_512K   (WDTIS_3)
#define WDT_CLOCKDIVIDER_32K   (WDTIS_4)
#define WDT_CLOCKDIVIDER_8192   (WDTIS_5)
#define WDT_CLOCKDIVIDER_512   (WDTIS_6)
#define WDT_CLOCKDIVIDER_64   (WDTIS_7)

Function Documentation

void WDT_hold ( unsigned int  baseAddress)

Holds the Watchdog Timer.

Parameters:
baseAddressis the base address of the WDT module.

This function stops the watchdog timer from running, that way no interrupt or PUC is asserted.

Returns:
None

References HWREG, and HWREGB.

void WDT_start ( unsigned int  baseAddress)

Starts the Watchdog Timer.

Parameters:
baseAddressis the base address of the WDT module.

This function starts the watchdog timer functionality to start counting again.

Returns:
NONE

References HWREG, and HWREGB.

void WDT_resetTimer ( unsigned int  baseAddress)

Clears the timer counter of the Watchdog Timer.

Parameters:
baseAddressis the base address of the WDT module.

This function clears the watchdog timer to 0x0000h.

Returns:
None

References HWREG, and HWREGB.

void WDT_watchdogTimerInit ( unsigned int  baseAddress,
unsigned char  clockSelect,
unsigned char  clockDivider 
)

Sets the clock source for the Watchdog Timer in timer interval mode.

Parameters:
baseAddressis the base address of the WDT module.
clockSelectis the clock source that the watchdog timer will use. Valid values are WDT_CLOCKSOURCE_SMCLK [Default] WDT_CLOCKSOURCE_ACLK WDT_CLOCKSOURCE_VLOCLK WDT_CLOCKSOURCE_XCLK Modified bits are WDTSSEL of WDTCTL register.
clockDivideris the divider of the clock source, in turn setting the watchdog timer interval. Valid values are WDT_CLOCKDIVIDER_2G WDT_CLOCKDIVIDER_128M WDT_CLOCKDIVIDER_8192K WDT_CLOCKDIVIDER_512K WDT_CLOCKDIVIDER_32K [Default] WDT_CLOCKDIVIDER_8192 WDT_CLOCKDIVIDER_512 WDT_CLOCKDIVIDER_64 Modifed bits are WDTIS of WDTCTL register.

This function sets the watchdog timer as timer interval mode, which will assert an interrupt without causing a PUC.

Returns:
None

References HWREG.

void WDT_intervalTimerInit ( unsigned int  baseAddress,
unsigned char  clockSelect,
unsigned char  clockDivider 
)

Sets the clock source for the Watchdog Timer in watchdog mode.

Parameters:
baseAddressis the base address of the WDT module.
clockSelectis the clock source that the watchdog timer will use. Valid values are WDT_CLOCKSOURCE_SMCLK [Default] WDT_CLOCKSOURCE_ACLK WDT_CLOCKSOURCE_VLOCLK WDT_CLOCKSOURCE_XCLK Modified bits are WDTSSEL of WDTCTL register.
clockDivideris the divider of the clock source, in turn setting the watchdog timer interval. Valid values are WDT_CLOCKDIVIDER_2G WDT_CLOCKDIVIDER_128M WDT_CLOCKDIVIDER_8192K WDT_CLOCKDIVIDER_512K WDT_CLOCKDIVIDER_32K [Default] WDT_CLOCKDIVIDER_8192 WDT_CLOCKDIVIDER_512 WDT_CLOCKDIVIDER_64 Modifed bits are WDTIS of WDTCTL register.

This function sets the watchdog timer in watchdog mode, which will cause a PUC when the timer overflows. When in the mode, a PUC can be avoided with a call to WDT_resetTimer() before the timer runs out.

Returns:
None

References HWREG.


Copyright 2012, Texas Instruments Incorporated