EasyManua.ls Logo

Texas Instruments MSP430

Texas Instruments MSP430
413 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
Loading...
154
Simulation
Explanation
WDT+ is used here as an interval timer with a time period of 512 microseconds. After every 512
microseconds, there is a WDT+ interrupt.
/*
* WDTCTL, Watchdog Timer+ Register
*
* WDTPW -- Watchdog password
* ~WDTHOLD -- Watchdog timer+ is not stopped
* ~WDTNMIES -- NMI on rising edge
* ~WDTNMI -- Reset function
* WDTTMSEL -- Interval timer mode
* ~WDTCNTCL -- No action
* ~WDTSSEL -- SMCLK
* ~WDTIS0 -- Watchdog clock source bit0 disabled
* WDTIS1 -- Watchdog clock source bit1 enabled
*
* Note: ~<BIT> indicates that <BIT> has value zero
*/
WDTCTL = WDTPW | WDTTMSEL | WDTIS1;
Inside this interrupt we just change the value of a variable called task.
#pragma vector=WDT_VECTOR
__interrupt void WDT_ISR_HOOK(void)
{
task++;
if(task >= 3)
{
task = 0;
}
IFG1 &= ~WDTIFG;
}

Table of Contents

Other manuals for Texas Instruments MSP430

Related product manuals