I'm making a custom keyboard with a Raspberry Pi Pico as the MCU, and i don't understand what all the different pins are for and how they should be wired up to my key matrix and trackpoint.
My current understanding is that GPIO are normal pins that can be wired to the rows and columns, but what of VBUS, VSYS, 3V3, and all the others that aren't just GPIO or GND? And how should the ground pins be used here?

The schematic currently doesn't include the trackpoint because i'm planning to hand wire it and the MCU to the PCB, so i can put them under the PCB in the case and i don't have to try to fit them onto the board. Is there a better way to connect these that won't require adding a bunch of space to the board to fit the MCU?

10 Comments
curbstickle@anarchist.nexus · 9 pts · 312d
So there is a LOT to cover on this, but I'm going to try and keep it to simple overviews.
Edited to add: You'll use GND (ground) shared for all of these keys.
IndigoGollum@lemmy.world · 2 pts · 310d
Can i wire up every row to a ground pin as well as a normal IO pin or do i need to do something more with that?
curbstickle@anarchist.nexus · 2 pts · 310d
I'd recommend a read here:
https://www.crackedthecode.co/a-complete-guide-to-building-a-hand-wired-keyboard/
It has a solid overview of each step
AnnaFrankfurter@lemmy.ml · 5 pts · 312d
Create ground plane - 1 entire layer for ground. You'll just use via to connect them
read the data sheet it'll explain what each pin does. Most of the times single pin can act as multiple things and you need to set certain bit to use certain functions.
for layout fan out from MCU and then on 1 layer try to be horizontal and on another vertical.
when it comes to crowded board vias are both your friends and enemies so use them wisely.
make sure the track length, spacing between track and a via, diameter of via, etc. Are within spec for your manufacturer.
check if any pins are differential pair. If so again adjust your software settings. I think vBUS is a for maybe usb but check datasheet.
You may also want to check out Robert Feranec's YouTube channel he has some really good videos. Even one on full end to end keyboard design https://www.youtube.com/playlist?list=PLXvLToQzgzdftro2qK5In8p6ExsDFdpzw
apt_install_coffee@lemmy.ml · 3 pts · 312d
You can put the MCU and other circuitry on the underside, but perhaps use at least a 3-layer PCB so you can run an internal ground plane under the power components.
Is this keyboard a one-off or are you doing production runs? Try to keep all the SMD components on the same side if you can.
If you're using the pico rather than a bare RP2040, you'll have a much harder time putting anything on the underside though.
IndigoGollum@lemmy.world · 1 pts · 311d
It's a one off, just for me to use. The case i just finished designing has room for the Pico, trackpoint, and wires to those under where the PCB will go.
How does the ground plane usually work on keyboards with only 2 layers? Would it be enough to just connect everything to a ground pin instead of paying for a third layer?
apt_install_coffee@lemmy.ml · 1 pts · 311d
If you can reasonably have the entire bottom layer be connected to ground without the top layer being too crowded, 2 layers could work.
Wires to the underside components? Can you solder them to thru-holes on the underside of the PCB instead?
IndigoGollum@lemmy.world · 2 pts · 310d
Not without moving some switches to fit the trackpoint and diodes to fit the Pico. But how hard can hand wiring that one part be⸮
I'm still not clear on how the ground should work. Is it enough to just wire every row to a ground pin as well as a normal input pin?
apt_install_coffee@lemmy.ml · 2 pts · 310d
I was halfway through a message about return path impedance, but remembered the pico is a carrier board with its ground built in it's USB connector, and the switches are hardly going to care.
My bad, you'll be fine 👍
JustVik@lemmy.ml · 1 pts · 312d
VBUS, VSYS, 3V3 - it is all power pins.
As I understand by reading in the datasheet there are 3 ways to power the Pico board:
-USB Micro-B port
-VBUS Pin
-VSYS Pin
============================
VBUS - can be used for output
VSYS - can be used for output
3v3 - output power 3.3v
GND - ground
From datsasheet:
"VBUS is the micro-USB input voltage, connected to micro-USB port pin 1. This is nominally 5V (or 0V if the USB is not connected or not powered). VSYS is the main system input voltage, which can vary in the allowed range 1.8V to 5.5V, and is used by the on-board SMPS to generate the 3.3V for the RP2040 and its GPIO. 3V3_EN connects to the on-board SMPS enable pin, and is pulled high (to VSYS) via a 100kΩ resistor. To disable the 3.3V (which also de-powers the RP2040), short this pin low. 3V3 is the main 3.3V supply to RP2040 and its I/O, generated by the on-board SMPS. This pin can be used to power external circuitry (maximum output current will depend on RP2040 load and VSYS voltage, it is recommended to keep the load on this pin less than 300mA)
ADC_VREF is the ADC power supply (and reference) voltage, and is generated on Pico by filtering the 3.3V supply. This pin can be used with an external reference if better ADC performance is required. AGND is the ground reference for GPIO26-29, there is a separate analog ground plane running under these signals and terminating at this pin. If the ADC is not used or ADC performance is not critical, this pin can be connected to digital ground. RUN is the RP2040 enable pin, and has an internal (on-chip) pull-up resistor to 3.3V of about ~50kΩ. To reset RP2040, short this pin low."
But I'm not proffessional with microcontrollers.