STM32F207VE UART Routing mistake
Hi,
I have design a custom board with the STM32F207VE. But I made a mistake in routing the UART TX as RX and UART RX as TX. Is there a way to change the STM32 UART TX port to an RX through the software?
Hi,
I have design a custom board with the STM32F207VE. But I made a mistake in routing the UART TX as RX and UART RX as TX. Is there a way to change the STM32 UART TX port to an RX through the software?
Is there a way to change the STM32 UART TX port to an RX through the software?
Yes. Setting the HDSEL bit in USARTx->CR3 enables half-duplex mode, which uses the TX pin for both transmitting and receiving. Then setting RE and clearing TE in CR1 disables transmitting, so the TX pin will be only receiving.
Note that it doesn't work the other way round, to transmit data you'd need to shift it out one bit at a time on the RX pin, with proper timing and framing (adding start and stop bits)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.