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?

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

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

Children
No Data
Related