I thought I'd write about my recent struggles with measuring coin cell batteries with my CC2540. Through this struggle I've also discovered a few items that may be useful to some people in similar situations.
1) The current battservice.c uses 2.0V as its 0% point, however this is unrealistic as a coin cell battery's internal resistance (IR) will cause much larger drops on a Connection Event or Advertising Event, than it would an MCU wake-up and measure. The hardware will POR reset longer before it should reach 0%. Therefore I've found that the Battery 0% threshold should be closer to 2.26V, to account for a Coin Cell's IR around 30Ohms (its near dead point)
2) The internal chemistry of a coin cell battery seems to react extremely slowly. I've taken every precaution to reduce current consumption as much as possible. Slow connection Parameters, disable MCU during RF, ClkDivOnHaltCmd, DC-DC, and assured that PM2 is entered. It seems a consequence of this is that if I put a used battery in my keyfob (say 70%), the Coin Cell battery reading takes forever to read/reach at 70%. It generally takes 2 days before the levels settles back at 70%. Meanwhile from a user point of view the battery level seems to be dropping rapidly. Falsely indicated that there is high power consumption. I haven't found a work around for this.
3) Currently I disable the DC-DC and wait 10msec before measuring. Is there a recommended amount of settle time?
Thanks for the help guys.