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.

Parents
  • 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.

Reply
  • 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.

Children
No Data
Related