MSP430G2553 WDT NMI interrupt example

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

Set the RST/NMI pin to NMI mode, turn on the P1.0 LED in the main program, and turn off the LED in the NMI interrupt 
. The phenomenon is that when the RST button is pressed, the LED goes out and never lights up again (unless the power is turned on again).

#include "MSP430G2553.h"


void   main( void  ) 

  WDTCTL = WDTPW + WDTHOLD + WDTNMI; //NMI mode (non-Reset mode) 

  IE1=NMIIE; //Open NMI interrupt, no need to open general interrupt 

  P1DIR |= BIT0; //P1.0 is set as output port 

  P1OUT |= BIT0; //light up

  LPM3; //Enter LPM3 

}


//==========NMI interrupt service subfunction============== 

#pragma vector=NMI_VECTOR 

__interrupt void NMI_ISR(void) //non-maskable interrupt 

  P1OUT &= ~BIT0; //Turn off the light 

}



Keywords:MSP430G2553 Reference address:MSP430G2553 WDT NMI interrupt example

Previous article:MSP430G2553 flash operation example
Next article:About the interrupt request flag

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号