电池电量检测

自带的电池电量检测的profile用哪个AD口(IO口)采样的?

BATT, /*!< Battery detector channel */这个BATT是哪个通道?

A battery monitor is integrated by connecting supply voltage (VDD/4) to the ADC input,which would use the internal regulated reference for the conversion

FireBLE_blue 发表于 2015-5-19 14:26
A battery monitor is integrated by connecting supply voltage (VDD/4) to the ADC input,which would us …

我填加了电量的profile,发现运行时bass_create_db_req_handler这个函数没有进去,自己添加的profile就不成功了,不知道为什么此函数没运行?

你上面提供的信息,我还不能够根据你提供的信息判断为什么不能调用bass_create_db_req_handler这个函数,建议把问题描述得详细一点,有步骤地描述你是怎么添加profile,在什么基础上改的,都改动了那些代码,改动后你觉得那里的运行结果与你想象的不符,我们大家才能根据你提供的详细信息给你提示。

thong 发表于 2015-5-19 12:01
BATT, /*!< Battery detector channel */这个BATT是哪个通道?

电池检测采用的是专用内部通道,对外部不公开的,所以外部的AD口都还是可以继续采样 的。

FireBLE_blue 发表于 2015-5-21 11:20
你上面提供的信息,我还不能够根据你提供的信息判断为什么不能调用bass_create_db_req_handler这个函数,建 …

已经找到问题了,任务冲突了

请问量测电池电量之后
是不是要关闭通道

我发现进SLEEP_NORMAL
会有17uA的耗电
但不执行底下的程式
进SLEEP_NORMAL
只有3.6uA
是要修改哪边?

battery_monitor_enable(MASK_ENABLE);
int16_t battv;
adc_init(ADC_SINGLE_WITH_BUF_DRV, ADC_CLK_15625, ADC_INT_REF, ADC_12BIT);

adc_done = 0;

adc_read_configuration read_cfg;
read_cfg.trig_src = ADC_TRIG_SOFT;
//read_cfg.mode = BURST_MOD;
read_cfg.mode =  CONTINUE_MOD;

read_cfg.start_ch = BATT;
read_cfg.end_ch = BATT;
adc_read(&read_cfg, &battv, 1, adc_test_cb);
while (adc_done == 0);

int jj = 4 * ADC_RESULT_mV(battv);
Now_Battery_State = jj / 100;

battery_monitor_enable(MASK_DISABLE);

找到了
adc_clock_off();
adc_power_off();
加上去就好了

ffl86 发表于 2015-7-22 10:05
找到了
adc_clock_off();
adc_power_off();

是的,测量后要把相应的adc模块关闭,以降低功耗,你的提问后,又能把解决方法贴出以结贴,非常好的习惯,赞一个

请问
adc_clock_off();
adc_power_off();
之后,下一次检测ad时怎么开启

电池检测是通过一个计时器事件来启动的,在每一次进入该事件( {APP_BASS_BATT_LEVEL_TIMER, (ke_msg_func_t) app_bass_batt_level_timer_handler},
)之前调用就好了,具体可以参考例程prj_bass.

adc_clock_off();
adc_power_off(); 是不是把所有adc都关了,还是只关了电池检测的adc

diy2060 发表于 2016-5-19 18:56
adc_clock_off();
adc_power_off(); 是不是把所有adc都关了,还是只关了电池检测的adc

所有的ADC都关了

收到谢谢:handshake