u2if icon indicating copy to clipboard operation
u2if copied to clipboard

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

Open zrezke opened this issue 2 years ago • 2 comments

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.

zrezke avatar Jul 13 '23 12:07 zrezke

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.

freemansoft avatar Jan 29 '25 01:01 freemansoft

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

zrezke avatar Jan 29 '25 23:01 zrezke