sekigon-gonnoc / Pico-PIO-USB

USB host/device implementation using PIO of raspberry pi pico (RP2040).
MIT License
1.37k stars 146 forks source link

🪲[BUG] GPIOs > 32 not working #133

Open arturo182 opened 3 months ago

arturo182 commented 3 months ago

As per 11.1.1 of the RP2350 datasheet, a new register GPIOBASE is added to specify which pin the PIO treats as GPIO 0:

image

For RP2350 the valid values are 0 and 16, indicating the PIO instance has access to pins 0-31, or 16-47 respectively: image

The function to set this register can be found here: https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_pio/include/hardware/pio.h#L788

arturo182 commented 3 months ago

Just double-checked for sanity's sake and my code works on pins 30-31 with no issues, however, it doesn't on 38-39 (as expected).