Other Parts Discussed in Thread: HALCOGEN
Hello all,
I have been having a bit of trouble getting the Pin ID from the ADC pointer. Right now I am using ADC1 Group 1 and have Pin 6 and Pin 3 enabled. I then use the following function to assign both ADC capture values to local variables:
int value1 = 0; int value2 = 0; adcData_t adc1_data; //ADC Data Structure adcData_t *adc1_data_ptr = &adc1_data; //ADC Data Pointer
adcStartConversion(adcREG1, adcGROUP1); //Start ADC conversion while(!adcIsConversionComplete(adcREG1, adcGROUP1)); //Wait for ADC conversion adcStopConversion(adcREG1, adcGROUP1);
adcGetData(adcREG1, 1U, adc1_data_ptr); //Store conversion into ADC pointer value1 = (unsigned int)adc1_data_ptr -> value; //Store measured value locally
adcGetData(adcREG1, 1U, adc1_data_ptr); //Store conversion into ADC pointer value2 = (unsigned int)adc1_data_ptr -> value; //Store measured value locally
The issue I have been having is the ID for both captures seems to always be 0. I'm not sure if there is some extra step in the ADC capture process that I am missing but any help would be greatly appreciated.
Thank you in advance for your help.