It is possible to switch the TX pin to open drain, when the UART is enabled on an nrf53?
My goal is to use the uart as a 1 wire interface,
It is possible to switch the TX pin to open drain, when the UART is enabled on an nrf53?
My goal is to use the uart as a 1 wire interface,
Since we do not have a one wire implementation I would suggest you look at the third party implementation suggested in this thread: https://devzone.nordicsemi.com/f/nordic-q-a/30474/nrf52-dallas-slave-1-wire-with-bt
It is written for nRF51 originaly, but it should run on the nRF52 as well.
You missed the original question. Can I make the uart device, with the TX pin being open drain?
You missed the original question. Can I make the uart device, with the TX pin being open drain?
Ah, I see. Try adding this function in SDKv1.5.1 uart_nrfx_uarte.c:
NRF_STATIC_INLINE void cfg_tx_pin(uint32_t pin_number) { nrf_gpio_cfg( pin_number, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, // Connect for single pix tx/rx NRF_GPIO_PIN_PULLUP, // If not using external pull-up NRF_GPIO_PIN_H0D1, // Open drain NRF_GPIO_PIN_NOSENSE); }
Then change this around line 1424 in uart_nrfx_uarte.c:
nrf_gpio_pin_write(config->pseltxd, 1); nrf_gpio_cfg_output(config->pseltxd);
to this:
nrf_gpio_pin_write(config->pseltxd, 1); cfg_tx_pin(config->pseltxd);
OK, thanks!
I edited my response above to show input connected; assuming you are wanting to use a single pin for both Tx and Rx. Let us know if you have it working ok - thanks