2021-11-29 11:48 AM
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
2021-11-29 11:56 AM
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.
2021-11-30 02:41 PM
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).