ADC on ADC2

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
elliotwoods
Posts: 23
Joined: Wed Dec 04, 2019 8:11 am

ADC on ADC2

Post by elliotwoods » Tue Jun 16, 2020 7:04 am

Hi all

If i try to open an ADC on pin 26, then i get a`invalid Pin for ADC` error (which is consistent with the documentation which notes that ADC works on pins 32-39 : https://docs.micropython.org/en/latest/ ... conversion).

However, in the ESP32 datasheet, we see that there are ADC channels connected to pins outside of this range, which are channels of ADC2.

I'm wondering if there's a reason why we cannot use ADC2 at the moment with the ESP32 port of micropython

Thank you
Elliot

User avatar
artran
Posts: 3
Joined: Mon Mar 18, 2019 9:45 am

Re: ADC on ADC2

Post by artran » Tue Jun 23, 2020 9:54 am

From a quick look at the source on GitHub it looks like ADC2 is completely unsupported. Only the pins associated with ADC1 are in the list of valid inputs and all of the functions refer to ADC1.

I suspect that the reason is probably because ADC2 is disabled when WiFi is in use and the MicroPython authors are assuming that will be the case more often than not.

Cheers,
Ray

User avatar
elliotwoods
Posts: 23
Joined: Wed Dec 04, 2019 8:11 am

Re: ADC on ADC2

Post by elliotwoods » Tue Jul 07, 2020 10:44 am

Thank Ray. Makes sense

Post Reply