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.

AM2632: How to configure UART character time out threshold?

Part Number: AM2632
Other Parts Discussed in Thread: SYSCONFIG

Hello TI team,

In the UART_IIR_UART register, there is a UART interrupt source of RX timeout which also is character time out in SDK.image.pngimage.png

But I can't find how to configure the RX timeout threshold in SysCfg, so could you please help me to solve this issue, thanks for your help.

image.png

  • Hi,

    The expert is currently out of office. Please expect a delay in response until they return next week. 

    Kind regards,
    AJ Favela 

  • Hello Zhang Xun,

    Thank you for your question regarding UART RX timeout configuration on the AM2632.

    Based on the technical reference manual, the UART character timeout (RX timeout) threshold can be configured using the UART_TIMEOUTL and UART_TIMEOUTH registers.

    Default Timeout Behavior:

    By default, the timeout period is calculated as: 4x the programmed word length + 12 bits. This is the automatic timeout value when the timeout registers are set to 0.

    Configuring a Custom Timeout Threshold:

    To manually configure the RX timeout threshold, you need to program a 16-bit timeout value (in baud clocks) across two registers:

    • UART_TIMEOUTL (offset 0x98) - Lower 8 bits of the timeout value
    • UART_TIMEOUTH (offset 0x9C) - Upper 8 bits of the timeout value

    When you write a non-zero value to these registers, it overrides the internal default timeout calculation and uses your custom timeout period specified in baud clocks.

    Timeout Behavior Modes:

    Additionally, you can control the timeout counter behavior using the UART_EFR2 TIMEOUT_BEHAVE bit:

    • UART_EFR2 = 0 (default): The timeout counter only counts when there is data in the RX FIFO. The counter resets on RX activity or when the UART_RHR register is read. The interrupt is cleared by reading UART_RHR.

    • UART_EFR2 = 1: The timeout counter runs even if no character has been received, generating periodic interrupts if the RX line remains idle. The counter auto-resets when timeout is reached. The interrupt is cleared by reading UART_IIR_UART.

    Regarding SysConfig:

    Currently, the UART timeout threshold configuration is not exposed as a configurable parameter in SysConfig. You will need to configure these registers directly in your application code after the UART driver initialization.

    Example approach:

    /* After UART_open() */
    uint32_t baseAddr = UART_getBaseAddr(uartHandle);
    uint16_t timeoutValue = <your_desired_timeout_in_baud_clocks>;
    
    /* Write lower byte */
    HW_WR_REG8(baseAddr + 0x98, (timeoutValue & 0xFF));
    /* Write upper byte */
    HW_WR_REG8(baseAddr + 0x9C, ((timeoutValue >> 8) & 0xFF));

    Please let me know if you need additional clarification on configuring the timeout registers or if you have questions about the timeout behavior modes.

    Best Regards,
    Zackary Fleenor