Hello NXP team,
We are using ADC1 in our project. I am configured the 26 channel of ADC1 according to the example and detected the voltage, but I don't get the value in the data register. Please help to check whether I have to configure it correctly.
ADC_DRV_ConfigConverter(INST_ADCONV1, &adConv1_ConvConfig0);
ADC_DRV_AutoCalibration(INST_ADCONV1);
/* Configure ADC channel and software trigger a conversion */
ADC_DRV_ConfigChan(INST_ADCONV1, 26U, &adConv1_ChnConfig0);
/* Wait for the conversion to be done */
ADC_DRV_WaitConvDone(INST_ADCONV1);
/* Store the channel result into a local variable */
ADC_DRV_GetChanResult(INST_ADCONV1, 26U, &adcRawValue);
#include "adConv1.h"
/*! adConv1 configuration structure */
const adc_converter_config_t adConv1_ConvConfig0 = {
.clockDivide = ADC_CLK_DIVIDE_4,
.sampleTime = 12U,
.resolution = ADC_RESOLUTION_12BIT,
.inputClock = ADC_CLK_ALT_1,
.trigger = ADC_TRIGGER_SOFTWARE,
.pretriggerSel = ADC_PRETRIGGER_SEL_PDB,
.triggerSel = ADC_TRIGGER_SEL_PDB,
.dmaEnable = false,
.voltageRef = ADC_VOLTAGEREF_VREF,
.continuousConvEnable = false,
.supplyMonitoringEnable = false,
};
const adc_chan_config_t adConv1_ChnConfig0 = {
.interruptEnable = false,
.channel = ADC_INPUTCHAN_EXT26,
};
const adc_compare_config_t adConv1_HwCompConfig0 = {
.compareEnable = false,
.compareGreaterThanEnable = false,
.compareRangeFuncEnable = false,
.compVal1 = 0U,
.compVal2 = 0U,
};
const adc_average_config_t adConv1_HwAvgConfig0 = {
.hwAvgEnable = false,
.hwAverage = ADC_AVERAGE_4,
};
/* END adConv1. */
Solved! Go to Solution.
Hi,
Hi,
Thanks, your reply was of great help to me.