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.

MSP430FR6989 - Code Composer Studio - MCU won't store unsigned char value

Other Parts Discussed in Thread: MSP430FR6989

Hi,

New to the MSP430 Launchpad and code composer studio, which seem to be both awesome.

However I'm having an issue when I try to run this bit of code on my MSP430FR6989 Launchpad (See code and screenshot below).

So the issue appears to be that I cannot store an unsigned char value on my mcu with a value greater than 127 (which should be the upper  limit for the signed char, which I have tested numerous times now, it stores numbers exactly like signed char), signed char works perfectly though, any thoughts?


  • This appears to be a bug in the CCS debugger; -8 is the value that results from interpreting the value 248 as a signed char.
  • Alan Gutierrez said:
    So the issue appears to be that I cannot store an unsigned char value on my mcu with a value greater than 127 (which should be the upper  limit for the signed char, which I have tested numerous times now, it stores numbers exactly like signed char), signed char works perfectly though, any thoughts?

    This appears to be a limitation in the Number Formats supported in the Variables view in CCS 6.2.0, which affects how the variables are displayed by the CCS debugger.

    Taking your example code, the default Number Format for char variables is to display the ASCII character, or a dot if the value isn't a printable ASCII character:

    The Variables View allows the Number Format to be changed from Default to Hex, Decimal, Octal or Binary:

    When Decimal is used as the Number Format there is no way to explicitly specify it to display either a singed or unsigned representation, and CCS 6.2.0 appears to treat the Decimal Number Format as implicitly signed.

    For unsigned char variables one work-around is to select a Hex Number Format on the variables view:

    Another work-around is to use the Expressions view and enter expressions which explicitly cast the char variables to unsigned int or signed int as required:

  • I verified this on my software (free version), you are correct, it's displaying the proper value in binary and hex.
    Is this also a problem in the paid version of CCS 6.20?
  • The registered and the free version are 100% identical regarding the functionality and the behaviour. The code size limitation isn't present on the licensed one.
  • Thank you both very much, I hope that they fix this bug soon, it's a little annoying.

**Attention** This is a public forum