Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Send data using GPIO UART from mobile phone

Hi,

I want to build an application for nRF52840 DK that receives data through BLE from mobile phone (via nRF connect android application) and sends it to another microcontroller/device through GPIO using UART. Can you guide me on where do I start?

Thank you,

Shyam Joshi

Parents
  • Hi,

    We already have an example in the SDK that does this, it's called ble_app_uart. You can find the documentation for the example here.

    regards

    Jared

  • Hello Jared,

    Please correct me if I'm wrong. I have not gone through the code thoroughly, but based on cursory readings, ble_app_uart emulates a serial port and data is send over through that serial port (i.e. using USB). I want to send data to another micro-controller by using jumper wires connected to GPIO pins. How can I do that?

  • Hi,

    Yes, the nRF sends the data over UART to the interface chip that is on the DK, which again sends it over USB to whatever that is connected to the USB peripheral on the Development kit. 

     

    shyam9092 said:
    I want to send data to another micro-controller by using jumper wires connected to GPIO pins. How can I do that?

    Just change the pins that are used by the UART module. The pins are set during the initialization of the UART module, by default they use the pins P0.08 and P0.07 that are connected to the interface chip:

    static void uart_init(void)
    {
        uint32_t                     err_code;
        app_uart_comm_params_t const comm_params =
        {
            .rx_pin_no    = RX_PIN_NUMBER,
            .tx_pin_no    = TX_PIN_NUMBER,
            .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)
            .baud_rate    = NRF_UART_BAUDRATE_115200
    #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);
    }

    regards

    Jared

  • Hello Jared,

    How many mobile devices using nRF connect can be concurrently connected to a single nRF52840 DK loaded with ble_app_uart example? 

Reply Children
Related