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

Increase current consumption with app_button

Hi All,

I am using SDK17 for my application currently. To sense ping change I am using app_button function as below. Normally my port pin remains high and current consumption of board is 6 uA with no advertisement. But when my port pin goes low, current increase to 15 uA. This behavior was not in SDK15.3. Current was normal in SDK15.3 in high or low pin cases. Can anybody help here?

void buttons_init(void)
{

static app_button_cfg_t buttons[] =
{
{DOOR1_SWITCH, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_NOPULL,button_event_handler},
};

app_button_init(buttons, sizeof(buttons) / sizeof(buttons[0]), BUTTON_DETECTION_DELAY);
}

Regards,

Bipin Patel

Parents
  • Hi. Is the current high only when you hold the button down, or does it stay at 15 uA after the button is pressed? Any external pullups?

  • Hi Stian,

    Current is high only when I hold pin down. On release, it restore back to 6uA current. There is no external pull up. Basically port pin is connected to output of magnet switch which pull down pin on magnet sense. 

    As I told, there is no issue with SDK15.3 but facing in SDK17.

    Regards,

    Bipin Patel

  • Hi Stian,

    Any further suggestion?

    Regards,

    Bipin Patel

  • Hi, I looked through the app_button library in SDK 17 and the extra current consumption is because of how the button library is designed. Whenever the button is pressed there is a timer running which is polling the status of the button, until it is released again. The polling frequency is decided by the BUTTON_DETECTION_DELAY define. So by using a higher delay, the current consumption will go down.

    Alternatively you can try to just copy the app_button.h and app_button.c files from SDK 15.3. to SDK 17. I tried it here with the ble_app_blinky example and it compiles just fine, and the current consumption is low even when the button is pressed

  • Hi Stian,

    1) I have copied app_button.h and app_button.c files from SDK 15.3. to SDK 17 and it works well, I mean no extra current on button pressed.

    2) I have also tried to increase BUTTON_DETECTION_DELAY and with that also current reduced on button pressed. Here I have some couple of questions.

    1. Should we consider this as a bug as in many application GPIO normally remain low and on some events it become high. so what should we do in this cases with SDK17 app_button library?
    2. Is it fine if I use app_button library of SDK15.3 into SDK17 based application? Is any chance of issue in any way in future?

    Regards,

    Bipin Patel

  • Hi,

    I have assigned the ticket to me as Stian is currently out of the office.

    karanbakshi said:
    Should we consider this as a bug as in many application GPIO normally remain low and on some events it become high. so what should we do in this cases with SDK17 app_button library?

     The button library is mainly designed with push buttons in mind. And the changes in SDK 17 were made to reduce the chance of missed events when having multiple buttons triggered around the same time.

    karanbakshi said:
    Is it fine if I use app_button library of SDK15.3 into SDK17 based application? Is any chance of issue in any way in future?

     It shouldn't be any problem to use the old library with SDK 17.

    Best regards,

    Vidar

  • Hi Vidar.

    Thanks for comment.

    In my application, I have nearly 3 GPIO sensing which remains push low normally. As you said,  there is a improvement in SDK17 for multiple buttons triggered around the same time so what library should I use? SDK17 or SDK15.3 based? If I will use SDK17 based library then my board current will increase and if I use SDK15.3 then may I face issue in multiple button triggering?

    Regards,

    Bipin Patel

Reply
  • Hi Vidar.

    Thanks for comment.

    In my application, I have nearly 3 GPIO sensing which remains push low normally. As you said,  there is a improvement in SDK17 for multiple buttons triggered around the same time so what library should I use? SDK17 or SDK15.3 based? If I will use SDK17 based library then my board current will increase and if I use SDK15.3 then may I face issue in multiple button triggering?

    Regards,

    Bipin Patel

Children
Related