I’ve just purchased a SparkFun Thing Plus (ESP32-S2 WROOM) (https://www.sparkfun.com/products/17743) and I’m a bit confused by both some readings I’m seeing off a MEMS microphone and some conflicting documentation.
The Thing Plus features list and hookup guide mention that the ADC is 12-bit. The hookup guide also links to a v1.1 ESP32-S2 datasheet (https://cdn.sparkfun.com/assets/7/8/e/4 … eet.pdf#3d) which echos that assertion - 2x 12-bit ADCs.
That said, when I look at any other documentation for the ESP32-S2, I see mentions of 13-bit ADC, including in the most up to date datasheet (https://www.espressif.com/sites/default … eet_en.pdf) and the expressif library documentation (https://docs.espressif.com/projects/esp … s/adc.html).
Is this an older reference chip using an older ADC or is the documentation wrong? If it is 12-bit, I don’t see a way to set it to 12-bit properly using the expressif library with this board as the target, as only ADC_WIDTH_BIT_13 is valid.
Regarding the readings I’m seeing - I’m consistently seeing an ambient number around ~5250, which doesn’t really line up with my understanding of where it should idle for either 12-bit OR 13-bit.
This datasheet says The ESP32-S2 integrates two 13-bit SAR (Successive Approximation Register) ADCs.
https://docs.espressif.com/projects/esp … s/adc.html
That’s my entire point. The generic ESP32-S2 documentation says 13-bit but all of the literature around the SparkFun thing plus says 12-bit.
My question is which one is right, and if it’s the reference architecture docs, then surely the SparkFun docs should be updated?
It does not seems to be a hardware issue: The Sparkfun library can only handle up to 12 bits, the library-code does not support 13 bits.
In the expressif library for an ESP32-S2 SOC_ADC_MAX_BITWIDTH is defined as 13 bits, where for the other ESP32 versions it is defined as 12. In their file adc_types.h as a result it defines the valid options :
typedef enum {
#if CONFIG_IDF_TARGET_ESP32
ADC_WIDTH_BIT_9 = 0, /*!< ADC capture width is 9Bit. */
ADC_WIDTH_BIT_10 = 1, /*!< ADC capture width is 10Bit. */
ADC_WIDTH_BIT_11 = 2, /*!< ADC capture width is 11Bit. */
ADC_WIDTH_BIT_12 = 3, /*!< ADC capture width is 12Bit. */
#elif SOC_ADC_MAX_BITWIDTH == 12
ADC_WIDTH_BIT_12 = 3, /*!< ADC capture width is 12Bit. */
#elif SOC_ADC_MAX_BITWIDTH == 13
ADC_WIDTH_BIT_13 = 4, /*!< ADC capture width is 13Bit. */
#endif
ADC_WIDTH_MAX,
} adc_bits_width_t;