AnsweredAssumed Answered

ADC Driver function with parameter channel group

Question asked by Kewal Deshpande on Jan 20, 2016
Latest reply on Jan 20, 2016 by Alice_Yang

I am getting confused or rather my understanding is improper about the channel group.


I have configured my project using KDS 3.0 with KSDK 1.2.0 with FSL_ADC as one of the component. I have generated the code and trying to read the data on the pin.

   // Software trigger the conversion.   ADC16_DRV_ConfigConvChn(FSL_ADCONVVM, ADC16_CHN_GROUP0, &adConvVM_ChnConfig0);   // Wait for the conversion to be done.   ADC16_DRV_WaitConvDone(FSL_ADCONVVM, ADC16_CHN_GROUP0);   // Fetch the conversion value.   VoltageLevel = ADC16_DRV_GetConvValueSigned(FSL_ADCONVVM, ADC16_CHN_GROUP0);   printf("Read 12V DAC Value %d\r\n",VoltageLevel);



Now, ADC16_CHN_GROUP0 is the what I have defined as 0 assuming the ADC0 being ADC channel group 0 and ADC channel group 1 to be ADC1.


I am always getting a value of 255 when I read the data on any of the pins. Why did the generated code does not have a define for channel group. Am i using the driver functions properly.


to describe a little more on the voltage measuring input. my Vref is given 3 V and the 12V source is given to ADC0_DP0 using voltage divider and limited within 3V.