Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
131
Ver.1.0.0
5. Low Battery Detect
Telink BLE SDK and related documents may refer to this subject with different names
such as “battery power detect/check”, “battery power detect/check”, “low battery
detect/check
”, “low power detect/check”, “battery detect/check”. In SDK code, there are
file and function names such as “battery_check”, “battery_detect”,
“battery_power_check”. In this document, we use “low battery detect”.
5.1 Significance of Low Battery Detect
Since battery voltage would gradually drop with time, for battery-powered products,
problems would occur once battery voltage drops below a certain level.
1) For TLSR8232, operation voltage range is 1.9V~3.6V. Below 1.8V, normal operation
is not guaranteed.
2) At low battery voltage, unstable voltage may result in error for F
lash “write” or
“erase” operation, so that unexpected disruption of program FW or user data would
lead to product function failure. Based on our MP experience, the threshold is set at
2.0V.
It is necessary to declare a “secure voltage”. Once battery drops below this voltage level,
MCU should shutdown to stop working, or enter deepsleep as implemented in the SDK.
Before MCU shutdown, certain UI behavior, e.g. quick LED blinking in the
“5316_ble_remote”), can be used as low battery alarm, so as to remind user that it’s
time to recharge or replace the low battery.
“Secure voltage”, or “alarm voltage”, is set at 2.0V in current SDK. For certain extreme
condition of power instability caused by HW design, secure voltage can be set at higher
value, e.g. 2.1 or 2.2V.
For battery-powered products supported by Telink BLE SDK, Low Battery Detect must be
implemented to ensure product stability across its lifetime.
5.2 Implementation of Low Battery Detect
For Low Battery Detect, ADC should be used to measure supply volt
age. It’s
recommended to read TLSR8232 datasheet or ADC driver related document and get
familiar with ADC module.
In the SDK, Low Battery Detect is implemented in the “battery_check.h” and
“battery_check.c”.
Please ensure the macro “BATT_CHECK_ENABLE” is enabled in the "app_config.h”. DO
NOT change the macro since it’s enabled by default.
#define
BATT_CHECK_ENABLE
1
//must enable
5.2.1 Cautions of Low Battery Detect
Low Battery Detect is a basic ADC task to sample and measure supply voltage. Please
pay attention to the following items.