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

I want to send data from nrf51822 through UART TX to esp8266.

Hello, 

I am trying to send data from nrf51822 through UART TX to esp8266. I've gone through the app_uart examples and I can recieve data through RX but having difficulty sending data through TX.

Parents Reply Children
  • This is my code so far. 
    I changed the TX pin from 9 to 26. Since not working on 9, but still not receiving any values on esp8266 arduino serial port 

    // NRF_LOG_BACKEND_SERIAL_UART_TX_PIN 26 
    // NRF_LOG_BACKEND_SERIAL_UART_RX_PIN 11
    
    
    // Sending data through TX
    static void uart_loopback_test()
    {
     
    uint32_t err_code;
        // Start sending one byte and see if you get the same
        for (uint32_t i = 0; i < length; i++)
        { 
    			 while (app_uart_put(data[i]) != NRF_SUCCESS);
        }
    		 nrf_delay_ms(10); 
    
        return;
    }
    
    
    // UART init
    static void uart_init(void)
    {
        uint32_t                     err_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_Baud9600
        };
    
        APP_UART_FIFO_INIT( &comm_params,
                           UART_RX_BUF_SIZE,
                           UART_TX_BUF_SIZE,
                           uart_event_handle,
                         //  APP_IRQ_PRIORITY_LOWEST,
    						APP_IRQ_PRIORITY_HIGHEST,
                           err_code);
        APP_ERROR_CHECK(err_code);
    }

Related