新闻中心

MSP430中断程序

作者: 时间:2016-11-26 来源:网络 收藏
#include<msp430g2553.h>

void main(void)
{
WDTCTL = WDTPW + WDTHOLD;// Stop watchdog timer
P1DIR |= 0x01;// Set P1.0 to output direction
P1IE |= 0x10;// P1.4interruptenabled
P1IES |= 0x10;// P1.4 Hi/lo edge
P1IFG &= ~0x10;// P1.4 IFG cleared

本文引用地址://m.amcfsurvey.com/article/201611/321638.htm

_BIS_SR(LPM4_bits + GIE);// Enter LPM4 w/interrupt
}

// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
P1OUT ^= 0x01;// P1.0 = toggle
P1IFG &= ~0x10;// P1.4 IFG cleared
}



关键词:MSP430中断程

评论


技术专区

关闭