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.

MSP430G2553 pin setting for switch

Other Parts Discussed in Thread: MSP430G2553

Hi,

Is there any limitation of using MSP430G2553 pins to configure it as an input pin for switch.

I am using PIN P1.1 ,P1.2 ,P1.3 ,P1.4 ,P1.5 as an input pin for 5 external switches.

P1.1 and P1.5 is responding well but i am facing problem with P1.2, P1.3 and P1.4

However P1.3 is responding well with the switch already present with the launchpad (but not with external switch connected to P1.3)

My code to configure pin as an input pin for switch is given below:

/* For SWITCHES */
P1SEL &= ~(BIT1 + BIT2 + BIT3 + BIT4 + BIT5); // Select GPIO as an input pin by clearing respective SEL register
P1DIR &= ~(BIT1 + BIT2 + BIT3 + BIT4 + BIT5); // Set input direction for switches
P1REN |= (BIT1 + BIT2 + BIT3 + BIT4 + BIT5); // Enable the pull up or down register by setting REN register
P1OUT |= (BIT1 + BIT2 + BIT3 + BIT4 + BIT5); // Set to pull up by setting the pin output register

Can anyone please help me on this....

Thank you..!!

 

**Attention** This is a public forum