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.

AM2434: API Usage for UART HW Flow Control

Part Number: AM2434
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi,

 

My customer is evaluating UART driver example “UART Echo Low Latency Interrupt” or “UART Echo Low Latency Polling” in MCU+ SDK 10.01.00.

 

They want to configure the UART as half-duplex with hardware flow control with enabling Auto_RTS_EN and disabling Auto_CTS_EN.

 

Could you share any example code with the above settings ?

Could you tell them how to configure for the above ?

 

They found some APIs and Parameters like UART_open(), UART_FCTYPE_HW, UART_FCPARAM_AUTO_RTS, UART_FCPARAM_AUTO_CTS, etc…

But they’re not sure how to use these APIs and parameters.

 

Thanks and regards,

Hideaki

  • They want to configure the UART as half-duplex with hardware flow control with enabling Auto_RTS_EN and disabling Auto_CTS_EN.

    Thanks for mentioning the requirement.

    Please have a look at the following highlighted section.

    Regards,

    Vaibhav

  • Hi Vaibhav,

    Thank you for your response. The following highlighted UART CTSn Pin or UART RTSn Pin seem to be PinMux configuration.

    If UART CTSn Pin above is unchecked, the AUTO_CTS_EN bit on UART_EFR register below is cleared ?

      

    Thanks and regards,

    Hideaki

  • Thanks for your follow up response.

    I will check this in my setup by running UART application.

    Regards,

    Vaibhav

  • Thanks, Vaibhav.

    Please let me know once you could confirm it. It would be appreciated if we can receive it soon.

    Thanks and regards,

    Hideaki

  • Hi,

    I have ran some experiments by modifying the HW flow control check option in SysConfig and checking/unchecking the CTS line as well.

    I have not seen in any of the cases the auto CTS enable bit being disabled, from 1 to 0.

    I am still trying to wrap the logic around when this is actually used and effective for communication.

    I will do my part on this and let you know once I have further updates.

    Regards,

    Vaibhav

  • Vaibhav,

    Thanks for your reply.

    I have ran some experiments by modifying the HW flow control check option in SysConfig and checking/unchecking the CTS line as well.

    I have not seen in any of the cases the auto CTS enable bit being disabled, from 1 to 0.

    If so, the first your answer is not correct for their question below ?

    They want to configure the UART as half-duplex with hardware flow control with enabling Auto_RTS_EN and disabling Auto_CTS_EN.

     

    Could you share any example code with the above settings ?

    Could you tell them how to configure for the above ?

    Again, Could you please tell the customer how to disable Auto_CTS_EN.

    Thanks and regards,

    Hideaki

  • Hi Vaibhav,

    The customer want to know how to disable Auto_CTS_EN by using API.
    Could you share the example code ?

    Actually, they tried to uncheck UART CTSn Pin(UART0_CTSn) by following your suggestion, but Data cannot be sent even though CTS is not connected. CTS seems to be enabled.
    On the other hand, they tried to check UART CTSn Pin(UART0_CTSn), then data was able to be sent.
    It looks a bug on SysConfig.
    Therefore, they want to know how to disable Auto_CTS_EN by using API.

    Thanks and regards,
    Hideaki

  • Therefore, they want to know how to disable Auto_CTS_EN by using API.

    I am not seeing any such API currently in the MCU PLUS SDK, allow me sometime to check more on this.

  • Hi Hideaki,

    On the latest SDK, I see that there is a check for HW flow control.

    Can you please ask the customer to refer the file uart_v0_lld.c

    Inside this file, there is a call made with the help of an API called: 

    UART_hardwareFlowCtrlOptSet
    This has an argument of 
    UART_RTS_CTS_ENABLE which basically says, both RTS and CTS is enabled.
    The macro 
    UART_RTS_CTS_ENABLE has a value of 3 which is 11b hence both CTS and RTS is enabled.
    We just want the RTS to be enabled, hence we have to simply pass the argument which is:
    UART_RTS_ENABLE
    So instead of the call being made as: 
     UART_hardwareFlowCtrlOptSet(baseAddr, UART_RTS_CTS_ENABLE);
    The call should rather be:
     UART_hardwareFlowCtrlOptSet(baseAddr, UART_RTS_ENABLE);
    Can you please propose this to the customer and let me know if it works for them?
    Looking forward to your response.
    Regards,
    Vaibhav