ESP32c3 ADC channels

FastBoatUS1
Posts: 2
Joined: Fri Feb 03, 2023 3:37 pm

ESP32c3 ADC channels

Postby FastBoatUS1 » Fri Feb 03, 2023 4:08 pm

My design has analog input channels on IO0 and IO1 and a ESP32-C3-MINI-1-N4 module on it.
I have configured the channels with :
ESP_ERROR_CHECK(adc1_config_width(ADC_WIDTH_BIT_DEFAULT));
ESP_ERROR_CHECK(adc1_config_channel_atten(ADC1_CHANNEL_0, ADC_ATTEN_DB_6));
ESP_ERROR_CHECK(adc1_config_channel_atten(ADC1_CHANNEL_1, ADC_ATTEN_DB_6));
IO0 has 1.6 volts on it, IO1 has 1.5 volts (precision external vRef) on it.
When I read the channels using adc1_get_raw(ADC1_CHANNEL_0); and adc1_get_raw(ADC1_CHANNEL_1);
Channel 0 returns a count of 20 (equals 8.5 mVolt)-Incorrect
Channel 1 returns a value of 3455 = (equals 1.69V) - Correct (within range of adc1's capabilities) and is used to determine scale factor
Whatever input I give channel 0, from 1.6 to 1.2 in my case, I get a reading of 20-24.

Has anyone had this issue (or success) reading channel 0 data with the esp32c3 device?
Thanks!

Who is online

Users browsing this forum: No registered users and 47 guests