I freed up two GPIOs on the Raspberry Pi Pico

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

I freed up two GPIOs on the Raspberry Pi Pico

Post by /RaspberryPi »

I want to use a pico to replace the MCU on a mechanical keyboard, but the keyboard matrix is 7x16 and it has two SPI LED controllers. This means I will need 27 GPIO pins (7+16+ MOSI, SCK, CS_1, CS_2). I don't care about the onbard LED and I plan to power it from USB at all times. I don't need the VBUS sense (GP24) or onboard LED (GP25) connected anymore and with the extra pins liberated I should be able to use a pico for this project.
After pulling up the Pico datasheet, I determined that I could achieve this by removing the two resistors involved with connecting VBUS to GP24 - one between VBUS and GP24, one between GP24 and GND, and removing the LED and the resistor between GP25 and the LED. I then soldered in 26awg wires in their place, so that I can have access to those GPIOs off the board.
Once I completed my work I tested connectivity by using a multimeter, inspected the solder points, and then wrote a simple circuitpython program to alternate between setting GP24 to input (with pulldown) and GP25 to output (output high), and setting GP24 to output and GP25 to input. While that program was running, I connected the two wires together and verified that the GPIO state changed from false to true.
I have pictures of my work taken through a 10x loupe available here: https://imgur.com/a/e8Ccs2o.
These resistors are R3 for the onboard LED/GP25 and both R1 and R10 for VBUS sense/GP24.
I will not need PWM as I am simply setting up a keyboard matrix, but I presume that GP24 does not have PWM support.

Now I need to continue mapping the pins on the existing MCU so I can rebuild the keymatrix in qmk or kmk, desolder the old MCU, solder in the pico, and adapt the firmware to control the LEDs via the two controllers.

One last thing: I could potentially free up two more GPIOs since I don't really need the SMPS mode switch (I could wire it to GND or 3v3 permanently depending on my power requirements) or knowledge of VSYS voltage (since I'll always power from USB), but that's an exercise for the reader if they need 30 GPIO pins and don't want to design their own board.

submitted by /u/HealthyCabinet
[link] [comments]

More...
Post Reply

Return to “Raspberry Pi Forum”