Page 1 of 1

ADC1 attenuation: ADC_ATTEN_MAX

Posted: Thu Jul 16, 2020 7:50 pm
by sergiomarina
I set atten to "ADC_ATTEN_MAX" since it was offered by VSC IntelliSense.
I got the following error:
E (318) RTC_MODULE: C:/esp/esp40branch/esp-idf/components/driver/rtc_module.c:1459 (adc1_config_channel_atten):ADC Atten Err
I'm using ESP-IDF branch 4.0. Menuconfig default except flash size (2MB -> 4MB) and the tick rate (100 -> 1000)

Am I doing a mistake? And I should keep "ADC_ATTEN_DB_11" instead?

other info:
eFuse Two Point: NOT supported
eFuse Vref: Supported
Characterized using eFuse Vref
due to error here above I had coeff_a = 0 , coeff_b = 57236, vref = 1065
which I forced to coeff_a = 4000 , b = 470, v = v00

Please, feel free to ask for more info.
Thank you and best regards, S

Re: ADC1 attenuation: ADC_ATTEN_MAX

Posted: Fri Jul 17, 2020 11:48 am
by ESP_Sprite
ADC_ATTEN_MAX likely indicates the maximum numerical value in that enumeration; you should indeed not use it to set the attenuation.