Skip to content

Bug fixes for analogbufio espressif implementation #7879

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

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

milindmovasha
Copy link

  • Changed attenuation value from ADC_ATTEN_DB_0 to ADC_ATTEN_DB_11. This change increases the measurable input voltage range from range of 100 mV - 950 mV to range of 150 mV - 2450 mV. Reference: https://docs.espressif.com/projects/esp-idf/en/v4.4.4/esp32/api-reference/peripherals/adc.html#adc-attenuation

  • Scaling the 12-bit values received from ADC DMA engine to 16-bit value before returning the data. This change makes the values returned via anlogbufio.readinto call 16-bit values similar to 16-bit values returned by analogio module implementation.

2. Scaling the 12-bit values received from DMA engine to 16-bit value
@dhalbert
Copy link
Collaborator

dhalbert commented Apr 19, 2023

Q: do these changes match up (attenuation included), with the values returned by analogio.AnalogIn? If so, that's great, and is what should have been intended.

@tannewt tannewt requested a review from dhalbert April 19, 2023 16:47
@milindmovasha
Copy link
Author

Q: do these changes match up (attenuation included), with the values returned by analogio.AnalogIn? If so, that's great, and is what should have been intended.

Yes, the changes match up with analogio.AnalogIn. Typically one would expect the input voltage range to be from 0v to 3.3v for ESP32 ADC pin. So this change brings it to best possible range 150 mV - 2450 mV.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dhalbert dhalbert merged commit e105bf1 into adafruit:main Apr 19, 2023
@milindmovasha milindmovasha deleted the espressif_analogbufio_fix branch April 19, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants