-
Notifications
You must be signed in to change notification settings - Fork 7.7k
docs: Correct ADC default resolution statement for ESP32-S2 #11653
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
base: master
Are you sure you want to change the base?
Conversation
👋 Hello eMUQI, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
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.
Hi @eMUQI, I have checked the code and you are right about the S3. The documentation should say that for S2! Can you please instead of removing it change the S3 to S2? Thanks
Hi @P-R-O-C-H-Y , thanks for the review and clarification! |
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.
LGTM
docs/en/api/adc.rst
Outdated
@@ -52,7 +52,8 @@ This function will return analog value in millivolts (calibrated). | |||
analogReadResolution | |||
^^^^^^^^^^^^^^^^^^^^ | |||
|
|||
This function is used to set the resolution of ``analogRead`` return value. Default is 12 bits (range from 0 to 4095). | |||
This function is used to set the resolution of ``analogRead`` return value. Default is 12 bits (range from 0 to 4095) |
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.
This is only for the chip revision v0.0. For v1.0, the resolution is 12 bits.
Please add a reference to the ADC-112 Bit 1 of SAR ADC Does Not Flip errata.
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.
Hi @eMUQI, can you take a look?
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.
Hi @pedrominatel,
Thanks for the clarification. Just to make sure I understand correctly:
The documentation should specify that the 13-bit default resolution only applies to ESP32-S2 chip revision v0.0, and I should also add a reference to the ADC-112 Bit 1 of SAR ADC Does Not Flip errata.
Is that correct? If so, I will update the PR accordingly.
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.
That's right.
@pedrominatel I've pushed the requested changes. PTAL when you have a moment. Thanks! ![]() |
Description of Change
This PR corrects the documentation for analogReadResolution by removing an incorrect statement that the ESP32-S3 default ADC resolution is 13 bits.
As confirmed by the function's own documentation in the core header file esp32-hal-adc.h, the default resolution for analogRead is 12 bits (producing a range of 0-4095).
Tests scenarios
Compiled and run on Seeed Studio XIAO ESP32S3 in version v3.3.0. By running the standard AnalogReadSerial example code, confirmed that the default output range is 0-4095, corresponding to 12-bit resolution.
Related links
https://docs.espressif.com/projects/arduino-esp32/en/latest/api/adc.html#analogreadresolution
arduino-esp32/cores/esp32/esp32-hal-adc.h
Lines 49 to 56 in c7520cc
https://github.com/espressif/esp-idf/blob/346870a3044010f2018be0ef3b86ba650251c655/components/soc/esp32s3/include/soc/soc_caps.h#L129-L130