Can I use a single pin for USART TX/RX (RS485 Slave) on STM32H533?
Hi everyone,
I am currently working on a project using an STM32H533RET6 and I need to implement an RS485 Slave interface. To save as many GPIOs as possible, I was wondering if it is possible to use just one single CPU pin for both USART TX and RX (and one additional pin for both RE and DE)?
I know that the STM32 supports a Single-wire Half-duplex mode (setting HDSEL in the USART_CR3 register). From my understanding, this makes the TX pin bidirectional and completely frees up the RX pin to be used as a standard GPIO.
However, my main concern is how to connect this to the external RS485 transceiver. A standard transceiver (like the MAX485) requires at least three pins: DI, RO, and the DE/RE control pin.
My thoughts so far: If I tie DI and RO together and connect them to the STM32's TX pin, I would still need a second GPIO to toggle the DE/RE pin. That would be a 2-pin solution.
Has anyone successfully implemented this approach in a real project? Are there any hidden pitfalls regarding the configuration?
Any advice or experiences would be highly appreciated!
Thanks in advance
