Other Parts Discussed in Thread: CC1350
-
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 - 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)
- 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
},
//
// 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