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.

RTOS/MSP430F5529: The question about configuring UART data length using TI-RTOS

Part Number: MSP430F5529


Tool/software: TI-RTOS

Hello.

I have a question.

Could you tell me how to configure UART data length to 7 bits in the TI-RTOS sample code?

I am using "UART Echo" sample code in the TI-RTOS for MSP43x package.

Although I modified following codes, UC7BIT of the UCA1CTLW0 register is not set.

   ・ in the souce file "uartecho.c":

  UART_Params_init(&uartParams);
  uartParams.writeDataMode = UART_DATA_BINARY;
  uartParams.readDataMode = UART_DATA_BINARY;
  uartParams.readReturnMode = UART_RETURN_FULL;
  uartParams.readEcho = UART_ECHO_OFF;
  uartParams.baudRate = 9600;
  uartParams.dataLength = UART_LEN_7;
  uart = UART_open(Board_UART0, &uartParams);

 ・in the souce file "UARTUSCIA.c":

  object->readMode = params->readMode;
  object->writeMode = params->writeMode;
  object->readTimeout = params->readTimeout;
  object->writeTimeout = params->writeTimeout;
  object->readCallback = params->readCallback;
  object->writeCallback = params->writeCallback;
  object->readReturnMode = params->readReturnMode;
  object->readDataMode = params->readDataMode;
  object->writeDataMode = params->writeDataMode;
  object->readEcho = params->readEcho;
  object->dataLength = params->dataLength;

Regards,

uchida-k

  • Hello Uchida-K,

    It has come to my attention that TI-RTOS for MSP430 does not support 7-bit mode for UART. I will be filing a request for this to be updated.
  • Hi Jace H,

    Thank you for your reply.

    According to your answer, Do all UART APIs for TI-RTOS not support 7-bit mode for UART?

    I am using TI-RTOS for my application software.

    Are there any solutions to communicate by 7-bit mode UART using TI-RTOS?

    For example, can I use 7-bit mode for UART by setting UC7BIT of the UCA1CTLW0 resister  to 1 before using UART APIs for TI-RTOS?

    Regards,

    uchida-k

  • Hello Uchida-k,

    You can certainly set up 7-bit UART mode via register level code, but I am unsure of how that will work with TI-RTOS APIs as I am not too familiar with TI-RTOS.
  • You can simply add the code into the drivers open call. You can then rebuild the library (as described in the User Guide) or just add the UARTxyz.c into your project. The functions in your project will be picked up before the functions in the library.

    Todd

**Attention** This is a public forum