I have a CC2650 sensortag with Debugger DevPack v1.2 running latest contiki.
I basically followed the example from svendbt here: https://e2e.ti.com/support/wireless_connectivity/f/538/p/404426/1433112#1433112
Simplified, my code:
AONWUCAuxWakeupEvent(AONWUC_AUX_WAKEUP); while(!(AONWUCPowerStatusGet() & AONWUC_AUX_POWER_ON)) { } AUXWUCClockEnable(AUX_WUC_ADI_CLOCK | AUX_WUC_ANAIF_CLOCK); AUXADCSelectInput(ADC_COMPB_IN_AUXIO7); AUXADCEnableSync(AUXADC_REF_FIXED, AUXADC_SAMPLE_TIME_2P7_US, AUXADC_TRIGGER_MANUAL); AUXADCGenManualTrigger(); sample = AUXADCReadFifo(); AUXADCDisable(); adcOffset = AUXADCGetAdjustmentOffset(AUXADC_REF_FIXED); adcGainError = AUXADCGetAdjustmentGain(AUXADC_REF_FIXED); adcCorrectedValue = AUXADCAdjustValueForGainAndOffset(samples[j], adcGainError, adcOffset); adcMicroVoltValue = AUXADCValueToMicrovolts(AUXADC_FIXED_REF_VOLTAGE_NORMAL, adcCorrectedValue);
I have connected DP2 to a stable 2V source but I am getting quite fluctuating values, usually 10-15 mV in between each measurement, and occasionally some which are off by 100++mV. Taking 5 samples in each run and doing an average gave me over time a mininmum adcMicroVoltValue 1963398, and max 2037318. For fixed reference, I get adcOffset at -1, and adcGainError at 33168. Increasing the sample-time or turning of input-scaling yields similar results.
Am I right to assume this is outside of what should be tolerated? Anyone with similar experiences or pointers where to debug next?
Regards,
Andreas