This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52810: how to remap uart pin(pin6 & pin8) to other pin(pin21 & pin22 or other any pins)? thanks!

static void uart_init(void)
{
    // Configure UART0 pins.
    nrf_gpio_cfg_output(TX_PIN_NUMBER);///< this pin remap to pin 21
    nrf_gpio_cfg_input(RX_PIN_NUMBER, NRF_GPIO_PIN_NOPULL); ///< this pin remap to pin 22

    NRF_UART0->PSELTXD       = TX_PIN_NUMBER;///< this pin remap to pin 21
    NRF_UART0->PSELRXD       = RX_PIN_NUMBER;///< this pin remap to pin 22
    NRF_UART0->BAUDRATE      = BITRATE;

    // Clean out possible events from earlier operations
    NRF_UART0->EVENTS_RXDRDY = 0;
    NRF_UART0->EVENTS_TXDRDY = 0;
    NRF_UART0->EVENTS_ERROR  = 0;

    // Activate UART.
    NRF_UART0->ENABLE        = UART_ENABLE_ENABLE_Enabled;
    NRF_UART0->INTENSET      = 0;
    NRF_UART0->TASKS_STARTTX = 1;
    NRF_UART0->TASKS_STARTRX = 1;
}

Parents Reply Children
No Data
Related