Other Parts Discussed in Thread: CC2538
Hi everyone,
I am integrating battery monitoring section in my code. Here i am facing some issue in ADC conversion.
Power supply is 3.3v.
I am using SmartRf06 EV board with cc2538.
For adc, the channel i am using is PA2 and internal reference voltage.
The ref voltage pin(33rd pin ,36rd pin .39...) in smartrf06 is connected to vdd, which is 2.3v as i measured.
Also R_Bias pin(42th pin) is 1.3 v.
How to select the internal reference voltage to a particular value?
My problem is , the ADC is converting values from 0 to 1.15 only. Above this all conversions are same.
In datasheet it is specified VDD5, which pin is vdd5 of cc2538?
The readings are,
For 0.28v - 17292
0.64v - 25204
0.95v - 29996
1.11v - 30252
1.50v - 32764
~
2.00v - 32764
~
3.30v - 32764
My code is,
SOCADCSingleConfigure(SOCADC_12_BIT,SOCADC_REF_INTERNAL);
while(1)
{
uint8_t dummySwPressed = ReadSwitchPressed();
if(dummySwPressed & SW_RIGHT)
{
SOCADCSingleStart(SOCADC_AIN2);
while(!SOCADCEndOfCOnversionGet());
Adcval = SOCADCDataGet();
sprintf(AdcvlaBuff,"%d",Adcval);
WriteStrToUART(AdcvlaBuff);
}
}
Thanks in advance,
jose