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.

UART pins as GPIO

Hello Everyone,

I have a unique application where the UART pins need to act as GPIO and UART for communication. It is a 1-wire communication interface where the Tx pin behaves as GPIO for a short while before acting as Tx line.

Ideally I'd like to place the UART pins as GPIO input when Idle and then enable them to be UART pins when transmitting or receiving. Any thoughts on how I can achieve this in the driver? 

Please do let me know if you need more information from my side.

Thank you in advance for your help.

Regards

Santhosh

  • You need to realize the state of IOs can not be guaranteed when changing the mux mode bits.  So the design would need to insure any glitches that occur on the IO as you change the pin mux mode from GPIO to UART or UART to GPIO will not cause a problem.

    Regards,
    Paul

  • Hello Paul,

    I agree with the glitch part - each of the pins has an external pull-down and the 1-wire interface requires debouncing of the signals before using them. 

    However, I don't know how to do this in the Linux driver, that is my first concern.

    Thanks for your inputs, I will take that into account during development.

    Regards

    Santhosh

  • Hello Guys,

    Any thoughts on how I can set the control pads to GPIO and then back to Mode 0 for UART within the linux driver?

    Thank you

    Regard

    Santhosh