- I am using CC1110 . I use the P0_7 as an external interrupt source which connect with a press button . so I configure P0_7 as a input pin while all other pins of P0 as output pin, like this:
P0SEL |= 0x03;
P0 |= 0x3f;
P0DIR |= 0x3f;
the interrpt configration codes are the following:
P0IF =0;
P0IFG = 0x00;
PICTL |= PICTL_P0ICON; //fall edge
PICTL |= PICTL_P0IENH;
INT_ENABLE(INUM_P0INT, INT_ON);
and the interrupt routine are the following:
#pragma vector = P0INT_VECTOR
__interrupt void KEY_ISR(void)
{
INT_ENABLE(INUM_P0INT, INT_OFF);
if (P0IFG & BIT7) { //key
P0IFG &= ~BIT7; // Clear status flag for pin
f_keyint = 1;
}
else if (P0IFG & BIT6)
P0IFG &= ~BIT6;
else if (P0IFG & BIT5)
P0IFG &= ~BIT5;
else if (P0IFG & BIT4)
P0IFG &= ~BIT4;
P0IF =0; // Clear CPU interrupt status flag
INT_ENABLE(INUM_P0INT, INT_ON);
}
at this time, a unusual phenomenon presented : before I press the button , external interrupt occoured frequently . the interrupt source is P0_5 or P0_4 .
what does the phenomenon mean?
any ideas? thanks a lot !