目前想要采集1310的使用的电量问题,请问下cc1310的adc怎么采集?用IAR编辑吗? 有没有具体的参考设置?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你好! TY:
恩 ,adc的采集我会根据你给的试下。我想再问下cc1310有没有类似cc2640的获取剩余电量的接口,cc2640调用的是Batt_MeasLeve()直接获取电量,我想cc1310应该也可以直接获取电量!
你好!TY:
我会根据你给网站试下adc的功能。我想再问下cc1310有没有类似cc2640的直接调用Batt_MeasLevel()获取电量的,我想cc1310应该也可以吧,不知道有没有相关的接口可以直接用?谢谢了!
直接用cc2640的就好了。程序里面
#include <driverlib/aon_batmon.h>
static uint8_t battMeasure(void)
{
uint32_t percent;
// Read the battery voltage (V), only the first 12 bits
percent = AONBatMonBatteryVoltageGet();
// Convert to from V to mV to avoid fractions.
// Fractional part is in the lower 8 bits thus converting is done as follows:
// (1/256)/(1/1000) = 1000/256 = 125/32
// This is done most effectively by multiplying by 125 and then shifting
// 5 bits to the right.
percent = (percent * 125) >> 5;
// Convert to percentage of maximum voltage.
percent = ((percent* 100) / 3273);
return percent;
}