求帮忙!!!为什么我的LAUNCHPAD 进不了P1口的外部中断程序??
P1口中断和全局中断全部都打开了
部分程序如下:
..........
P1DIR &= ~BIT3;
P1DIR &= ~BIT4;
P1DIR &= ~BIT5;
P1DIR &= ~BIT7;
P1OUT |= BIT3+BIT4+BIT5+BIT7;
P1REN = 0;
P1REN |= BIT3+BIT4+BIT5+BIT7;
P1IE = 0;
P1IES = 0;
P1IE |= BIT3;
P1IE |= BIT4;
P1IE |= BIT5;
P1IE |= BIT7;
P1IES |= BIT3;
P1IES |= BIT4;
P1IES |= BIT5;
P1IES |= BIT7;
P1IFG = 0;
_BIS_SR(LPM1_bits + GIE);
_EINT();
while (1);
} //main函数
#pragma vector=PORT1_VECTOR
__interrupt void P1_ISR(void)
{
if (P1IFG & BIT3 == BIT3)
{
while(!(P1IFG&BIT3))
{
LPM1_EXIT;
P1OUT |= BIT6;
for(i=0;i<1000;i++)P1OUT &= ~BIT6;
P1IFG &= ~BIT3;
}
return;
}
... ... ... ... ... ... ... |