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.

StarterWare C6748 UART Stop bits

Hello,

I'm having troubles understanding how to prepare the config parameter for the function UARTConfigSetExpClk, there is only one define UART_STOP_BIT that has the value 0x04U, how can I specify the number of stopbits per frame and what options are available? Is it enough just to config |=UART_STOP_BIT to enable multiple bits?

Thank you in advance,

David.

  • Hello David,

    Referring to the API comments of UARTConfigSetExpClk() API, we understand that 'config' parameter caters to the setting of the Parity configuration, number of stop bits and number of data bits per frame. To simplify matters and to answer to the current context, I would not explain how parity features can be configured.

    Settings for the number of data bits per frame and number of stop bits per frame go hand-in-hand. The following two configurations are possible.

    > 1 stop bit per frame can accompany 5, 6, 7 or 8 data bits per frame. In this case, the 'config' parameter shall be

    • config = (UART_LCR_WLS_5BITS)  OR
    • config = (UART_LCR_WLS_6BITS)  OR
    • config = (UART_LCR_WLS_7BITS)  OR
    • config = (UART_LCR_WLS_8BITS).

        In the above case, no separate macro for number of stop bits needs to be specified.

    > The following combinations are also possible.

    • 1.5 stop bits and 5 data bits per frame;  config = (UART_STOP_BIT | UART_WORDL_5BITS)
    • 2 stop bits and 6 data bits per frame;  config = (UART_STOP_BIT | UART_WORDL_6BITS)
    • 2 stop bits and 7 data bits per frame;  config  = (UART_STOP_BIT | UART_WORDL_7BITS)
    • 2 stop bits and 8 data bits per frame;   config = (UART_STOP_BIT | UART_WORDL_8BITS)

    Summarizing, number of stop bits per frame can be only 1, 1.5 or 2 but they come with corresponding specific number of data bits per frame.

    For further information, please refer to the Line Control Register (LCR) of the UART Peripheral Description in Technical Reference Manual of your SoC.

    Please revert back for any queries.

    Thanks and Regards.

    Gurudutt.