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.

On cc2640 there is not any impact of using function AUXADCAdjustValueForGainAndOffset() on adc value?

Other Parts Discussed in Thread: CC2640

I have used AUXADCAdjustValueForGainAndOffset() using

AUXADCGetAdjustmentGain(AUXADC_REF_FIXED) and

AUXADCGetAdjustmentOffset(AUXADC_REF_FIXED).

But I dont find any change in the adc value before and after adjusting it against gain and offset. Is this the desire behaviour?

I have disabled the adc scaling.

BLE Stack used: version 2.1.0 with cc26xxware_2_21_01_15600 on CC2640 5x5 pg2.2

  • Edited, misread the question.

    Can you provide the return values for offset/gain on your device plus a code sample showing how you use the apis?

    Regards

    Svend

  • Hello Svend,

    I have used as:

                  adcOffset = AUXADCGetAdjustmentOffset( AUXADC_REF_FIXED);
                  adcGain = AUXADCGetAdjustmentGain( AUXADC_REF_FIXED);
             
                  singleSample = AUXADCAdjustValueForGainAndOffset(singleSample,adcGain,adcOffset);

    where singleSample is my current ADC sample.

    All are int32_t type.

    Edit:

    adcOffset = -1

    adcGain = 33097

    Actually the offset part is working. But sometimes it doesnt reflect any change. And I didnt get the significance of adcGain.



  • If the internal errors are small enough then any corrections will be rounded off. The gain part is shifted up by 15 bits before being stored in FCFG.

    Source code to see what is going on is found by adding aux_adc.c to your workspace (<cc26xxware_path>\driverlib\aux_adc.c)

    Regards,

    Svend