We are using ESP8684-WROOM-05 H2 module for one of our product developments in which we are going to read ADC values using one shot read example.
We are using ADC1 Channel 4 as per our requirement in which getting 0 values when I connect GND to that PIN which is correct.
But, When I connect with 3.3V High at that time I am getting below output accordingly.
I think when I give 3.3V then it should give maximum RAW Data as 4096.I (64484) EXAMPLE: ADC1 Channel[4] Raw Data: 3427
I (64484) EXAMPLE: ADC1 Channel[4] Cali Voltage: 3303 mV
Below are code configuration for the same.
Code: Select all
#define EXAMPLE_ADC_ATTEN ADC_ATTEN_DB_11
//-------------ADC1 Init---------------//
adc_oneshot_unit_handle_t adc1_handle;
adc_oneshot_unit_init_cfg_t init_config1 = {
.unit_id = ADC_UNIT_1,
};
ESP_ERROR_CHECK(adc_oneshot_new_unit(&init_config1, &adc1_handle));
//-------------ADC1 Config---------------//
adc_oneshot_chan_cfg_t config = {
.bitwidth = ADC_BITWIDTH_12,
.atten = EXAMPLE_ADC_ATTEN,
};
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc1_handle, EXAMPLE_ADC1_CHAN0, &config));
ESP_ERROR_CHECK(adc_oneshot_config_channel(adc1_handle, EXAMPLE_ADC1_CHAN1, &config));
//-------------ADC1 Calibration Init---------------//
adc_cali_handle_t adc1_cali_chan0_handle = NULL;
adc_cali_handle_t adc1_cali_chan1_handle = NULL;
bool do_calibration1_chan0 = example_adc_calibration_init(ADC_UNIT_1, EXAMPLE_ADC1_CHAN0, EXAMPLE_ADC_ATTEN, &adc1_cali_chan0_handle);
bool do_calibration1_chan1 = example_adc_calibration_init(ADC_UNIT_1, EXAMPLE_ADC1_CHAN1, EXAMPLE_ADC_ATTEN, &adc1_cali_chan1_handle);
Let me know if need anything else from my end.