TI中文支持网
TI专业的中文技术问题咨询交流网站

#CC2640r2f 锂电池供电电量检测

你好,我使用锂电池经过稳压供电,想用cc2640r2f 的adc测电量,目前锂电池的电压3.89v ,使用两个1m的电阻分压,但是,分压完完毕后,万用表测量为1.89v,cc2640r2f Io28测到电压1.7v左右;我应该怎么提高精度?

yekun kun:

回复 Kevin Qiu1:

你好这是代码:

/* Analog Capable DIOs */
#define CC2640R2_LAUNCHXL_DIO23_ANALOGPIN_UNASSIGNED//IOID_23
#define CC2640R2_LAUNCHXL_DIO24_ANALOGPIN_UNASSIGNED//IOID_24
#define CC2640R2_LAUNCHXL_DIO25_ANALOGPIN_UNASSIGNED//IOID_25
#define CC2640R2_LAUNCHXL_DIO26_ANALOGPIN_UNASSIGNED//IOID_26
#define CC2640R2_LAUNCHXL_DIO27_ANALOGPIN_UNASSIGNED//IOID_27
#define CC2640R2_LAUNCHXL_DIO28_ANALOGIOID_28
#define CC2640R2_LAUNCHXL_DIO29_ANALOGPIN_UNASSIGNED//IOID_29
#define CC2640R2_LAUNCHXL_DIO30_ANALOGPIN_UNASSIGNED//IOID_30
{.adcDIO= CC2640R2_LAUNCHXL_DIO28_ANALOG,.adcCompBInput= ADC_COMPB_IN_AUXIO2,.refSource= ADCCC26XX_FIXED_REFERENCE,.samplingDuration= ADCCC26XX_SAMPLING_DURATION_2P7_US,.inputScalingEnabled = true,.triggerSource= ADCCC26XX_TRIGGER_MANUAL,.returnAdjustedVal= false},

// Define name for ADC channel index
#define THERMOCOUPLE_OUT5uint32_t resultUv;void adc_convert(void){static uint16_t result;// initialize optional ADC parametersADC_Params params;ADC_Params_init(&params);params.isProtected = true;// Open ADC channels for usageADC_Handle adcHandle = ADC_open(THERMOCOUPLE_OUT, &params);// Sample the analog output from the ThermocoupleADC_convert(adcHandle, &result);Battery_level=(int8_t)(((2*4.3/4096*result)-3.3)/1.2)*100;ADC_close(adcHandle);}
你好示波器怎么量,直接量电压吗

YiKai Chen:

ADC_convert讀取完成建議用ADC_convertRawToMicroVolts去轉成Micro Volt

Kevin Qiu1:

回复 yekun kun:

是的,用示波器先测下电压,看准不准

yekun kun:

回复 YiKai Chen:

转化后和我自己转化算出来差不多,1.72v,

我用示波器亮出来只有1.3v,估计阻抗问题

电路如下图,

user4745244:

回复 yekun kun:

是阻抗问题我遇到过这种问题把两个电阻改成50K 完美解决!不过这样功耗就大了.大电阻加一个跟随器试试

赞(0)
未经允许不得转载:TI中文支持网 » #CC2640r2f 锂电池供电电量检测
分享到: 更多 (0)