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.

CCS5.1.1 + MSP430 Debugger displays Int values, but not char

I had declared an unsigned char array and assigned values, but the debugger variables window shows each value as '.' . It correctly displays the type as unsigned char and it's address is correct.

The Memory Browser shows the correct values at the assigned addresses. eg. for a 4 character array filled with the values 0x04, they are shown as 0404 0404

Changing the array to unsigned int, the values are displayed correctly.

Has anyone else seen this?

What am I doing wrong?

Or is this a bug in the debugger?

(I'm running CCS5.1 under WinXP, in VirtualBox running on Ubuntu 10.04)

((hanging out for CCS5.2 when the MSP430 will be supported in Linux))

  • Hi Errol.

    what MSP are you using?  How have you defined the unsigned char array and values? What if you right click in the variables view and go to Number Format and change the format?

    I did a quick test here and could not reproduce this.  I saw the values fine.  I was using CCS v5.1.1.1 and MSP430 code generation tools version 4.0.0.

    Would you be able to send a bit more detail?  Screenshots?

    Best Regards,
    Lisa

  • Hello,

    Since your declared your array as unsigned char, the debugger is defaulting to character display format. i.e. it is trying to convert 04 to ascii text. Decimal 04 in ASCII table is "End of Transmission" which is not a printable character thus it defaults to a '.' As Lisa suggested you could right click in expression view and change the display format to a decimal or hex to see the value.

    Martin

     

  • My bad. It's been such a long time since I used a char as a character, the thought never occurred to me. I use chars to save memory.

    Right clicking does solve the "problem". For some reason I never tried this. The new setting is remembered between sessions too. Well done.

  • Hi Errol,

    glad we could help :  )  All the best with the MSP and CCS.

    Best Regards,

    Lisa

  • Well, here is a clearer answer. You have some char variables in your code, and your problem is that the Variables View is not displaying their values. That's probably because they are not storing any character constants, as apposed to integer constants. A character constant would automatically appear in the value fields while anything else will appear as a period.

    You want to see what is actually stored in the char variable, so here's the answer to your problem.

    At the top of the Variables View is a button bar with icons. On the far right is a triangle. Click on that triangle to view a pop-up menu. In that menu, point to Number Format, and then select one of the following items to show the actual value for the variable.

    • Hex
    • Decimal
    • Octal
    • Binary
    • String

    It's been two and a half years since this post was closed, but this may help others who need it.