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

Can't bring current consumption below 2mA

I'm using nRF51DK and created 2 app_timers (based on LFCLK) that are running on 32.768kHz crystal, one for kernel timing (10ms) and one for real time clock (every second). My code is based on uart example of SDK12 and I use S130 softdevice. I have a switch that, if ON unit advertises and operates, and if OFF it should go to the lowest power mode maintaining the real time clock counting. In this case the unit runs on a battery.

When the switch goes OFF I am executing the following code:

...
  if (f_bt_connected)
    bsp_event_handler(BSP_EVENT_DISCONNECT);
  advertising_stop();
  app_timer_stop(kernel_clock_id);
  nrf_gpio_cfg_default(LED);
  nrf_gpio_cfg_default(SDA);
  nrf_gpio_cfg_default(SCL);
  nrf_gpio_cfg_default(P_ON);
...

This code should put the lines LED, SDA, SCL and P_ON in the lowest consumption mode and only the SWITCH port is kept as input.

The mainloop calls WLE instruction to stop the controller but the 16MHz crystal runs all the time! How do I stop it? How can I prevent the unnecessary code to run? I would like to have only the real time clock running while the SWITCH is OFF.

Where can I find an example?

Related