This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can i change Rx, Tx pin of UART?

Hi, I made a PCB board nrf51822.

Because of my mistake, Rx, Tx pin was not cross connected to MCU.

So i want to change Rx <-> Tx pin.

In the example of ble_app_uart_s130_pca10028,

I change the below source code.

const app_uart_comm_params_t comm_params =
{
    RX_PIN_NUMBER,
    TX_PIN_NUMBER,
    RTS_PIN_NUMBER,
    CTS_PIN_NUMBER,
    APP_UART_FLOW_CONTROL_ENABLED,
    false,
    UART_BAUDRATE_BAUDRATE_Baud38400
};

to

const app_uart_comm_params_t comm_params =
{
    9,
    11,
    RTS_PIN_NUMBER,
    CTS_PIN_NUMBER,
    APP_UART_FLOW_CONTROL_ENABLED,
    false,
    UART_BAUDRATE_BAUDRATE_Baud38400
};

And upload the firmware on nrf51822,

The UART program in nRF Toolbox app is not work.

The error message is Error 6:The connection has timed out unexpectedly

Why this error is occur?

When i change the Tx, Rx pin physically(jumpper line) on the MCU,

ble_app_uart_s130_pca10028( not change tx, rx) work very well.

Parents
  • I have come across the same problem but with my custom board where my tx-rx pin are different.

    When I configure UART example from sdk peripheral with my custom board tx-rx pin value.

    It goes into error and my program does not run.

    Can I use virtual comp port example with different tx-rx pin.?

    Or I have to config uart0-uart1 ..??

Reply
  • I have come across the same problem but with my custom board where my tx-rx pin are different.

    When I configure UART example from sdk peripheral with my custom board tx-rx pin value.

    It goes into error and my program does not run.

    Can I use virtual comp port example with different tx-rx pin.?

    Or I have to config uart0-uart1 ..??

Children
  • Yes, you can use any pins with UART. You just have to configure the library/driver you use with the correct pin configuration. Please create a new question if you need more follow-up on this, and then also include which chip and SDK version you are using, as well as which library/driver and how you have configured it.

Related