ADC oneshot calibration max 3.114 (5.1.1 is worse) What is going on please?

greg-dickson
Posts: 24
Joined: Sun Nov 01, 2020 1:51 am

ADC oneshot calibration max 3.114 (5.1.1 is worse) What is going on please?

Postby greg-dickson » Thu Aug 10, 2023 2:54 pm

I was just experimenting with the ADC one shot read and found that reading a pin basically pulled high will max out at 3.114 volts.
The actual measured voltage at the pin is 3.3v.

Is this normal or is there something wrong.
  1. if((adc->error = adc_oneshot_read(adc_handle, adc->adc_channel , &(adc->raw_result))) == ESP_OK)
  2.     {
  3.           ESP_LOGI(TAG, "ADC%d Channel[%d] Raw Data: %d",adc->unit_id, adc->adc_channel, adc->raw_result);
  4.           if (do_calibration == ESP_OK)
  5.           {
  6.             adc->error = adc_cali_raw_to_voltage(adc_cali_handle, adc->raw_result, &(adc->millivolts));  
  7.             ESP_LOGI(TAG, "ADC%d Channel[%d] Calibrated Data: %d",adc->unit_id, adc->adc_channel, adc->millivolts);
  8.           }
  9.     }
produces
adc_gpio_read: ADC0 Channel[2] Raw Data: 4095
adc_gpio_read: ADC0 Channel[2] Calibrated Data: 3114

Also then doing a resistance calculation on a voltage divider (using the calibrated millivolts) I need to use 3.25 instead of 3.3v as the supply voltage to get reasonable resistance values across the unknown side of the divider.
Last edited by greg-dickson on Thu Sep 07, 2023 5:35 pm, edited 1 time in total.

greg-dickson
Posts: 24
Joined: Sun Nov 01, 2020 1:51 am

Re: ADC oneshot calibration max 3.114 volts

Postby greg-dickson » Thu Sep 07, 2023 10:41 am

Oh My go esp-idf5.1.1 is worse
This is on several S3 units.

Code: Select all

 
(14593) truc_adc_gpio_read: ADC0 Channel[2] Raw Data: 4095
(14593) truc_adc_gpio_read: ADC0 Channel[2] Calibrated Data: 3076
What's going on guys?

Who is online

Users browsing this forum: brushlow18 and 118 guests