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.

Working with long values Debugger and 32 - bit multiplys

Other Parts Discussed in Thread: MSP430F5438

CCS 5.1, MSP430 compiler 4.01, MSP430F5438

I am having an issue with getting 32-bit muliply results out of the RES0, RES1... values.

The multiply appears to be correct.  But when I start debugging and looking at long values

I can't see any correct values. 

Here is a sample code I made that will not correctly show "results" or "test"

#include <stdio.h>
#include <msp430.h>

/*
 * hello.c
 */
void main(void) {
        register unsigned long results = 0;
        unsigned int test;

        MPY32L = 86400UL & 0x0000FFFF;
        MPY32H = 86400UL >> 16;
        OP2L = 15401;
        OP2H = 0x0000;
        test = RES1;
        results = (unsigned long) RES1;
        results = (results<<16) | RES0;
}

Issues: No value is shown when I try and look at results or test.

I look at the RES values and they have the correct answer.

Is there some setting  need to set in the compiler/debug options!  This same code works in IAR.

I just started a new workspace, created a new project "hello world" and added this code with the "MSP430.h" include.

thanks

Dan

  • This looks like a known issue where the debugger cannot correctly display variables larger than 16 bits which are stored in registers on MSPX devices. The tracking number for this issue is SDSCM00042242.

  • Pete-

    Is there any news on this debugger problem yet? Working with ADC scaling and values is a real pain without the ability to view 32-bit variables, or even seeing it split across two 16-bit variables. I can actually get it to display the variable if I split it up, like in the code below, but the debugger is still not showing the upper 16bits correctly.  

    UINT32 temp;
    UINT16 t1;
    UINT16 t2;
    temp = 0;
    // Create temporary storage for 32-bit value to allow for scaling and ref voltage
    temp = *adcReading * (UINT32)(ADC_REFERENCE_VOLTAGE_VOLTS * scalingFactor);
    t1 = 0xFFFF & temp;
    t2 = temp>>16;
    temp = t1+t2;
    
    
     
    
    
    Anyway, If there's a better way to deal with it, I'd love to hear it.
    
    
    Thanks,
    Josh E
  • This particular issue should be fixed for CCSv5.2 with MSP430 CGT 4.1.1. If you haven't updated, could you update and let me know if you're still seeing a problem? (Note in some cases optimization still affects the accuracy of debug info, unrelated to this issue.)