Tool/software: Code Composer Studio
Hiiii,
im using msp430 launcher pad, im trying to connect two input at same port but not working properly
one pin is working but but other is not responding, what shall i do for this?/
#include <msp430.h> int main(void) { WDTCTL = WDTPW | WDTHOLD; //Stop watchdog timer to Prevent PUC Reset P2DIR = 0b00000000 ; //explicitly making P1.3 as Input - even though by default its Input P2REN = 0b11111111; //Enable Pullup/down P2OUT = 0b11111111; //Select Pullup P1DIR |= BIT6; //Configuring P1.6(LED2) as Output P1OUT |= BIT6; //drive output HIGH initially P1DIR |= BIT0; P1OUT &= ~BIT0; while(1) { P1OUT &= ~BIT0; P1OUT &= ~BIT6; if( !(P2IN & BIT1)) { P1OUT |= BIT0; P1OUT &= ~BIT6; } if( !(P2IN & BIT2)) { P1OUT |= BIT6; P1OUT &= ~BIT0; } else { P1OUT |= BIT0; P1OUT |= BIT6; } } //return 0; //this won't execute normally }
this is my code in this pin 2.2 is working properly but p2.1 is not working.
also send me code for pullup resistor with two input.
thank you