modules/pins/analog: add adc for the esp32#37
Closed
fivdi wants to merge 504 commits intoModdable-OpenSource:publicfrom
fivdi:esp32-adc
Closed
modules/pins/analog: add adc for the esp32#37fivdi wants to merge 504 commits intoModdable-OpenSource:publicfrom fivdi:esp32-adc
fivdi wants to merge 504 commits intoModdable-OpenSource:publicfrom
fivdi:esp32-adc
Conversation
mkellner
pushed a commit
that referenced
this pull request
May 3, 2018
mkellner
pushed a commit
that referenced
this pull request
May 7, 2018
mkellner
pushed a commit
that referenced
this pull request
May 31, 2018
mkellner
pushed a commit
that referenced
this pull request
Jun 1, 2018
mkellner
pushed a commit
that referenced
this pull request
Jun 9, 2018
mkellner
pushed a commit
that referenced
this pull request
Jun 19, 2018
mkellner
pushed a commit
that referenced
this pull request
Jun 22, 2018
mkellner
pushed a commit
that referenced
this pull request
Jul 5, 2018
mkellner
pushed a commit
that referenced
this pull request
Jul 24, 2018
mkellner
pushed a commit
that referenced
this pull request
Aug 9, 2018
mkellner
pushed a commit
that referenced
this pull request
Aug 13, 2018
mkellner
pushed a commit
that referenced
this pull request
Aug 18, 2018
mkellner
pushed a commit
that referenced
this pull request
Aug 21, 2018
mkellner
pushed a commit
that referenced
this pull request
Aug 28, 2018
mkellner
pushed a commit
that referenced
this pull request
Sep 22, 2018
mkellner
pushed a commit
that referenced
this pull request
Oct 1, 2018
mkellner
pushed a commit
that referenced
this pull request
Oct 11, 2018
mkellner
pushed a commit
that referenced
this pull request
Oct 22, 2018
mkellner
pushed a commit
that referenced
this pull request
Oct 30, 2018
mkellner
pushed a commit
that referenced
this pull request
Nov 13, 2018
mkellner
pushed a commit
that referenced
this pull request
Nov 22, 2018
mkellner
pushed a commit
that referenced
this pull request
Dec 20, 2018
mkellner
pushed a commit
that referenced
this pull request
Dec 21, 2018
mkellner
pushed a commit
that referenced
this pull request
Jan 7, 2019
mkellner
pushed a commit
that referenced
this pull request
Jan 29, 2019
mkellner
pushed a commit
that referenced
this pull request
Feb 14, 2019
mkellner
pushed a commit
that referenced
this pull request
Feb 21, 2019
mkellner
pushed a commit
that referenced
this pull request
Mar 11, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds ADC for the ESP32. The ESP32 has two ADC peripherals, ADC1 and ADC2. This PR only adds support for ADC on ADC1 but all eight channels are supported. Support for ADC2 was not added as ADC2 can only be used when Wi-Fi is not used. For additional info see http://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/adc.html#overview.
Note that there are still a number of issues with ADC on the ESP32.
ADC is non-linear and V-REF varies from chip to chip. See espressif/esp-idf#164 and in particular espressif/esp-idf#164 (comment) for more information.
ADC noise and cross coupling. See espressif/esp-idf#1517 for more information.
This PR calls
adc1_to_voltagewhich uses look up tables to avoid the non-linear issue. The millivolt value returned byadc1_to_voltageis then converted to a value between 0 and 1023 which should be linear.