Skip to content
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

Fix ADC GPIO range from 26-28 to 26-29 #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zrezke
Copy link

@zrezke zrezke commented Jul 13, 2023

GPIO26-29 are shared with ADC inputs AIN0-3
https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf#page=564&zoom=100,153,865

  • Basically GPIO29 wasn't being configured as ADC since getAdcIndexFromGpio returned -1 on GPIO 29

This also includes this fix.

@freemansoft
Copy link

freemansoft commented Jan 29, 2025

https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf. Pin 29 can only be used to read the VBus voltage according to the datasheet https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf. Not useful as a general pin.

@zrezke
Copy link
Author

zrezke commented Jan 29, 2025

Hmm seems yes, I didn't know about it. Thanks for commenting.
That's a pico specific thing though, the rp2040 itself does have 4 ADCs, (+internal temp sensor ADC), so for custom boards this change is useful. I guess on Pico it also doesn't hurt to be able to read the VBUS voltage :)

https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf

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