2017-12-22 07:34 AM
Hi
Is there an option to only use the Rx-pin of a uart / usart so that the Tx-pin can be used for something else (in my case SPI_SCK)?
If I enable a uart / usart in STM32CubeMx and go to the 'Configuration' tab I can change 'Data Direction' to 'Receive only'. But this doesn't disable the Tx-pin.
Another way may be using half-duplex mode but then the Tx-pin would be used anyways and I couldn't use it for SPI.
Note: I am still planning my own board and don't have any hardware to test.
Hopefully someone can help.
Regards
Lukas
#usart #usart-rx #uart #uart-rx2017-12-25 12:19 PM
You can switch Tx to a pin that does not come out of your package...
Which chip are you using, what package ?
2017-12-25 12:52 PM
Hello Lukas,
On of USART modes is called Single Wire (Half Duplex). This mode uses single pin for USART and by using this pin USART is able to both transmit and receive. But as far as I know in all cases USART TX pin is used for this mode, so you would be able to use USART RX pin for different purpose.
USART Single Wire (Half Duplex) mode can be configured in Pinout tab of STM32CubeMX. Please see below the picture, which shows an example.
Regards
Szymon2017-12-26 12:02 AM
Activating the UART cell and each GPIO (alternate function mode or else) are independent.
By extension you could also dynamically (time multiplex) several GPIOs tied to the same UART.
2017-12-26 09:04 AM
Should be able to just enable/use an RX pin for a USART for most STM32 parts. The F1 series can be a bit problematic as AF mapping is done at a peripheral rather than a pin level.