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/SIMPLELINK-MSP432-SDK: UART issue - incorrect ascii value received

Part Number: SIMPLELINK-MSP432-SDK

Tool/software: Code Composer Studio

Hello everyone,

I am trying to code up a simple program to turn on an LED after reading a specified character from a char array. For the reading process, I am expecting the incoming bytes on the UART channel to be in ascii format (a = 97 in decimal), as it had worked that way in the past, but I am not receiving them in this format. As an example, I type in the character "a" which should come in as 97 but instead comes in as 134. I am using  CCS 7.2 with the MSP432 (red version). I can post code if requested. To clarify, my reading process is working, but I am receiving values different from what I am expecting.

  • Thomas,

    Can you please post your code? That would greatly help.
  • 134 is a with a circle on top.
    http://www.asciitable.com/

    Are you sure you aren't sending a special character?
  • 97=0x61 is the bit-reversed equivalent of 134=0x86.

    I suspect you're setting UCMSB, but you shouldn't.
  • For those who also run into this issue, I used the driverlib example uart_loopback_24mhz_brclk on CCS 7.2. In the UART config structure,
    ```const eUSCI_UART_Config uartConfig =
    {
    EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
    13, // BRDIV = 13
    0, // UCxBRF = 0
    37, // UCxBRS = 37
    EUSCI_A_UART_NO_PARITY, // No Parity
    EUSCI_A_UART_MSB_FIRST, // MSB First
    EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
    EUSCI_A_UART_MODE, // UART mode
    EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION // Oversampling
    };```

    The MSB line should be LSB. Thanks again for the help! I completely forgot about this configuration option.

**Attention** This is a public forum