This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

POFCON and s132

We successfully used the pofcon on a 51822 based design using S110 ver 7 to indicate a low batter condition to the user. However, we are moving to 52832 (currently QFAA-BA0) running s132 from 11.0.0.2 and the power failure function does not seem to work. All other aspects of our code are working fine with the exception of power failure.

In our code the pofcon is both turned on and the threshold set and we have registered for system events.

I have even resorted to using sd_evt_get in the main do loop to see if the NRF_EVT_POWER_FAILURE_WARNING event is ever received. Only NRF_ERROR_NOT_FOUND is ever returned for a variety of input voltages.

Is there some subtle difference between s110 and s132 in using the pofcon that we are missing? Or, is there something we missed in the errata that this function does not work yet?

  • We figured this out in the debugger. There is something wrong with the enumerations in the 11.0.0.2 sdk. Using sd_power_pof_threshold_set(NRF_POWER_THRESHOLD_V23) will result in a value of 3 in the threshold register which is undefined. What works is to just set POFCON directly. Use: NRF_POWER->POFCON = 0X15; This will turn on pof and set threshold to 2.3 volts in one line. You can figure out from the reference manual how to set other thresholds. Someone should double check the enumerations in the nRF52 reference manual and the sample code.

  • This is probably just ported from the nRF51. I will report this internally. Generally you should not use the NRF_POWER register directly as it is restricted by the SoftDevice, see here.

  • Many thanks for the quick response. I will make it a point to look at fixing the enumerations before writing to the register directly.

  • Hi, i have the same problem. If i use sd_power_pof_threshold_set(NRF_POWER_THRESHOLD_V27) the register NRF_POWER->POFCON is set equal to 7, and so it don't wotk correctly. If i try to set register directly have a reset from softdevice.

    How do you have solve the problem?

  • This was fixed in S132 2.0.1. Though I haven't tried out the fixed version since we moved away from using the POF. However, if you haven't migrated to the latest SD and are still using 2.0 APIs, then 2.0.1 should solve your problem.

Related