Part Number: MSP430G2553
Hi
We have to write a code in MSP430G2553 so we assigned P2.3 pin as Interrupt source(i.e push button(SPST model) in Hardware).
So during 1st High/Low transition we need to make the P2.2 as high
for next High/Low transition we need to make the P2.4 as high
& next High/Low transition we need to make the P2.5 as high
& for last High/Low transition we need to make the P2.2,P2.4,P2.5 as low and this cycle repeats continuously.
Below is the code for it but its only making only one pin high after repeated press also.
Please guide us to solve this issue.
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=PORT2_VECTOR
__interrupt void Port_2(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(PORT2_VECTOR))) Port_2 (void)
#else
#error Compiler not supported!
#endif
{
portCtl(&P2OUT,P22,ENABLE);
portCtl(&P2OUT,P24,ENABLE);
portCtl(&P2OUT,P25,ENABLE);
P2IFG &= ~PIRINT; // P2.3 IFG cleared
}