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

nRF52840 Dongle Pin Issue

I am experiencing an issue with the nRF52840 dongle and programming UART pins. First off, I have developed my application on the nRF52 DK and it works fine and now I am programming the application on the dongle and it also works fine for the most part. 

I am following the ble_app_uart example but I am using the UART pins to send and receive NMEA messages to/from a GPS module so I can transmit the NMEA messages over bluetooth. Specifically, I am using the Adafruit Ultimate GPS v3 (https://www.adafruit.com/product/746). 

The GPS module and dongle are both being powered off of a 5V rail. I have programmed P0.22 as the Rx pin and P0.24 as the Tx pin and defined the RTS and CTS as UART_PIN_DISCONNECTED. These seem like fine pins to use per OPS as they are not low frequency specific I/O pins but maybe this is where my logic is flawed.

The issue I am running into is that when I cut power to the GPS module by either physically removing the 5V rail connect to the module or use a GPIO pin to drive a switch that turns off the rail to the GPS module, the dongle application stops working. I know it stops working because the application still uses the dongles LED to show connection status. The LED turns off completely and I lose bluetooth connection with the dongle. I still see 5V on the line with 0A current draw. If I remove the dongles assigned Rx pin (the GPS modules Tx pin), the application starts running again. As soon as I plug in the pin again, the application stops. 

I've also noticed some similar peculiar behavior in general with UART pins on the dongle. 

Let's say I am programming the dongle with the ble_app_uart example through a USB and the dongle is just sitting flat on my work bench. Typically, after I flash the app hex and softdevice hex using nRF Connect v3.2.0, nothing happens on the dongle side. What's supposed to happen is the LED blinks while advertising and goes solid when a connection has been made. This is the behavior of the dongle while it is just sitting on an ESD mat on my work bench while plugged into my laptop through a USB cable.

The moment I lift the dongle up off the workbench while it is still connected through USB, the LED starts blinking and the app runs normally.

If I move my finger close (~1cm) to but not touching the RX and TX pins, the dongle stops working in the same way as if it were sitting on the bench top. When I move my finger away from the pins, the application starts up again.

Do I have a capacitance issue on the Rx line? Is the Tx line coupling with the Rx line? Do I need some low termination resistance on the Rx and/or Tx lines?

Any insight would be greatly appreciated! 

Not sure if this will be helpful, but this is the UART init function I am using in the application.

#define UART_RX_PIN NRF_GPIO_PIN_MAP(0,22)
#define UART_TX_PIN NRF_GPIO_PIN_MAP(0,24)

#define RTS_PIN_NUMBER UART_PIN_DISCONNECTED
#define CTS_PIN_NUMBER UART_PIN_DISCONNECTED

static void uart_init(void)
{
    uint32_t err_code;
    app_uart_comm_params_t const comm_params =
    {
    .rx_pin_no = UART_RX_PIN,
    .tx_pin_no = UART_TX_PIN,
    .rts_pin_no = RTS_PIN_NUMBER,
    .cts_pin_no = CTS_PIN_NUMBER,
    .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
    .use_parity = false,
#if defined (UART_PRESENT)    // UART_PRESENT is defined
    .baud_rate = NRF_UART_BAUDRATE_9600
#else
    .baud_rate = NRF_UARTE_BAUDRATE_115200
#endif
    };

    APP_UART_FIFO_INIT(&comm_params,
    UART_RX_BUF_SIZE,
    UART_TX_BUF_SIZE,
    uart_event_handle,
    APP_IRQ_PRIORITY_LOWEST,
    err_code);
    APP_ERROR_CHECK(err_code);

}

Related