Is it possible to use the NRF52832 UART in half-duplex single-wire mode, by assigning TXD and RXD to the same GPIO, setting the GPIO drive to disconnect '1' and using a pull-up resistor?
Is it possible to use the NRF52832 UART in half-duplex single-wire mode, by assigning TXD and RXD to the same GPIO, setting the GPIO drive to disconnect '1' and using a pull-up resistor?
It is not possible.
It may work if you put a diode between TX and RX and use pullup resistor on the RX line. Do a search on the internet, there is a lot of information about this topic with other MCUs.
I understand how that works, but I don't see the need for a diode. NRF52832 has open-drain outputs on all GPIOs (GPIO drive set to disconnect '1'), so it should be enough to short TX and RX directly together, without the diode. I was simply wondering if i have to short two separate pads externally, or is it possible to short the signals internally using the PSELTXD and PSELRXD registers. Figure 21: GPIO Port and the GPIO pin details on page 112 suggests that it should work, but perhaps there's something else which will prevent it from working. I don't have the dev kit yet, otherwise I would just check and see.
The problem is when you are receiving data. If TX and RX is connected you will have a short when you are receiving data since TX pin is output (current will flow from TX pin on the nRF to the TX pin on the other device), that is why you need a diode.
Setting the output to disconnect '1' has basically the same effect as adding the diode. The diode is only needed with push-pull outputs, it's not needed in the case of open drain outputs. When the GPIO is set to open drain mode (or "disconnect '1'" as called in the NRF52832 manual), the pin will only actively drive the '0' state. '1' will be floating, and the high state will only be forced by the pull up resistor. When TX is idle, the output state is '1', or floating in case of open drain outputs.
GPIO register PIN_CNF DRIVE field set to S0D1 or H0D1 has a similar effect to adding the external diode.