Hi,
This may not be the repeat posting because i have gone through the several similar post. So, my problem is when i am using push button, it has to glow the second LED but it is not having even i have enabled the resistor through P1REN pin. I am usd power only for the MSP430 board. Here is my code:
#include <msp430.h>
#include <msp430g2553.h>
#define LED1 BIT0
#define LED2 BIT6
#define BTN BIT3
void main(void)
{
P1DIR |= LED1+LED2;
P1OUT = 0x00;
P1REN |= BTN;
for(;;)
{
if((P1IN & BTN) == BTN)
{
P1OUT ^= LED1;
__delay_cycles(300);
}
else
{
P1OUT ^= LED2;
__delay_cycles(300);
}
} // end of for
} // end of main
When i press the pushbutton, other LED has to glow. But it is not happen. When i am observing the P1IN pin in watchlist. I am observing P1.3 is in low (usually it has to be high, because of pushup resistor), even when i am not pressed the pushbutton. P1.1,P1.2 are always are in high all the time, even i am not assign them any thing.