lbernstone wrote: ↑Tue Jul 18, 2023 5:12 pm
You should use 0 for the 4th parameter in characterize in order to use the factory measured calibration setting stored in efuse
Re-run the program with efuse check-up first:
Code: Select all
esp_err_t err = esp_adc_cal_check_efuse(ESP_ADC_CAL_VAL_EFUSE_TP); //run this line twice with arg=ESP_ADC_CAL_VAL_EFUSE_VREF
switch (err) {
case ESP_OK:
Serial.println(F("The calibration mode is supported in eFuse."));
break;
case ESP_ERR_NOT_SUPPORTED:
Serial.println(F("Error, eFuse values are not burned."));
break;
default:
Serial.println(F("Error, invalid argument (ESP_ADC_CAL_VAL_DEFAULT_VREF)."));
};
err = esp_adc_cal_check_efuse(ESP_ADC_CAL_VAL_EFUSE_VREF);
The result is :
Error, eFuse values are not burned.
Error, eFuse values are not burned.
Now I run
Code: Select all
esp_adc_cal_value_t efuse = esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_11, ADC_WIDTH_BIT_12, 0, &adc_chars);
with the 4th param set 0. Value of efuse returns 3, but adc_chars.vref remains 0.
Not sure if it is a problem of my chip so I turned to the native example
esp-idf\examples\peripherals\adc\oneshot_read\main\oneshot_read_main.c but it confirms that my chip supports a calibration scheme of Curve Fitting (see attachment for results).
What did I miss with esp_adc_cal_characterize()?