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/CC2650MODA: UART Reading in the middle of a message

Part Number: CC2650MODA


Tool/software: Code Composer Studio

Right now I have an MSP432 talking UART to a CC2650MODA. The MSP432 sends information in the pattern: one letter, three numbers, four ones (B9791111), but when I read the information received by the 2650 sometimes it will mess with the pattern ie 11B97911 or 1B979111. Every time I unplug the 432 and plug it back in the pattern will change, it could send the correct pattern until I unplug it, or do one of the previous examples of a messed up pattern. The two devices have the same UART params which are listed here:

uart_params.baudRate=115200;
uart_params.dataLength=UART_LEN_8;
uart_params.parityType=UART_PAR_NONE;
uart_params.stopBits=UART_STOP_ONE;

uart_params.readCallback=NULL;
uart_params.readEcho = UART_ECHO_OFF;
uart_params.readReturnMode = UART_RETURN_NEWLINE;
uart_params.readDataMode = UART_DATA_TEXT;
uart_params.readMode = UART_MODE_BLOCKING;
uart_params.readTimeout = UART_WAIT_FOREVER;

uart_params.writeCallback = NULL;
uart_params.writeDataMode = UART_DATA_BINARY;
uart_params.writeMode = UART_MODE_BLOCKING;
uart_params.writeTimeout = UART_WAIT_FOREVER;

How can I get the 2650 to read the correct pattern?

  • Hi Nathaniel,

    Are you clearing the Rx buffer between reads?

    Refer to the TI Drivers API Guide for more information: software-dl.ti.com/.../_u_a_r_t_c_c26_x_x_8h.html
  • Hello Rachel,

    I just added:
    memset(uart_rx, 0, 8);
    after reading the UART buffer but I am still getting the issue of sometimes the pattern is off. My code now looks like this in the task:

    ret = UART_read(uart_handle, uart_rx, 8);//this will write the data into the buffer
    UART_write(uart_handle, uart_rx, 8);
    SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR5, 8, uart_rx);//should set 8 bytes worth of info to the simple profile CHAR5
    memset(uart_rx, 0, 8);

    What could I be doing wrong?

  • I realize that this error is that the UART is reading in the middle of a message and that it spilling over into another message. I added a memset(uart_rx, 0, 8); write before the UART_read as well but the issue still persists. How can I fix this?

    I have found that when I run the 2650 for the first time the data is read correctly, when unplugging the 432 it starts to read in between messages, if the 2650 restarts it gets back on track. Is there some way to ensure that even when the 432 is unplugged and plugged back in the 2650 will read data correctly?