Page 1 of 1

Maker Pi RP2040 Available GP Pins

PostPosted: Tue Jul 12, 2022 2:39 am
by wmatchett
I am trying to maximize GP pin usage. Pins 1,3,5,17,26,27, and 28 work fine. But when I attempt to initialize the GPIO paired pins of these (0,2,4,6,7,16,26) with this code:
CODE: SELECT_ALL_CODE
tp1 = digitalio.DigitalInOut(board.GP0)

I get the error:
CODE: SELECT_ALL_CODE
ValueError: GP0 in use

Can these pins be used and how are they initialized?

Re: Maker Pi RP2040 Available GP Pins

PostPosted: Wed Jul 13, 2022 6:18 pm
by waiweng83
Have you try out the code here?
https://github.com/CytronTechnologies/M ... de/code.py

It does utilize all the GPIO pins without any problem.

Re: Maker Pi RP2040 Available GP Pins

PostPosted: Tue Jul 19, 2022 3:05 am
by wmatchett
waiweng83 WROTE:Have you try out the code here?
https://github.com/CytronTechnologies/M ... de/code.py

It does utilize all the GPIO pins without any problem.


Yes, inj fact this was the problem. I used this sample as a baseline to start testing and forgot about the LED pins. I had commented out the last pin of all the GPIO ports several days before and forgot about doing it. When I went back to use the other pin I did not remove from the LED usage and they were already in use. I commented out pin0 and it works fine.

Thanks for the help.