MSP430G2553 WDT timer mode example

Publisher:hylh2008Latest update time:2018-07-11 Source: eefocusKeywords:MSP430G2553 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#include "MSP430G2553.h"


int main( void )

{

  WDTCTL = WDT_ADLY_1000; //The timing period is 1000ms 

  IE1 |= WDTIE; //Enable WDT interrupt 

  P1DIR |= 0x01; // P1.0 output 

  _EINT(); //Equivalent to _EINT(), system total interruption is allowed 

  while(1) //Loop waiting for timer overflow interrupt 

  { 

    LPM3; //Enter LPM3 

    _NOP(); 

  } 

}


//===========Watchdog interrupt service subroutine======== 

#pragma vector= WDT_VECTOR 

__interrupt void WDT_ISR (void) //Here begins with a double underscore 

  P1OUT ^= 0x01; //P1.0 inverted 

}


Keywords:MSP430G2553 Reference address:MSP430G2553 WDT timer mode example

Previous article:MSP430G2553 timer interrupt example
Next article:MSP430G2553 default MCLK, SMCLK, ACLK clock frequencies

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号