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.

Code Composer Studio watch SFR registers

Other Parts Discussed in Thread: MSP430F5438, MSP430G2553, MSP430G2452, CC430F6137

Hi,

I am using Code Composer Studio Core Edition  Version: 4.2.3.00004, but it can't show the real values of SFRs like P1OUT etc. Instead it shows fixed values like 0x0021 and doesn't changes even single stepping in debug mode. How to solve this?

  • You should be able to view/modify these register values from the register view (menu View->Registers). They would be under Port_1_2 (or similar depending on the device). You can also add them from here to the watch view if you wish - right-click on the register and select "Create Watch Expression". Let us know if this still does not work.

  • The problem is not to view or modify. I can add SFR to the watch window as the attached figure in my previous post, But the SFR values doesn't change while running the microcontroller, even on single stepping (the values remains as shown in the attached fig in the prev post). But the values of variables are changing while running, the problem is only with SFRs.

    Thanking You,

    Ras

  • Which MSP430 target are you running on? I tried some simple examples with MSP430F5438 and was able to see the value of P1OUT, P1DIR etc change when stepping through the code. It would be very helpful if you could provide your project so we can try to reproduce the issue and look into it further.

  • I am using MSP430 launchpad with MSP430G2553 (alos tried G2331)

    example code is below

     

    #include <msp430g2553.h>

    #define    LED_R        0x01

    void main(void)
    {
        WDTCTL     = WDTPW + WDTHOLD;                // Stop WDT
        if (CALBC1_1MHZ ==0xFF || CALDCO_1MHZ == 0xFF)                                    
          { 
            while(1);                           // If calibration constants erased
                                                // do not load, trap CPU!!
          }   
        BCSCTL1 = CALBC1_1MHZ;                    // Set range
        DCOCTL    = CALDCO_1MHZ;                    // Set DCO step + modulation
       
        BCSCTL2    = 0x00;
        BCSCTL3    = LFXT1S_0 + XCAP_3;            // 32kHz Crystal, 12.5 pf
       
        P1DIR    |= LED_R;                        // LED is o/p
       
        TA0CCR0    = 32767;                        // Count up mode, set period
        TA0CTL    = TASSEL_1 + ID_0 + MC_1 + TACLR;// ACLK, Div 1 : 1, Up mode, Clear
        TA0CCTL0     = CCIE;                            // Enable interrupt
        
        _enable_interrupt();   
        while(1);

    }

    // Timer_ATACCR0 interrupt vector handler
    //#pragma vector = TIMERA0_VECTOR
    #pragma vector = TIMER0_A0_VECTOR
    __interrupt void TA0_ISR(void)
    {
        P1OUT    ^= LED_R;

    }

  • Thanks for the clarification. I was able to duplicate this on a MSP430G2452 using a simple example.

    Basically, CCS is showing the address of the register in the value field, and hence is not getting updated. If you go into the Registers view, expand Port_1_2, right-click on P1DIR and P1OUT and "Create Watch Expressions", then they should appear correctly in the watch view and also update properly when stepping through the code.  Can you confirm that this works for you?

    I created a bug report to fix the default watch view display as that can be confusing. The bug # is SDSCM00040787.

  • Thanks, it is working now as you explained.

  • Aarti said:

    I created a bug report to fix the default watch view display as that can be confusing. The bug # is SDSCM00040787.


    To give an update on this, the way these symbols are displayed in the watch view is something we are not able to change in CCSv4 or v5. 
    This is because GEL searches from the symbol file first then the register server. If a symbol that has the same name as the register is defined in the object file, the info about the symbol will be returned, and displayed the way it is.

    Adding a watch expression from the register view is currently the only way to work around this.

     

     

  •  

    Dear AartiG

     I am using CCS Ver.4.2.4.00033  and I have a problem like you answered. You can see the problem in the picture . There is a variable (transmitting) and it is value is 1 but in watch window it is showen as 0xFF . And as you see in pic. the variable adress is 0x1c46 and there is 0x3fff in memory map. While trying changing  the value in memory view it is not possible.

    And I did something you suggested in this page but I could not solve the problem I am waiting for your response.

     

    Thanks for your help

    Hasan SELEK


     

     

  • Hasan,

    If you are using a CC430F6137, it sounds like you are running into the issue discussed here:
    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/109363/386639.aspx#386639

    Note that this bug is not yet fixed as of CCS 4.2.4. The next update 4.2.5 should have the fix. Also note that the code should ultimately work correctly, it is only the CCS displays in variable and memory view which will be incorrect.