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: Program stops running after termination

Part Number: MSP430G2553
Other Parts Discussed in Thread: MSP-FET, MSP430WARE

Tool/software: Code Composer Studio

I'm using MSP430G2553 to learn embedded system. When I write a code to blink led in "while(1)" loop it keeps running even if I terminate the debugging. But when I use the timer peripheral to do the same thing it doesn't keep running when I terminate the debugging. What is it causing? I want to learn. My code is below which doesn't keep running when it is terminated.

#include <msp430g2553.h>

#define GREEN_LED BIT0 // Port 1.0

void main (void) {

WDTCTL = WDTPW + WDTHOLD; 
TA0CCR0 = 65000;
TACTL = TASSEL_1 + MC_1;

P1DIR |= GREEN_LED; 

while(1){
if (TACTL & TAIFG) {
P1OUT |= GREEN_LED;
_delay_cycles(20000);
TACTL = TACTL & (~TAIFG);
}
P1OUT &= ~GREEN_LED;

}
}

  • Akin Donma said:
    But when I use the timer peripheral to do the same thing it doesn't keep running when I terminate the debugging.

    I can repeat the problem using your example program, with CCS 10.0 under Linux and using a MSP-FET.

    The target continues to run if select "Disconnect Target" from the Debug View, and stops running at the point the debug session is terminated.

    Akin Donma said:
    What is it causing?

    There are some debugger options to stop clocks on emulation halt, where the default options are to halt the clocks on emulation halt:

    I attempted changing the options to not halt TACLK on emulation halt, but the program still stopped running when terminated the debug session.

    I also tried using a MSP-FET430UIF instead of a MSP-FET, and older CCS 7.4, CCS 8.3 and CCS 9.3 versions which also had the same behaviour.

    As a result, not sure what is causing this and if a a bug or by design.

  • Thank you for your answer. I wanted to try this but I couldn't find 'MSP43x Debugger Options'. There is "Debugger Configuration" and it is saying that "Tools -> Debugger Options" but I couldn't find "Tools" section either. Could you help me to find it?

  • Hi,

    I was working on other projects with my MSP-EXP430G2 Launchpad and tried yours as well, with the same effects. 

    Given that I can't seem to be able to make the project work outside of a debug session, even after power cycling the board, it leads me to believe the code is at fault. Otherwise, the code should have worked from power up without any CCS debugger interference. 

    Two things that CCS Debugger does while debugging a MSP430: provide power and clock for the device to operate. 

    I could verify that power is properly applied to the device while it is plugged to the USB port, thus I looked at the various MSP430Ware projects and, among the 21 examples that use Timer A, the one below has an interesting statement that explains why my Launchpad does not work without a debug session. It may also explain why yours do not work as well. 

    The solution is then to solder a crystal to the board in order to keep the device running. I couldn't do this yet, but I think one was provided with my board and I'll see if I can find it.  

    Hope this helps,

    Rafael