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

Why doesn't the SDK expose POFCON values for 2.0V, 1.9V, 1.8V or 1.7V?

I would like to use the POFCON register thresholds to create a crude battery level indicator. I noticed that the POFCON register definition in the nRF52832 Product Spec has threshold values for 1.7V, 1.8V, 1.9V, 2.0V, 2.1V, 2.2V ... 2.8V. Unfortunately, the SDK only exposes 2.1V, 2.3V, 2.5V and 2.7V.

Is there some reason why the SDK hides the other values? If my firmware programs the POFCON register directly, how can I avoid conflicts with the SDK's use of that register?

Jack

Parents
  • The problem is with the SoftDevice which only takes the values from nRF51 (2.1V, 2.3V, 2.5V and 2.7V), see here. I have reported this internally and we will work on it.

    I would however recommend to use the SAADC instead to measure battery voltage. See for example the ble_app_hrs example which uses the battery service (bas).

  • If you are running from a coin cell battery, the current draw from the radio and CPU will make the battery voltage drop. If you are using the Power-fail comparator the voltage you are "measuring" will be the voltage when the load is highest (typically radio and CPU on), not the actual battery voltage. If you are fine with this then you can use the comparator. The saadc is designed to be used to measure battery voltage, which is why I recommend it. There may also be other issues when using the comparator for battery measurements than the one I mentioned here, but I can't think of any at the moment.

Reply
  • If you are running from a coin cell battery, the current draw from the radio and CPU will make the battery voltage drop. If you are using the Power-fail comparator the voltage you are "measuring" will be the voltage when the load is highest (typically radio and CPU on), not the actual battery voltage. If you are fine with this then you can use the comparator. The saadc is designed to be used to measure battery voltage, which is why I recommend it. There may also be other issues when using the comparator for battery measurements than the one I mentioned here, but I can't think of any at the moment.

Children
No Data
Related