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

Change VDDH POF threshold when softdevice is enabled

I would like to measure the VDDH voltage (lithium ion battery) on a nrf52840 with the power fail comparator. If the voltage drops below the threshold, I want to reduce the threshold until I know the voltage.

The SDK says that an NRF_ERROR_INVALID_STATE is returned when the POF is initialized (with nrf_drv_power_pof_init) when SD is enabled.

Is there a way to change the threshold while a softdevice is running? Is there anything else I can do?

Of course I could measure the voltage as described in this thread, but I would like to reduce the amount of components on my board.

Parents
  • When sd_power_pof_enable is enabled, the softdevice will notify the application with a NRF_EVT_POWER_FAILURE_WARNING event when the power failure occurs. The treshold can be adjusted with sd_power_pof_threshold_set. If you take a closer look at the POF documentation. You can see that When the supply voltage falls below the defined threshold, the power-fail comparator will generate an event (POFWARN) which can be used by an application to prepare for power failure. This event will also be generated if the supply voltage is already below the threshold at the time the power-fail comparator is enabled, or if the threshold is re-configured to a level above the supply voltage.

    There is only one event generating the POF warning, so the Softdevice should generate the event as described in the nRF52840 OPS.

Reply
  • When sd_power_pof_enable is enabled, the softdevice will notify the application with a NRF_EVT_POWER_FAILURE_WARNING event when the power failure occurs. The treshold can be adjusted with sd_power_pof_threshold_set. If you take a closer look at the POF documentation. You can see that When the supply voltage falls below the defined threshold, the power-fail comparator will generate an event (POFWARN) which can be used by an application to prepare for power failure. This event will also be generated if the supply voltage is already below the threshold at the time the power-fail comparator is enabled, or if the threshold is re-configured to a level above the supply voltage.

    There is only one event generating the POF warning, so the Softdevice should generate the event as described in the nRF52840 OPS.

Children
Related