cancel
Showing results for 
Search instead for 
Did you mean: 

how to use just Rx pin of an uart

Lgarb.1
Associate II

Hi, I have a sensor that send data over uart to a stm32f722 uC. This sensor is powered at the same time of uC.

I've noticed that some times the sensor stop sending data. For example, if the code is running ok and then reboot the uC some times the sensor stop working. UART is configured as Transmitter and receiver, so I think that during initialization Tx pin from uC is sending some garbage and so the sensor stop working (the sensor is waiting for a 'space' char on Rx pin to stop and show a menu to the user configuration). So I would like to leave the Tx pin of the uC without use. How can i do that? I can configure Receiver only on cubeide, but it config the Tx pin anyway.

Is there a way to leave Tx pin of uart5 as reset state while Rx pin of uart5 is working?

Thank

2 REPLIES 2

You can configure it as a GPIO, or put the UART in RX ONLY mode

What you probably need to do is pull the pin high externally, so it isn't low or floating. The idle state of the serial pin should be high, the start bit has it going low.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

CubeMX doesn't support using only the RX pin, but the hardware does. You'll need to add your own code to do this.

However, the TX pin doesn't send "garbage" unless it's instructed to do so, or possible an extra edge during startup if there isn't an external pullup (there should be).

If you feel a post has answered your question, please click "Accept as Solution".