Part Number: CC2530
Tool/software: WEBENCH® Design Tools
I used CC2530's ADC as a battery monitor by selecting VDD/3 as input and Internal Reference 1.15V. and ADC resolution is 12 bits.......but while I running the code on zigbee it always gives 0x07FF as the result.....doesn't know how to resolve it....
here is my code....
I also declare HAL_ADC= TRUE in pre-processor....
static uint16 get_BATVOLT()
{
int32 ADC_Count=0;
ATEST=0x00; //disable on-chip temprature sensor
TR0=0x00;
HalAdcSetReference(HAL_ADC_REF_125V); //SET adc reference
ADC_Count=HalAdcRead(HAL_ADC_CHN_VDD3 , HAL_ADC_RESOLUTION_12 );
return ADC_Count;
}