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

System power off for beaconing application

Hello,

Currently my beaconing application draws approximately 10uA @ 1000ms advertising interval. I am having trouble getting the chip into system power off mode so the chip only draws around 1uA of current. I have defined CONFIG_GPIO_AS_PINRESET and P0.21 is configured as RESET in system_nrf52.c (I am using PCA10040).

I have a few questions I was hoping could get answered.

  1. How do you implement sd_power_system_off() so when I press the IF BOOT/RESET button, the chip goes into power off mode?
  2. How do you check if the IF BOOT/RESET button is pressed?
    1. Do I check the status of P0.21 using nrf_gpio_pin_read()? And make sure the value is equal to 1?
  3. How can I use the same button so once I release it the system wakes up again?

Thank you for your help.

  • Hi,

    1. Since you are using P0.21 for reset pin, this cannot simultaneously be a GPIO pin. The only thing the pin is usable for with this configuration is to do pin reset, which also wakes the device from system OFF low power mode. So, you must use another approach to enter system off mode.

    2. You cannot. When the reset button is pressed (pin asserted), the system is in an undefined state. And when the button is released, the system is reset and boots.

    3. You cannot use the reset pin for this. However, there is another approach that lets you use a single button, and that is to use a normal GPIO (could still be P0.21 if you don't configure it as a reset pin). Then you configure the pin to generate an interrupt (see Pin Change Interrupt Example), and when you get an interrupt on the pin, you call some code that enters system OFF mode. This function should also configure a button to be used as a wakeup source, and in your case, this button should be the same button as you used to generate the interrupt in the first place. You can refer to for instance the sleep_mode_enter() function in <SDK15.3>\examples\ble_peripheral\ble_app_gls\main.c.

  • Hi,

    Thank you for your answer.

    So if I press the reset button, will the system automatically enter a power off state? When I test this with the PPK, pressing the reset pin has no effect on current consumption. The reason I am asking is because using a GPIO input will increase the current consumption, and ideally I want this to be as low as possible (around 10uA). I tested that by using GPIO, the system regularly consumes around 23 uA of current.

    Thank you

  • Hi,

    AQS said:
    So if I press the reset button, will the system automatically enter a power off state?

    No. Pressing the reset button (if enabled in the UICR) will trigger a power-on-reset, so your application will run.

    AQS said:
    When I test this with the PPK, pressing the reset pin has no effect on current consumption

    That could make sense. If your application is doing whatever it normally does, and you press reset so that it starts doing the same thing again, you should expect to see the same current consumption.

    AQS said:
    The reason I am asking is because using a GPIO input will increase the current consumption, and ideally I want this to be as low as possible (around 10uA). I tested that by using GPIO, the system regularly consumes around 23 uA of current.

     You are probably seeing erratum 97. The workaround is to use port event instead, which should be just as good in this use case.

Related