您现在的位置: 主页 > MCU > 单片机技术应用 > MSP430F249外部中断P1.3口 -
本文所属标签:
为本文创立个标签吧:

MSP430F249外部中断P1.3口 -

来源: 网络用户发布,如有版权联系网管删除 2018-09-06 

[导读]
/******************************************************************** ** File : DExternInterrupt.c | Interrupt | ** Version : 1.0 ** Descript

 

本文引用地址: http://www.21ic.com/app/mcu/201804/765869.htm

/******************************************************************
**
** File : DExternInterrupt.c | Interrupt |
** Version : 1.0
** Description: Extern Interrupt
** Author : LightWu
** Date : 2013-4-16
**
*******************************************************************/


#include "MSP430X24X.h"


void main(void)
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD; //关狗

P4DIR = BIT0|BIT1|BIT2|BIT3; //设置为输出
P4SEL = 0;

P1IE |= 0x08; // P1.3 interrupt enabled
P1IES |= 0x08; // P1.3 Hi/lo edge
P1IFG &= ~0x08; // P1.3 IFG cleared


__bis_SR_register(LPM4_bits + GIE); // Enter LPM4 w/interrupt

while(1)
{


}

}


// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
P4OUT ^= 0x0F; //电平翻转

P1IFG &= ~0x08; // P1.3 IFG cleared,注意清标志位,否则会一直进入中断
}

 



              查看评论 回复



嵌入式交流网主页 > MCU > 单片机技术应用 > MSP430F249外部中断P1.3口 -
 

"MSP430F249外部中断P1.3口 -"的相关文章

网站地图

围观()