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 4.2 watch window giving incorrect values

I'm using CCS 4.2.1 with the MSP430G2331 chip and the launchpad as the FET.  I'm trying to debug my program and I keep getting erroneous values in the watch window.  Right now I'm trying to watch BCSCTL1, 2 and 3 to make sure the chip is getting configured correctly.  When I look at the watch window for those values it doesn't match what I set.

 

Here's some code:

    #include  "msp430x20x2.h"   

    BCSCTL1 = CALBC1_1MHZ + DIVA_3 +XT2OFF;                    // Set range
    DCOCTL = CALDCO_1MHZ;
    BCSCTL2 = SELM_0 + DIVM_0 + DIVS_3; //
    BCSCTL3 =  LFXT1S_2; //Setting LF clock to VLO

After stopping execution two lines after these (those two lines do not touch those registers).  The watch shows me this:

BCSCTL1 = 0000000001010111

BCSCTL2 =0000000001011000

BCSCTL3 = 0000000001010011

 

This is one specific example.  I've had the same problem of incorrect watch values at other places, but have the program executes as desired.  Does anyone know what is going on?

  • It seems this is a known issue.  There is a similar e2e question that is seven months old and was never solved.  A work around is provided in it, but I would like a solution if anyone has one.

  • Edited to correct answer:

    The problem is that the target program defines most of the memory mapped registers through #defines in various header files. These appear as symbols in the loaded .out file. The watch view will display the symbol from the out file.  You will notice that if a program is not loaded, the watch view will not find the register names you enter.

    Registers can still be displayed in the watch view though if they are prefixed by the group name. P1DIR, for example, can be displayed as Port_1_2_P1DIR. Registers can also be added to the watch view through the "Create Watch Expression" context menu in the register view.