Hey everyone.
I wonder how we can use the CC2650 senssortag ADC with the contiki software.
I created this code, getting inspired with this topic https://e2e.ti.com/support/wireless_connectivity/f/538/p/404426/1433112#1433112
#define SAMPLETYPE uint16_t static SAMPLETYPE get_adc(void) { SAMPLETYPE singleSample; //intialisation of ADC // Enable clock for ADC digital and analog interface (not currently enabled in driver) AUXWUCClockEnable(AUX_WUC_ADI_CLOCK|AUX_WUC_SOC_CLOCK); // was : AUX_WUC_MODCLKEN0_SOC_M|AUX_WUC_MODCLKEN0_AUX_ADI4_M); printf("clock selected\r\n"); // Connect AUX IO7 (DIO23 & DP2) as analog input. AUXADCSelectInput(ADC_COMPB_IN_AUXIO7); printf("input selected\r\n"); // Set up ADC range // AUXADC_REF_FIXED = nominally 4.3 V AUXADCEnableAsync(AUXADC_REF_FIXED, AUXADC_TRIGGER_MANUAL); printf("init adc --- OK\r\n"); //Trigger ADC converting AUXADCGenManualTrigger(); printf("trigger --- OK\r\n"); //reading adc value singleSample = AUXADCReadFifo(); printf("reading --- OK\r\n"); AUXADCFlushFifo(); printf("flush --- OK\r\n"); //shut the adc down AUXADCDisable(); printf("disable --- OK\r\n"); return singleSample; }
But this doesn't work. Actually i work only once, but then it does'nt.
I tried to separate the init to the trigger and reading, but it is the same. I think it should be a flag problem. Any ideas ?