New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32S2: Add AnalogIn #3501
ESP32S2: Add AnalogIn #3501
Conversation
Oooer, I was about to ask about this today!!!! |
Unless I'm reading the API Reference wrong, ESP32-S2 ADC1 and ADC2 will allow full-range voltage, but Espressif says most accurate readings at 11dB are between 150 ~ 2600mV (better linearity at the high end than ESP32).
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for switching those headers! Just a few questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replied to the unresolved comments.
@tannewt I removed the logging from shared-bindings - however, we could alternatively add a |
CI is being flaky, it's failed random boards a couple times in a row now. I don't think there's anything actually wrong with this. |
Githib actions degraded https://www.githubstatus.com |
Please update this now that the IDF switch is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Just a couple questions. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
What's the conclusion to all this? I've got a FeatherS2 running |
This PR adds the AnalogIn module to the ESP32-S2 port. The IDF documentation underlying this module can be found here. The ESP32-S2 has more limited configuration options than the ESP32 for its ADC, so we assume the default settings of 13 bit width for measurements and an attenuation of 11DB for the maximum voltage range.
Also unlike the ESP32, the S2 appears to have a hard cap of 2.6V maximum for ADC readings, even at the max attenuation settings. I've asked Espressif whether this is a hardware limitation, or whether it will be raised as the S2 support matures.
This PR requires #3492 for access to the ESP_ADC_CAL component of the ESP-IDF, so it should not be merged until that is submitted. Reviewers may want to hold off until that PR is complete if they want to avoid viewing duplicate changes.
Tested on a Saola 1 Wrover on a 10k pot with a multimeter control. Accurate to ~0.1V up to the max of 2.6V.