ADC VRef calibration eFuse
Posted: Tue Aug 27, 2019 5:01 pm
I got a Lolin D32 and I'm trying to read the battery voltage with an Arduino sketch. It's pretty close, but seems like it's a bit more inaccurate than it should be. After hours of reading about the calibration process I came to the conclusion that the board I got came with the ADC VRef calibration eFuse already burnt with the default 1100. Here is how I checked:
I ran the example sketch to route the VREF to GPIO 25 and I'm reading 1094 so it is close but not exact. It looks to me like Lolin is just writing the default value without testing.
So my questions are:
I read that eFuse burning is a one time process. Is there any way to overwrite them or am I stuck with 1100 for the VREF now?
Is there an easy way to override the fuse value when calling esp_adc_cal_characterize? No matter what I supply for the VREF param it always gets set to 1100 because the fuse takes priority.
Code: Select all
Sketch:
//Check TP is burned into eFuse
if (esp_adc_cal_check_efuse(ESP_ADC_CAL_VAL_EFUSE_TP) == ESP_OK) {
printf("eFuse Two Point: Supported\n");
} else {
printf("eFuse Two Point: NOT supported\n");
}
//Check Vref is burned into eFuse
if (esp_adc_cal_check_efuse(ESP_ADC_CAL_VAL_EFUSE_VREF) == ESP_OK) {
printf("eFuse Vref: Supported\n");
} else {
printf("eFuse Vref: NOT supported\n");
}
Output:
eFuse Two Point: NOT supported
eFuse Vref: Supported
espefuse.py:
espefuse.py --port COM11 adc_info
Output:
espefuse.py v2.7-dev
Connecting....
ADC VRef calibration: 1100mV
So my questions are:
I read that eFuse burning is a one time process. Is there any way to overwrite them or am I stuck with 1100 for the VREF now?
Is there an easy way to override the fuse value when calling esp_adc_cal_characterize? No matter what I supply for the VREF param it always gets set to 1100 because the fuse takes priority.