MSP430 LaunchPad IO external interrupt

Publisher:创新思维Latest update time:2016-05-12 Source: eefocusKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
#include

int main( void )
{
  // Stop watchdog timer to prevent time out reset
  WDTCTL = WDTPW + WDTHOLD;
  
  P1DIR |= 0x01; //Set P1.0 port to output
  P1IE |= 0x08; // Enable P1.3 interrupt
  P1IES |= 0x08; //P1.3 port falling edge triggers interrupt
  P1IFG &= ~0x08; // Clear the interrupt flag


  _EINT(); //Open the general interrupt
//_BIS_SR(LPM4_bits + GIE);
  while(1)
  {
  }
}


/*Interrupt service routine*/
#pragma vector = PORT1_VECTOR
__interrupt void PORT_1(void)
{
  P1OUT ^= 0x01; //P1.0 status flip
  P1IFG &= ~0x08; // Clear the interrupt flag
}
Keywords:MSP430 Reference address:MSP430 LaunchPad IO external interrupt

Previous article:Reference IAR + Proteus7.6 simulation MSP430 microcontroller setting method
Next article:Microcontroller learning notes external interrupt, timer, serial port interrupt

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号