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

Frequency trasmission and current

Hi,

during the test of the trasmission, in my phone I have seen the figure below:

As you can see the trasmission is every 2 seconds and I want to change this time trasmission. I am using the code situated in the folder "\nRF5_SDK_12.3.0_d7731ad\examples\ble_peripheral\ble_app_uart_adc_scan_mode". I have modify the ADC_SAMPLE_RATE but only with the 1000 and 2000 values seems it works. What parameter do I need to change to increase or decrease the frequency trasmission (i.e. every 4 seconds, 8 seconds, 10 seconds, and so on)?

In the following picture there is the current consumption during the trasmission (is about 0.6mA)

Is it possible to reduce the current consumption? What kind of parameter in the code can I change?

Thanks a lot and best regards

Angelo

Parents Reply Children
  •  There's probably some defines in sdk_config.h concerning the default preferred connection parameters.

  • Thanks, but I have not found nothing. What is the parameter do I need to change to decrease the frequency of data trasmission (red line in the first image of this post)?

  • I modified the conn_params_init() in SDK12.3\examples\ble_peripheral\ble_app_uart, on line 226 of main.c:

    /**@brief Function for initializing the Connection Parameters module.
     */
    static void conn_params_init(void)
    {
        uint32_t                err_code;
        ble_conn_params_init_t  cp_init;
        ble_gap_conn_params_t   conn_params;
    
        memset(&conn_params, 0, sizeof(conn_params));
    
        conn_params.conn_sup_timeout    =  BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX; /**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/
        conn_params.min_conn_interval   =  80; /*100ms                      /**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
        conn_params.max_conn_interval   =  160 /*200ms                      /**< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
        conn_params.slave_latency       =  BLE_GAP_CP_SLAVE_LATENCY_MAX     /**< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS.*/
    
        memset(&cp_init, 0, sizeof(cp_init)); 
    
        cp_init.p_conn_params                  = &conn_params;
        cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
        cp_init.next_conn_params_update_delay  = NEXT_CONN_PARAMS_UPDATE_DELAY;
        cp_init.max_conn_params_update_count   = MAX_CONN_PARAMS_UPDATE_COUNT;
        cp_init.start_on_notify_cccd_handle    = BLE_GATT_HANDLE_INVALID;
        cp_init.disconnect_on_fail             = false;
        cp_init.evt_handler                    = on_conn_params_evt;
        cp_init.error_handler                  = conn_params_error_handler;
    
        err_code = ble_conn_params_init(&cp_init);
        APP_ERROR_CHECK(err_code);
    }

    I added a ble_gap_conn_params_t struct and passed it to the ble_conn_params_init_t struct. 

    You can modify the minimum and maximum Connection Intervals in order to get the Connection Intervals you want. Note that any Central has the final say in what the actual Connection Parameters the link will use, it can choose to ignore your request. 

  • Thanks a lot for the answer but nothing change :-( An other question is: How can I reduce the cirrent consumption?

    Thanks a lot and best regards

  • Angelo Cotroneo said:
    An other question is: How can I reduce the cirrent consumption?

    With regards to what? 

    What current consumption do you expect to have?

    Have you tried the online power profiler? https://devzone.nordicsemi.com/nordic/power/w/opp

Related