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

How to implement soft uart in Pca10028?

Hello,

I am using pca10028 and sdk 12. I want to use 2 uart for my application but as per datasheet nrf51 has only one hardware uart. Can I implement soft uart on pca10028? I want to use both the uart at the same time so multiplexing will not help me.

Sdk_config.h New Text Document (3).txt

Main.c New Text Document (3).txt

Thanks, Shailav

Parents
  • Hi Shailav,

    I am afraid that we do not have any examples showing how create a software-based("bit-banged") UART for the nRF51 Series. Have you considered using the nRF52840 that has two UARTs?

    Best regards

    Bjørn

  • Hi, I am able to print something on RTT_viewer by implementing your suggestions but I also want to print the mac address, Rssi and adv data of nearby ble devices as I am using ble_app_uart_c(central) code. I am not able to see above data in rtt_viewer. My code snippet is as follows

    const ble_gap_evt_adv_report_t * p_adv_report = &p_gap_evt->params.adv_report;
    {
             // scan is automatically stopped by the connect
             err_code = bsp_indication_set(BSP_INDICATE_IDLE);
                APP_ERROR_CHECK(err_code);
                 NRF_LOG_INFO("Mac address %02x%02x%02x%02x%02x%02x\r\n",
                   p_adv_report->peer_addr.addr[5],
                   p_adv_report->peer_addr.addr[4],
                   p_adv_report->peer_addr.addr[3],
                   p_adv_report->peer_addr.addr[2],
                   p_adv_report->peer_addr.addr[1],
                   p_adv_report->peer_addr.addr[0]
                );
    
    		NRF_LOG_INFO("Data: ");
    
    	        for(i=0;i<17;i++)
    		{
    		     NRF_LOG_INFO("%02x", p_adv->data[i]);
    		}
    									
    		NRF_LOG_INFO(" \r\nRSSI: %d\n", p_adv->rssi);							
    }
    
Reply
  • Hi, I am able to print something on RTT_viewer by implementing your suggestions but I also want to print the mac address, Rssi and adv data of nearby ble devices as I am using ble_app_uart_c(central) code. I am not able to see above data in rtt_viewer. My code snippet is as follows

    const ble_gap_evt_adv_report_t * p_adv_report = &p_gap_evt->params.adv_report;
    {
             // scan is automatically stopped by the connect
             err_code = bsp_indication_set(BSP_INDICATE_IDLE);
                APP_ERROR_CHECK(err_code);
                 NRF_LOG_INFO("Mac address %02x%02x%02x%02x%02x%02x\r\n",
                   p_adv_report->peer_addr.addr[5],
                   p_adv_report->peer_addr.addr[4],
                   p_adv_report->peer_addr.addr[3],
                   p_adv_report->peer_addr.addr[2],
                   p_adv_report->peer_addr.addr[1],
                   p_adv_report->peer_addr.addr[0]
                );
    
    		NRF_LOG_INFO("Data: ");
    
    	        for(i=0;i<17;i++)
    		{
    		     NRF_LOG_INFO("%02x", p_adv->data[i]);
    		}
    									
    		NRF_LOG_INFO(" \r\nRSSI: %d\n", p_adv->rssi);							
    }
    
Children
No Data
Related