This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430的port1.0口中断的问题,中断标志位无法清零。

Other Parts Discussed in Thread: MSP430FR6043

我用msp430fr6043的P1.0口做按键中断输入,程序如下,但是我仿真发现P1IFG的赋值操作都无效,不知道是哪里设置不对了,请帮忙看看到底什么问题。

板上的按键有上拉电阻,不过无论是否启用芯片内部上拉电阻,效果都是一样的。

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

P1DIR = 0x00;
P1SEL0=0;
P1SEL1=0;
P1REN = 0;//0x01;
//P1OUT = 0x01;
P1IES = 0x01;
P1IFG=0;
P1IE = 0x01;

__bis_SR_register(GIE);

while(1);
return 0;
}

#pragma vector = PORT1_VECTOR
__interrupt void PORT1_ISR(void)
{
P1IFG=0;
LPM3_EXIT;
}