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.

LAUNCHXL-CC1350: CCS: Changing the ADC reference voltage (Vref) to 1.6V

Part Number: LAUNCHXL-CC1350
Other Parts Discussed in Thread: CC1350
Hi
As the datasheet mentions, the ADC in CC1350 supports two internal references: 1. Fixed (4.3V) and 2. Relative to VDDS.
Currently I use  the fixed 4.3V as Vref. But I want a lower Vref (=1.6V) for my application. As per the datasheet, it is possible to trim the output of fixed voltage reference, (I have attached the specific part of the datasheet which mentions it figure 1), by altering the values in the ADCREF1 register. I tried doing this by following the steps as follows:
Figure 1
  1. First I changed the contents of ADCREF1.VTRIM register field in hw_adi_4_aux.h, shown in figure 2. Default value of this register field is 0x0000003F.

                                      Figure 2
  2. The definition of trim was then included in aux_adc.h as shown in code below.

    // Defines for ADC reference sources.
    //
    //*****************************************************************************
    #define AUXADC_REF_FIXED (0 << ADI_4_AUX_ADCREF0_SRC_S)
    #define AUXADC_REF_VDDS_REL (1 << ADI_4_AUX_ADCREF0_SRC_S)

    //*****************************************************************************
    //
    // Defines for Trim output voltage of ADC fixed reference.
    //
    //*****************************************************************************

    #define AUXADC_REF_MAX_TRIM_VOLTAGE_1P6 (32 << ADI_4_AUX_ADCREF1_VTRIM_S)

  3. The parameters in CC1320_LAUNCHXL.c were then modified as shown below

#include <ti/drivers/ADC.h>
#include <ti/drivers/adc/ADCCC26XX.h>

ADCCC26XX_Object adcCC26xxObjects[CC1350_LAUNCHXL_ADCCOUNT];

const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADCCOUNT] = {
{
.adcDIO = CC1350_LAUNCHXL_DIO23_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO7,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.refTrimVal = ADCCC26XX_MAX_REFERENCE_TRIM,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},

After following the above mentioned steps Vref was not set to 1.6V. Is there anything that I am missing?
Also, on looking the factory configuration register library hw_fcfg1.h , I found that the ADCREF1.VTRIM register field gets its default value of 0x0000003F from one of the factory configuration register as shown below.
// Field: [5:0] SOC_ADC_REF_VOLTAGE_TRIM_TEMP1
//
// Internal. Only to be used through TI provided API.
#define FCFG1_SOC_ADC_REF_TRIM_AND_OFFSET_EXT_SOC_ADC_REF_VOLTAGE_TRIM_TEMP1_W \
6
#define FCFG1_SOC_ADC_REF_TRIM_AND_OFFSET_EXT_SOC_ADC_REF_VOLTAGE_TRIM_TEMP1_M \
0x0000003F
#define FCFG1_SOC_ADC_REF_TRIM_AND_OFFSET_EXT_SOC_ADC_REF_VOLTAGE_TRIM_TEMP1_S \
0

My doubt is that if the VTRIM values are written in the registers at the time of production  (I am saying this as the values written in hw_fcfg1.h file cannot be changed and are factory programmed), does that mean that we cannot change ADCREF1.VTRIM value?

I am highly confused and stuck for almost two months now. Kindly provide help. Is there something that I have not understood correctly. Being a newbie this can certainly be the case. Please help.

Thanks

Richa