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.

cc2538 ADC problem

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

  • To get a ADC reading result that doesn't saturate the input signal has to be smaller than the reference voltage to the ADC. In this case you have selected the reference to be the internal reference which is around 1.15 V. Hence your results are as expected.

    AVDD5 is pin 33.

  • Ok,

    Thank you for the Quick responce.

    The problem is solved by using the ref volt on AIN7 pin. 

    Anyway my application is battrey monitoring. I need to measure 3.3 v. So internal ref will not help me.

    Can i set a particular internal ref voltage, may case 3.3 v. Its not mentioned in the internal ref volt is 1.15v in datasheet. 

    Some enquiries to,

    Are the differential inputs using reference voltage for calculation.

    I think ADC give difference between Vref+ and Vref-. Or are these values again compared with reference voltage.

     

  • For a battery monitor it's normal to divide the battery voltageto lower than 1.1 V with a resistive divider and use the internal reference.