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.

MSP430FR2355: MSP430 LaunchPad - Code Composer Studio breakpoint jumping to different line.

Part Number: MSP430FR2355


Tool/software:

I wrote a quick-and-dirty program for my MSP430 LaunchPad to test if a sensor would detect a magnet but I'm having trouble debugging it because CCS keeps moving the breakpoint I put inside an if statement. Relevant section of code:

    // Configure ports
    P1DIR |= BIT0;          // Config P1.0 (LED1) as output
    P1OUT &= ~BIT0;         // Clear LED1 to start
    P1DIR &= ~BIT5;         // Config P1.5 input
    P1REN |= BIT5;          // Enable resistor
    P1OUT |= BIT5;          // Make pull-up resistor

    PM5CTL0 &= ~LOCKLPM5;

    while (1) {
        if (P1IN & BIT5 == 0) {
            P1OUT |= BIT0;
        }
        else P1OUT &= ~BIT0;
    }

I've tried several different permutations of trying to get the breakpoint to be inside the if statement, but it keeps jumping to the else statement for no apparent reason.

**Attention** This is a public forum