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

nRF51 external interrupt with low power

Hi. I'm using PCA10028, SDK10.0.0, S130.

I'm testing External interrupt.

Current concumption was just 50uA around(low speed advertising mode).

But It goes 1mA around after i put "gpio_init()" as below. I'm sure i don't use DEBUG mode when i check current consumption.

static void gpio_init(void)
{

    ret_code_t err_code;

    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);

    err_code = nrf_drv_gpiote_out_init(BSP_LED_3, &out_config);
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);
    in_config.pull = NRF_GPIO_PIN_PULLUP;

    err_code = nrf_drv_gpiote_in_init(BUTTON_3, &in_config, in_pin_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_in_event_enable(BUTTON_3, true);
}

static void ble_peripheral_operation(bool erase_bonds)
{
    uint32_t err_code;
    ble_gap_addr_t   addr;
    ble_gap_addr_t * p_addr = &addr;

    gap_params_init();
	services_init();
    advertising_init();
	conn_params_init();

	err_code = sd_ble_gap_address_get(p_addr);
	
   err_code = ble_advertising_start(BLE_ADV_MODE_SLOW);
	APP_ERROR_CHECK(err_code);
}

 
int main(void)
{

    bool erase_bonds;

    // Initialize.
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, NULL);

gpio_init();		// External interrupt test

    ble_stack_init();

	ble_peripheral_operation(erase_bonds);

	for (;; )
	{
		power_manage();

	}
}

I want to get External interrupt while nRF51 is advertising. I need your help.

Parents
  • You are using

    GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);
    

    where the true statement means that the driver will use "high accuracy" which is the equivalent to GPIOTE IN event. GPIOTE IN event will request the HFCLK and 1V2 regulator as can be seen in Product Specification chapter 8.3 "Block resource requirements".

    If the statement is false the driver will use "low accuracy" or GPIOTE PORT event. This is low power and will keep the current consumption at the level you had before gpio_init(). The drawback with GPIOTE PORT event is that this is shared between all the pins that use this event. You can read more about the PORT event in the Reference Manual chapter 14 (GPIO) and 15 (GPIOTE).

  • Thanks a lot. It's very helpful.

Reply Children
No Data
Related