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/MSP430F149: MSP-FET (new) can not debug for MSP430F149

Part Number: MSP430F149
Other Parts Discussed in Thread: MSP-FET

Tool/software: Code Composer Studio

Dear All,

I ask about the debuge for MSP430F149 and its TA counter.

I have a project using MSP430F149. In this project I uses TA counter and TB counter. To test the operation of TA counter I have a small program "Test".

Use MSP430F149 board, Code Composer Studio 7.1 and MSP-FET Flash Emulation Tool.

When I debugger, I click in Step Into for run each command line then TAR counter change in disorder as follows: 0  --> 38967 --> 38996 --> 42520 --> 64096 --> 38964 --> 1359 --> 23207 --> ...... --> 20107 --> 42745 --> 42440 --> 10858 --> 21950 --> 32271 --> ....

I do not understand how is this ?.

I think the TAR must change as follows: 0 --> 1 (or 2, or 3 depending on the command cycle) --> 2 (or 3, or 4) --> 3 --> 4 --> 5 --> ...100 --> 101 --> .... 65534 --> 65535 --> 0 --> 1 --> 2 --> 3 --> 4 --> 5 --> ...

Please kindly explain to me.

In addition, the program runs forever in TA0_ISR that does not exit out to jump to in Loop_not. So, debugger is not significant. Can not debug, to complete a long program will be difficult.

I have made a video posted on youtube. Please take a look at the link: https://youtu.be/AQNGV9xQdx4

  • Hi,

    The behavior you're experiencing seems normal. The TAR is counting 0 --> 1 --> 2 --> 3 --> 4 --> 5 -->... but when you step through using the debugger more than one clock tick occurs which increments the timer more than once.

    Also can you explain a little more about how you are running forever in the ISR? It might be helpful to share your TimerA setup code along with the ISR code.

    Best regards,
    Caleb Overbay
  • Dear Caleb Overbay,

    Thanks for your reply, but you are probably never used debugging. In my video the rise and fall of TAR was not normal. From line 38 to line 39, the MSP430F149 only executes an instruction: "mov.w #TASSEL_2+MC_2, &TACTL" but TAR varies from 0 to 38967. With XT2 = 8MHz --> cycle: 1/80000000 S = 0.000000125 S = 0.125uS. So, for the MSP430F149  executes a instruction "mov.w #TASSEL_2+MC_2, &TACTL " must a time: 0.125 uS x 38967 = 4870.875 uS. This is unreasonable, unacceptable.

    Best regards

    Do Van Lam

  • Hi,

    I have debugged extensively with the MSP430 microcontroller family and am very familiar with our debugging tools. I still believe the behavior you're experiencing is expected. I'm assuming TimerA is being soured from the external 8MHz crystal as well as your CPU(MCLK).

    The debugger controls the CPU, not the timer module. You can stop the timer with the debugger but you can't have single clock tick resolution, especially at 8MHz. So when you step over "mov.w #TASSEL_2+MC_2, &TACTL" with the debugger, it takes 1 CPU clock cycle but it takes longer than 1 clock cycle for the debugger to interact with the CPU to tell it to start, execute, and stop. During this time frame the timer is receiving multiple clock edges and increments accordingly. In other words, the debugger can't instantaneously stop the timer.

    So in reality the timer is counting 0 --> 1 --> 2 --> 3 --> 4 --> 5 -->... but the debugger doesn't control the timing of the timer, only the CPU. I recommend verifying the operation of the timer in other ways. Consider toggling a GPIO periodically with the timer then using a scope to measure the frequency.

    Best regards,
    Caleb Overbay
  • Hi,

    Do you still need help with this issue?

    Best regards,
    Caleb Overbay

**Attention** This is a public forum