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.

CCS/MSP430G2553: LaunchPad™ Development Kit (MSP‑EXP430G2ET)

Part Number: MSP430G2553

Tool/software: Code Composer Studio

LaunchPad™ Development Kit (MSP‑EXP430G2ET) issue: debugging in not working in interrupt routine.when we start debugging it get halted in interrupt routine.

code given below:

#include <msp430g2553.h>

unsigned int j=0;

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1DIR |= 0x41; // P1.0 AND P1.6output
TACTL = TASSEL_2 + MC_2 + TAIE; // SMCLK, contmode, interrupt

_BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/ interrupt
}


// Timer_A3 Interrupt Vector (TA0IV) handler
#pragma vector=TIMER0_A1_VECTOR


__interrupt void Timer_A(void)   ///** in this routine debugging not possible.
{
j++;

if(j==20)
{
P1OUT ^= 0x41;
}
}

  • Hi,

    sapana darekar said:
    debugging in not working in interrupt routine.when we start debugging it get halted in interrupt routine.

    What exactly do you mean by that? Does it never stop at the interrupt or it always stop at the interrupt but does not move forward? If it never stops, did you try to add a breakpoint to it?

    I tested your code in my board and it works - both LEDs blink at a period of about 2 seconds. 

    Regards,

    Rafael

  • Thank you for your feedback.

    My code is working when i run it. But as i am learning programming so I want to know how  step by step program execution happen.

    Program is working step by step till interrupt routine after that step by step debugging get halted in the interrupt routine.

  • Hi,

    I think I understand what may be happening. When you are performing a step-by-step operation, the timer interrupts will happen independently if the MSP core is halted or not.

    In this case, since there will be always a timer interrupt being triggered while you are stepping (your actions are much slower than the timer itself), the interrupt service routine (ISR) will be executed repeatedly. 

    If you have additional code running in main(), you can put a breakpoint in a given place and put the processor to run. In this case, the timer interrupt will be serviced only once and the processor goes to the main routine to execute the rest of the code until it reaches the breakpoint. This way you can see it run other functions as well. 

    Regards,

    Rafael