Part Number: MSP-EXP430F5529
Tool/software: Code Composer Studio
Hello everyone,
i am trying to define input pin like p1.3 and take it's value from function generator (pulse wave)
i just wanna toggle led in my board like led1 (p1.0) when i read this input pin to check if my signal stored in this pin
this is my code but it is not work correctly
#include <msp430.h>
void main(void) {
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P1DIR |= 0x01; // configure led1 P1.0 as output
P1OUT &= ~BIT0;
volatile unsigned int i; // volatile to prevent optimization
P1DIR &= ~BIT3; //configure P1.3 as input
while(1) {
if (P1IN&BIT3==0) {
for (i=0; i<2000 ; i++);
P1OUT |=BIT0;
}
}
}