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.

Compiler/CC2541: ADC Read and Battery Percentage

Part Number: CC2541
Other Parts Discussed in Thread: BLE-STACK

Tool/software: TI C/C++ Compiler

Hi  

uint16 adc=0;


P0SEL = 0x00;


P0DIR = 0x00;


P0INP = 0xFF;

APCFG = 0xC0;


adc = HalAdcRead(HAL_ADC_CHN_VDD3, HAL_ADC_RESOLUTION_12); //P0.7


printf("adc: %d\n", adc);

I'm getting output as 

adc :4

adc : 3

adc :2

adc:1