Skip to content

ESP32-S2 ADC2 Issue (IDFGH-3834) #4265

Closed
@DitroniX

Description

@DitroniX

Using the Arduino IDE, the ESP32-S2 ADC1 channels (GPIO 1 through 10) work fine and gives back the expected reading.

// Read ADC (30V DC FSV - 0 to 8191 - 13bit)
uint32_t PCB_Voltage;
PCB_Voltage = ((analogRead(9) * 30 ) / 8191);
Serial.println(PCB_Voltage);

However, if I use any ADC2 channels (GPIO 11 through 20) ), I get an error:

// Read ADC (30V DC FSV - 0 to 8191 - 13bit)
uint32_t PCB_Voltage;
PCB_Voltage = ((analogRead(17) * 30 ) / 8191);
Serial.println(PCB_Voltage);

E (4127) ADC: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/driver/adc_common.c:476 (adc2_get_raw):WIDTH ERR: ESP32S2 support 13 bit width

PS. The below basic code does the same, only on ADC2, so excluding any value manipulation

analogReadResolution(13);
Serial.println(analogRead(17));

Question: Is this a permanent restriction for ADC2, or simply due to beta code?

Original Post: https://www.esp32.com/viewtopic.php?f=19&t=16950&p=63996#p63996

Thanks
Dave

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions